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.
Nagios NCPA Client Disable Alerts
Re: Nagios NCPA Client Disable Alerts
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.
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.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.
Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Nagios NCPA Client Disable Alerts
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.
Scheduling Downtime VIA the API
Hope that helps and let us know if you have more questions.
Benjamin
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"
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"
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Nagios NCPA Client Disable Alerts
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!
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!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!