Unsolved
This post is more than 5 years old
14 Posts
0
1793
August 9th, 2010 20:00
ASL for displaying IP Address of devices
Hi All,
Could you please tell me the script to display IP addresses of the network devices in the notification console (in one of the user defined field) .I am quite new to scripting and with the ASL I am trying to display the IP addresses , I am just getting the IPs of the routers and switches going down and not for any interface down or memory high utilization for those routers or switches. I have put the following ASL , please tell me what changes do I require to do?
**********************************************************************
START
{
}
do
{
if (NotificationName == "")
{
print("InternalError: dxa-aslsam-notification.asl ".
"did not receive NotificationName!");
return;
}
// Get a handle to the notification object in SAM
eventObj = self->object(NotificationName) ? IGNORE;
// Verify that the handle is good
if ( !eventObj->isNull()) {
// Get the class name from the Notification
className = eventObj->ClassName ? IGNORE;
if ( TRUE ) {
if ( debug ) {
print(" className = ".className );
}
// Getting to the device in SAM
deviceObj = self->object( eventObj->InstanceName ) ? IGNORE;
// Getting the device in the underlying server
remDeviceObj = object( eventObj->InstanceName ) ? IGNORE;
accessObjs = remDeviceObj->HostServices;
foreach accessObj (accessObjs)
if ( ( !deviceObj->isNull() ) &&
( !remDeviceObj->isNull() ) ) {
eventObj->UserDefined1 = deviceObj->Location;
eventObj->UserDefined2 = deviceObj->PrimaryOwnerContact;
if ( debug ) {
print( "instanceName = ".eventObj->InstanceName );
print( "location in bldg = ".eventObj->UserDefined1 );
print( "street address = ".eventObj->UserDefined2 );
}
if ( accessObj->CreationClassName == "SNMPAgent" )
{
eventObj->UserDefined3 = accessObj->AgentAddress;
if ( debug ) {
print( "IP Address =".eventObj->UserDefined3 );
}
}
eventObj->changed();
}
}
}
}
********************************************************************************************
Thanks
Surabhi
popeye2
18 Posts
0
August 24th, 2010 18:00
Hello Surabhi,
Do you have separate IP AM and IP PM servers? If so, have you associated the hookscript for notifications coming from both servers?
The reason why I ask is because your script currently seems to be working for availability notificaiton but not for performance notifications.
Kind Regards,
Louie Cavaliere
EMC Global Support
surabhi_suman
14 Posts
0
August 24th, 2010 21:00
Hi Louie,
I have the AM and PM server (AM-PM) on same host. However sometime back I changed the script for location and IP address in user defined fields. But I am getting the location but not IP address.Please see the script below:
****************************************
default NotificationName = "";
default MessageType = "";
START {
{ .. eol }
do {
eventObj = self->object(NotificationName); // Locate the notification object
faultedName = eventObj->OccurredOn->Name; // Locate the failed object
}
UDF1
}
/* In UserDefined field1 we will place the customer
name from the underlying domain manager
The data is obtained from the underlying server's system
obj location attribute*/
UDF1 {
do {
customer = "None";
faultedObj = object(faultedName);
deviceObj = faultedObj->getSystem()?IGNORE;
if (!deviceObj->isNull()) {
customer = deviceObj->Location?IGNORE;
}
eventObj->UserDefined1 = customer;
}
}
/* In UserDefined field2 we will place the customer
name from the underlying domain manager
The data is obtained from the underlying server's system
obj SNMP Agent (IP Address) attribute*/
UDF2 {
do {
customer = "None";
faultedObj = object(faultedName);
deviceObj = faultedObj->getSystem()?IGNORE;
if (!deviceObj->isNull()) {
customer = deviceObj->SNMPAddress?IGNORE;
}
eventObj->UserDefined2 = customer;
}
}
******************************************
Do we need to restart the domain manager every time we modify the script?
Thanks
Surabhi Suman
FredericMeunier_0588be
143 Posts
0
August 25th, 2010 06:00
Hi,
it seems you are not calling UDF2 function in your code.
Regarding the restart of the server, you don't have to. If your script is a DXA, you only have to reconfigure the SAM (change a value of the domain type associated to your domain before) so the DXA script are reread again.
HTH,
--Fred
== APG5 ReportPack4Event for Smarts can report on millions of notifications in seconds ==
Frederic Meunier
Solutions Watch4Net Inc
APG & Smarts InCharge integration
http://www.watch4net.com
surabhi_suman
14 Posts
0
August 25th, 2010 16:00
surabhi_suman
14 Posts
0
August 25th, 2010 17:00
Surabhi Suman
FredericMeunier_0588be
143 Posts
0
August 26th, 2010 07:00
When you do that :
START {
{ .. eol }
do {
eventObj = self->object(NotificationName); // Locate the notification object
faultedName = eventObj->OccurredOn->Name; // Locate the failed object
}
UDF1
}
you should do that :
START {
{ .. eol }
do {
eventObj = self->object(NotificationName); // Locate the notification object
faultedName = eventObj->OccurredOn->Name; // Locate the failed object
}
UDF1
UDF2
}
--Fred
== APG5 ReportPack4Event for Smarts can report on millions of notifications in seconds ==
Frederic Meunier
Solutions Watch4Net Inc
APG & Smarts InCharge integration
http://www.watch4net.com
surabhi_suman
14 Posts
0
September 1st, 2010 00:00
Hi Fred,
Doesnt seem to work.
Thanks
Surabhi Suman
FredericMeunier_0588be
143 Posts
0
September 2nd, 2010 06:00
Hi,
did you reconfigure the SAM in order to apply the new ASL script ? Also, you can test the ASL without the SAM (unsing sm_adapter) by sending the right variables to it.
--Fred
== APG5 ReportPack4Event for Smarts can report on millions of notifications in seconds ==
Frederic Meunier
Solutions Watch4Net Inc
APG & Smarts InCharge integration
http://www.watch4net.com