automatic cancellation of all alarms after 24 hours

Started by netcaring, February 06, 2024, 06:40:41 PM

Previous topic - Next topic

netcaring

hello,
Is there a way to erase all alarms after a certain number of hours? for example every two days the "alarms" section is completely cleaned

thanks.

Victor Kirhenshtein

You can create scheduled task that will run NXSL script on any top level object ("entire network" or "infrastructure services"). In that script you can do something like this:

for(a : $object->alarms)
{
   a->terminate();
}

Alternatively you can use FindObejct(2) to refer to "infrastructure services" instead of $object - then you can run script in any context.

You can add additional logic to terminate only old alarms, etc.

Best regards,
Victor