logo       

Antwort: RE: Custom Resource Model Problem: msg#00466

sysutils.tivoli.tme10

Subject: Antwort: RE: Custom Resource Model Problem


Hi,

sorry, it don't works !

The trace shows:
Jan 27 20:22:59 3 Checkport 1584 RM TRACE: Start VisitTree
Jan 27 20:22:59 0 Analyzer 1584 Error occurred while running
Script. The line is Source line not available - Context:13911344 - Line 153
- Col 17 - Descr Falsche Anzahl an Argumenten oder ungültige
Eigenschaftszuweisung - Source Laufzeitfehler in Microsoft JScript
Jan 27 20:22:59 2 Analyzer 1584 The Script is being left
Jan 27 20:22:59 0 Analyzer 1584 Error while calling 'VisitTree'
Subroutine E:\PROGRA~1\Tivoli\lcf\dat\1\LCFNEW\Tmw2k\dec\Checkport.js
Jan 27 20:22:59 0 Analyzer 1584 Error while visiting the
decision tree Checkport step number 0
Jan 27 20:22:59 0 Analyzer 1584 Exiting thread of the resource
model Checkport at step number 0, due to a scripting exception
Jan 27 20:22:59 2 Analyzer 1584 Async Collection successfully
stopped for the model Checkport
Jan 27 20:22:59 0 Analyzer 1584 Error while running the model
Checkport, error code 24, message Error not Decoded (24) !
Jan 27 20:22:59 1 Analyzer 1584 Destroying the script site...

The problem seems to be "var perlpath =
Svc.GetStrParameter("param_perl_path");" but I don't know why ?
The parameter param_perl_path should be d:/programme/perl/bin/perl.exe ...

Thanks in advance

Lars





"john willis"
<john_willis@gulf
soft.com> An
Gesendet von:
<tme10-XtjxT7Vmt5b1ENwx4SLHqw@xxxxxxxxxxxxxxxx>
owner-tme10@lists Kopie
.us.ibm.com
Thema
RE: [tme10] Custom Resource Model
27.01.2005 19:08 Problem


Bitte antworten
an
tme10-XtjxT7Vmt5b2/ifjfJUUEg@xxxxxxxxxxxxxxxx

m.com






Try:

curScriptResult = Svc.Shell(perlpath + " chkport.pl " + host + " "
+port);


John Willis
Gulf Breeze Software
www.gulfsoft.com
OpenESM Project
www.sourceforge.net/projects/gulfsoft


-----Original Message-----
From: owner-tme10-XtjxT7Vmt5b1ENwx4SLHqw@xxxxxxxxxxxxxxxx
[mailto:owner-tme10-XtjxT7Vmt5b1ENwx4SLHqw@xxxxxxxxxxxxxxxx]
On Behalf Of lars.kleiner-QGvAMEw2u1+ELgA04lAiVw@xxxxxxxxxxxxxxxx
Sent: Thursday, January 27, 2005 12:46 PM
To: tme10-XtjxT7Vmt5b1ENwx4SLHqw@xxxxxxxxxxxxxxxx
Subject: Re: [tme10] Custom Resource Model Problem


Hi,

I would like to add the parameter "param_perl_path" (for example:
c:/perl5/bin/perl.exe) to my resource model ...

But I get errors while running the script !
The problem is the following:

..........
Svc.DefineStrParameter ("param_perl_path",
"C:/Tivoli/Perl/bin/Perl5.exe");
...........
var perlpath = Svc.GetStrParameter("param_perl_path");
curScriptResult = Svc.Shell("+perlpath+ chkport.pl "+host+" "+port);


Any ideas ?

Lars

My script:
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
// Decision Tree script
//
// This file was generated by the IBM Tivoli Resource Model Builder.
//
// 01/21/2004 18:56:36
//
// Änderungen wurden durchgeführt von Lars Kleiner 21.01.2004
//
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

// Trace constants to be used by Svc.Trace calls.

var TRACE_ERROR = 0;
var TRACE_FINE = 1;
var TRACE_FINER = 2;
var TRACE_FINEST = 3;

// This variable can be used in your Svc.Trace calls to make it easier
to
// search through the log file and find calls made by the resource
models.

var TRACE_SOURCE = "RM TRACE: ";

// Return code constants for various error conditions.

var RC_COLLECTION_ERROR = 407;
var RC_INVALID_METRIC = 406;
var RC_INVALID_RESOURCE_TYPE = 801;
var RC_INVALID_VERSION = 802;
var RC_RESOURCE_UNAVAILABLE = 405;

var flagNotFirstRun = 0;
var hTableScriptResult;
var allHosts = new Array();
var allPorts = new Array();
var paramInstances;


// This function defines the default settings of the resource model.
// It is called only once, when the resource model is started.
// Don't modify remarks containing tags like <<....>> ... <<\...>>
// You can write additional initializing code in this function if
required.

