This post is more than 5 years old
19 Posts
0
1566
Acknowledge notifications
Hi ,
Could someone please guide mein as how can I acknowledge multiple notificaion.
or all notification macthing same event or device name.....
Thanks
This post is more than 5 years old
19 Posts
0
1566
Hi ,
Could someone please guide mein as how can I acknowledge multiple notificaion.
or all notification macthing same event or device name.....
Thanks
Top
PaulORourke
170 Posts
1
October 2nd, 2012 05:00
HI Ahmed,
In addition to the above, you can also use the below script to acknowledge notifications. The below sample script will acknowledge all notifications with the word PowerSupply in the InstanceName field. To run this script, simply create an asl file in the SAM bin directory ( /smarts/bin) call it something like : multipleAck.asl. Copy the same script text below. Use the following command to setup permissions :
chmod 777 multipleAck.asl
And use the following command to run the script :
./sm_adapter -s multipleAck.asl
Sample script :
default debug = FALSE;
manager = object("ICF-TopologyManager");
factory = object("ICIM-ObjectFactory");
timestamp = numeric(time());
START {
.. 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)) {
print("Notif-Name ==> " . objRef->Name);
print("Notif-Name ==> " . objRef->EventState);
objRef->acknowledge("admin","Acknowledge Notification");
objRef->changed();
print("Notification Object acknowledged");
}
}
}
}
PaulORourke
170 Posts
0
October 2nd, 2012 03:00
Hi Ahmed,
You can acknowledge multiple notifications on the SAM GUI by simply using the mouse and shift key to select multiple notifications and then right clicking and select Acknowledge.
Is this the information you were looking for, or is there a requirement to do this from a script or dmctl command?
Thanks,
Paul
arbas_ahmed
19 Posts
0
November 27th, 2012 02:00
Hello Paul,
Just a small query if we want to run this acknowledge script for specific devices.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