This post is more than 5 years old
19 Posts
0
998
Acknowledge alarms with an input file
Hello Paul,
A small query if we want to run this acknowledge script for list of device as an input file which all parameter we need to change?
I tried doing below way but not working although it is printing the input device names....
./sm_adapter -s SAM --file=/tmp/devices.txt multipleAck.asl
START {
a:word
} do {
x = getInstances("ICS_Notification");
y = getInstances("ICS_NotificationFactory");
foreach notiffactory (y)
{
notifactObj = object(notiffactory);
foreach sys (x)
{
objRef = object();
objRef = object("ICS_Notification", sys);
if (glob("*PowerSupply*",objRef->InstanceName) && glob("*.a*",objRef->InstanceName)) {
print("Notif-Name ==> " . objRef->Name);
print("Notif-Name ==> " . objRef->EventState);
objRef->acknowledge("admin","Acknowledge Notification");
objRef->changed();
print("Notification Object acknowledged");
}
}
}
}
Thanks
Arbas
PaulORourke
170 Posts
0
December 10th, 2012 05:00
Hi Arbas,
Did the above script work for you? If so, can you please mark this post as Answered?
Thanks in advance.
Kind Regards,
Paul O'Rourke
PaulORourke
170 Posts
1
November 28th, 2012 07:00
Hi Arbas,
The following script should work for you:
START {
a:word eol
} do {
x = getInstances("ICS_Notification");
y = getInstances("ICS_NotificationFactory");
foreach notiffactory (y)
{
notifactObj = object(notiffactory);
foreach sys (x)
{
objRef = object();
objRef = object("ICS_Notification", sys);
if (glob("*PowerSupply*",objRef->InstanceName) && glob("*" . a . "*",objRef->InstanceName)) {
print("Notif-Name ==> " . objRef->Name);
print("Notif-Name ==> " . objRef->EventState);
objRef->acknowledge("admin","Acknowledge Notification");
objRef->changed();
print("Notification Object acknowledged");
}
}
}
}
Please let me know if you have any more questions.
Kind Regards,
Paul O'Rourke