Page 1 of 1

Disable Notification using Command Line

Posted: Mon Mar 15, 2021 8:28 pm
by elealyngarcia
Hi,

We are creating a restoration test for our Nagios XI server, is it possible to disable the Notification using CLI instead of using the UI?

Re: Disable Notification using Command Line

Posted: Tue Mar 16, 2021 2:52 pm
by dchurch
Do you mean you want to disable all notifications for all hosts/services in XI? Or just for one host?

If the former, you could just shut down the monitoring engine, otherwise Nagios XI has an API that can do it:

Code: Select all

curl -X POST \
    -d "cmd=DISABLE_NOTIFICATIONS" \
    "http://192.168.5.xx/nagiosxi/api/v1/system/corecommand?apikey=API_KEY"
For one host only:

Code: Select all

curl -X POST \
    -d "cmd=DISABLE_HOST_NOTIFICATIONS;<my_host_name>" \
    "http://192.168.5.xx/nagiosxi/api/v1/system/corecommand?apikey=API_KEY"
Your API key can be found in your profile (click your user name top right corner of screen).

There are lots of external commands that you might find interesting.