function SetDefaultConfiguration(Svc)
{
Svc.Trace(TRACE_FINEST, TRACE_SOURCE + "Start
SetDefaultConfiguration");

// General info section
//<<GENERAL_INFO>>
Svc.SetModelName ("Checkport");
Svc.SetProfileName ("1106842375129");
Svc.SetCycleTime (60);
//<<\GENERAL_INFO>>

// Thresholds section
//<<THRESHOLDS_INFO>>
Svc.DefineThreshold ("thr_result", 0.0);
//<<\THRESHOLDS_INFO>>

// Parameters section
//<<PARAMETERS_INFO>>
Svc.DefineStrParameter ("param_host_port", "ogtivadmin01;9495");
Svc.DefineStrParameter ("param_perl_path",
"C:/Tivoli/Perl/bin/Perl5.exe");
//<<\PARAMETERS_INFO>>

// Dynamic model section
//<<DATA_INFO>>
//<<\DATA_INFO>>

// Event definition section
//<<EVENTS_INFO>>
Svc.DefineEvent ("PortFailed" , "MatchingValue,ScriptResult",
"port,host");
//<<\EVENTS_INFO>>

// Logging definition section
//<<LOGGING_INFO>>
//<<\LOGGING_INFO>>

// Place your additional intializing code below.

Svc.Trace(TRACE_FINEST, TRACE_SOURCE + "End
SetDefaultConfiguration");
return (0);
}


// This function is called by the monitoring engine after the resource
// model default settings have been overridden. It is called only once,
// when the resource model is started. You can write additional
// initialization code in this function if required.

function Init(Svc)
{

var k;
var words = new Array(2);

Svc.Trace(TRACE_FINEST, TRACE_SOURCE + "Start Init");

hTableScriptResult = Svc.CreateMap();
hTableParameters = Svc.CreateMap();

paramInstances = Svc.GetStrParameterCount("param_host_port");

if (paramInstances > 0)
{
for (k = 0; k < paramInstances; k++)
{
var line = new
String(Svc.GetStrParameter("param_host_port",k));

words = line.split(/;/);
allHosts[k] = words[0];
allPorts[k] = words[1];
}

}
return (0);

}


// This function contains the monitoring algorithm. It is called
// once per cycle. Implement the monitoring code here.

function VisitTree(Svc)
{
Svc.Trace(TRACE_FINEST, TRACE_SOURCE + "Start VisitTree");

//vars for data source: perl chkport.pl oginnb50 9495
var curScriptResult;
var hashKey;
var found;
var OldScriptResult;
var hPropTable;
var hTableScriptResult;
var ParamCount;
var ParamIdx;
var Different;

//Zusätzliche Variablen
var k;
var host;
var port;

if (paramInstances > 0)
{

for (k = 0; k < paramInstances; k++)
{
hPropTable = Svc.CreateMap();
hTableScriptResult = Svc.CreateMap();
host = allHosts[k];
port = allPorts[k];
Svc.RemoveMapAll(hPropTable);
var perlpath =
Svc.GetStrParameter("param_perl_path");
curScriptResult = Svc.Shell("+perlpath+ chkport.pl
"+host+" "+port);
Svc.SetMapNumElement(hPropTable, "ScriptResult",
curScriptResult);
found = Svc.ExistsMapElement(hTableScriptResult,
hashKey);
if (found)
OldScriptResult =
Svc.GetMapNumValue(hTableScriptResult, hashKey);
else
OldScriptResult = 0;

if (curScriptResult ==
Svc.GetThreshold("thr_result")) {
Svc.SetMapNumElement(hPropTable,
"MatchingValue",
Svc.GetThreshold("thr_result"));
Svc.SetMapStrElement(hPropTable, "host",
host);
Svc.SetMapStrElement(hPropTable, "port",
port);
Svc.SendEventEx ("PortFailed", hPropTable);
}

Svc.SetMapNumElement(hTableScriptResult, hashKey,
curScriptResult);

flagNotFirstRun = true;

}

Svc.DestroyMap(hPropTable);

}

return (0);

}



------------------- L E G A L D I S C L A I M E R
-----------------------
Die Informationen in dieser Nachricht sind vertraulich und
ausschliesslich fuer den Adressaten bestimmt.
Kenntnisnahme durch Dritte ist unzulaessig. Die Erstellung
von Kopien oder das Weiterleiten an weitere, nicht originaere
und benannte Adressaten ist nicht vorgesehen und kann
ungesetzlich sein.
Die Meinungen in dieser Nachricht stellen lediglich die
Meinungen des Senders dar. Falls Sie vermuten, dass diese
Nachricht veraendert wurde, setzen Sie sich mit dem
Absender in Verbindung.
Die Markant Handels und Service GmbH uebernimmt ohne
weitere Ueberpruefung keine Verantwortung fuer die
Richtigkeit und Vollstaendigkeit des Inhalts.
Unbefugte Empfaenger werden gebeten, die Vertraulichkeit
der Nachricht zu wahren und den Absender sofort ueber
einen Uebertragungsfehler zu informieren.










<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise