Hi all
We are currently running 3.8.366 and was wanting to implement a script that would supress node down and node up emails within a specified down time period, e.g., 5 minutes. I've basically sussed things out but have no idea how to cancel the timer, nodetimer_%i, used to delay the node down email. Any advice would be greatly appreciated.
We are currently running 3.8.366 and was wanting to implement a script that would supress node down and node up emails within a specified down time period, e.g., 5 minutes. I've basically sussed things out but have no idea how to cancel the timer, nodetimer_%i, used to delay the node down email. Any advice would be greatly appreciated.
Code Select
interval = 300;
nodeId = d2x($node->id,8);
a = ("timestamp_0x".nodeId);
if (ReadPersistentStorage(a) != "" ) {
if ((time() - ReadPersistentStorage(a)) > interval) return true;
WritePersistentStorage(a, NULL);
alarm = FindAlarmByKey("NODE_DOWN2_0x".nodeId);
timer = ("nodetimer_0x".nodeId);
$event->setNamedParameter(timer, "");
alarm->resolve();
return false;
}