Page 1 of 1

Nagios NCPA Client Disable Alerts

Posted: Tue Oct 27, 2020 5:01 am
by NagiosIMCS
Hi all,

We are looking to move to the Nagios NCPA client.

Using the NPCA client is there an easy way of disabling any alerts if the Windows servers are shutdown gracefully.

For instance a single alarm to notify the sever has been shutdown.

Then when the server restarts in will continue to monitor in the usual manner.

I could do this before with Datadog but have been struggling with Nagios to do this.

If there is a scripted method please include examples of the code.

Thank you for all your help.

Re: Nagios NCPA Client Disable Alerts

Posted: Tue Oct 27, 2020 4:05 pm
by dchurch
If your goal is to limit the number of alerts you receive while the host is down, you could use Service Dependencies to make it so that active checks don't alert when a host isn't responding to pings.

If your goal is to actually detect the graceful shutdown and send a passive check as that's happening so you can key alerts off of that, it will be a little trickier. There's a way to run a program on shutdown of a Windows machine using gpedit.exe, and they make cURL for Windows, so it's possible to send a scripted HTTP request upon shutdown, but it's a lot of fiddling and custom code.

Re: Nagios NCPA Client Disable Alerts

Posted: Tue Oct 27, 2020 4:47 pm
by benjaminsmith
Hi,

I would also like to add that Scheduled Downtime might be a good option here. When a host or service is in scheduled downtime, notifications will be suppressed.

Take a look at the following guide for instructions on setting up downtime.

Configuring Downtime In Nagios XI

If you want to approach this using custom scripting as Dan suggested, take a look at the API. You can send Nagios Core commands over the API to disable notifications for a specific host or globally.

For example, the following command will disable notifications.

Code: Select all

curl -XPOST "http://192.168.23.115/nagiosxi/api/v1/system/corecommand?apikey=JdqXNOLmVmGgt7l5NNVDinUho2OUJuuscmIqDM2Xsu8RjJMK0fJbdcnTC7aYalfU" -d "cmd=DISABLE_NOTIFICATIONS"
Scheduling Downtime VIA the API

Code: Select all

curl -XPOST "http://192.168.23.115/nagiosxi/api/v1/system/scheduleddowntime?apikey=JdqXNOLmVmGgt7l5NNVDinUho2OUJuuscmIqDM2Xsu8RjJMK0fJbdcnTC7aYalfU&pretty=1" -d "comment=Test downtime creation&start=1603834779&end=1603841979&hosts[]=localhost"
Hope that helps and let us know if you have more questions.

Benjamin

Re: Nagios NCPA Client Disable Alerts

Posted: Tue Oct 27, 2020 4:51 pm
by benjaminsmith
Hi,

I see you have an open ticket for this issue in our ticketing system, please follow up with any questions in the ticket instead.

https://support.nagios.com/tickets/scp/ ... p?id=11682

In the future, please open only one forum post or ticket per issue so we can best focus our efforts. Thank you!