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 :
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?
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)) {
PaulORourke
170 Posts
902
1
Posted 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");
}
}
}
}