Start a Conversation

Unsolved

This post is more than 5 years old

378

October 2nd, 2008 01:00

Dynamic Model - ASL

Hello all.
I have a trouble with Dynamic Model and Instrumentation class

I have created Instrumentation class with 1 instrumented attribute

# - Code
interface ApplicationProcessInstrument:ICIM_Instrumentation
{
instrument SNMP {
ApplicationProcessStatus = "1.3.6.1.2.1.4.1"
};

instrumented attribute int ApplicationProcessStatus
"Is application process up or not 1 is up 2 is down";
}
# -- end of code

then, have created my own class MyApplication inherited from ICIM_LogicalElement

# -- Code


interface MyApplication : ICIM_LogicalElement
"Instrumentation class used to monitor status of a database."
{
relationship HostedBy, Host, Hosts;

propagate attribute int min MyAppStatus
"is the application is running or not?"
<= ApplicationProcessInstrument, InstrumentedBy, ApplicationProcessStatus;

event Down "The application seems to be down"
= MyAppStatus == 2;
export Down;
}
# -- End of Code

Then, load accessor.asl code
# -- Code


Debug = TRUE;

default Timeout = "700" ;
default Retries = "3";

default appName = "MySQL";
default InstrumentationName="ApplicationProcessInstrument"; // this variable can be passed in via the sm_adapter -D option

// SNMP Polling Parameters

default ReadCommunity = "public"; // this will be ignored for SNMP v3
default WriteCommunity = "public"; // this will be ignored for SNMP v3
default AgentVersion = "V1"; // V3 Specific Polling Parameters
default EngineID = ""; // Can be left blank
default EngineBoots = 0; // Leave as 0
default EngineBootTime = 0; // Leave as 0
default UserName = ""; // If authentication enabled, set to a valid user name
default AuthProtocol=""; //To enable authentication, set to "MD5" or "SHA"
default AuthPassword = ""; //If authentication enabled, set to the user's password
default Context = ""; // Can be left blank
default PollingInterval =30;
default index="";

poller = object(getInstances("SNMP_AccessorInterface")[0]);

START() {
eol
}
do
{
// Convert the time to milli-seconds
Timeout = numeric(Timeout) / 1000;

appObject = object("MyApplication",appName);
print("Application object name is ".appObject->Name);
if (!appObject->isNull())
{
print("app is hosted by ".appObject->HostedBy);
hostObject = object(appObject->HostedBy);
snmpAddress = hostObject->SNMPAddress;
print("SNMPAddress is : ".snmpAddress);
applicationInstrumentation = appObject->makeInstrumentation(InstrumentationName);
print("Instrumentation is : ".applicationInstrumentation);

ReservedForFutureUse = "";
poller->instance_instrumentations +=
list(applicationInstrumentation->Name,
snmpAddress,
index,
ReadCommunity,
WriteCommunity,
EngineID,
EngineBoots,
EngineBootTime,
UserName,
AuthProtocol,
ReservedForFutureUse,
AuthPassword,
ReservedForFutureUse,
Context,
AgentVersion) ? LOG,FAIL;

poller->polling_parameters +=
list(applicationInstrumentation->Name,
numeric(PollingInterval),
-1,
numeric(Timeout),
numeric(Retries),
TRUE) ? LOG,NEXT; //change -1 to TRUE for SNMP trace logging

print("Completed adding instance to accesor");
}
stop();
}
DEFAULT {
line:{..eol}
}
do {
print("Bad input: ".line);
}
# -- End of Code

So, after running load_accessor.asl, the InstrumentedBy relationship was no added to Class MyApplication::MySQL and attribute was not propagated

IP 7.03

Code examples from http://www.ifountain.com/
No Responses!
No Events found!

Top