Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

998

November 27th, 2012 09:00

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

170 Posts

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

170 Posts

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

No Events found!

Top