Our routine maintenance requires services have to be brought down.
The problem is these services have Nagios checks and we either have to go to the web interface and disable the check or get the emails.
Is there a way from command line on a Windows and/or Linux guest to disable the Nagios check (or notifications) and enable it? Ideally this would happen on the machine we are performing the maintenance on, not the Nagios server itself.
I would like to disable notifications/checks pre-maintenance and re-enable them post maintenance.
Assuming that the guest can reach the web interface, the following command lines should work:
To disable notifications
To enable notifications
Depending on your setup, you may also need to use the --insecure or --user options of curl.
And IIRC, the cmd_type number is different for service and host groups -- look at what links are being used in your web browser.
Yo can Enable/Disable host notification with nagios.cmd command
e.g:
Disable all notification for my-host
Enable all notification for my-host
You can also check this url Nagios Notification command
For such use, you may edit your nagios services file, and disable checks of all services on this host, like what you did in the web interface, and that require the modification of some options.
Let's take an example If you need to disable checks for DNS service in machine nibiru, disable the active/passive checks like the following.