Mute emails during scheduled down time

Started by gdodd, May 31, 2017, 09:45:20 PM

Previous topic - Next topic

gdodd

I'm looking for a good way to mute email notifications and still perform actions on the server.

Here is the situation: I have a large group of Windows servers that perform very similar functions. After a reboot, there are two of the same services on each server that do not start. I have an action in NetXMS that will start the service when it is down and that works. When I do monthly down time on the servers, I put them into maintenance mode, but then of course, the service restart actions do not process. I only put the servers into maintenance mode to mute the notifications, meaning, I don't care if there are alarms generated during the downtime as long as I don't receive email alerts.

1) I could just change the configuration to an invalid STMPServer. But I will lose alerts on servers not in maintenance
2) Create two Event Processing Policies for each service, one that starts the service and another that sends the email. Group the start and email policies together with a stop processing event in the middle of them
3) Get clever with scripting
4) ???

Thank you for any suggestions/assistance.

Tursiops

Haven't tried this (and our server is currently rather unstable, so can't test it), so I could be completely wrong.

Would it be possible to create an object tool that sets a custom attribute on a node, similar to enabling maintenance mode?
The event processing policy for notifications then filters based on that attribute.
You would still need to split the email notification from the rest in your event processing policies.

Kind of a "maintenance light"?

I'd actually love to test this, if I could.  :-\

gdodd

I was up against my upcoming maintenance window and decided to put in something quick and dirty based on your suggestion.

I separated the email and agent action Event Processing Policies
I added an unmanaged node, "Patch".
Set a custom attribute on the "Patch" node, "PatchTime".
If I set "PatchTime" on node "Patch" to something other than 0, that means I am in maintenance mode and do not want to see email alerts
In the email event processing policies I added this to the Filtering Script:

$patch = FindNodeObject($node, "Patch");
$patchtime = GetCustomAttribute($patch, "PatchTime");
if ($patchtime == 0) return true;
else
return false;


I can manually change the value easy enough and this meets my needs on a basic level. However, I am planning on taking this further and walking from the topmost parent down to the node with a similar (or same) custom attribute setup. That way I can be granular with my "maintenance light" mode. Open to any further suggestions for improvements/functionality.