NXI 5.7.3 disable notifications and active service checks

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

NXI 5.7.3 disable notifications and active service checks

Post by gormank »

Hi,
As part of redoing of a cheap DR solution I restore the primary backup to the failover host. This enables notifications and checks on the 02 host.
I need to globally disable notifications and active service checks via the shell on the failover. I assume these are in one of the xi_* tables but I haven't found it yet.
Can you give me a pointer to where these are set?
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: NXI 5.7.3 disable notifications and active service check

Post 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 -XPOST "http://192.168.5.xx/nagiosxi/api/v1/system/corecommand?apikey=API_KEY" -d "cmd=DISABLE_NOTIFICATIONS"
For one host only:

Code: Select all

curl -XPOST "http://192.168.5.xx/nagiosxi/api/v1/system/corecommand?apikey=API_KEY" -d "cmd=DISABLE_HOST_NOTIFICATIONS;<my_host_name>"
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.
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.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: NXI 5.7.3 disable notifications and active service check

Post by gormank »

ALL notifications and ALL service checks.
The solution provided for setting the program URL was
mysql -h 127.0.0.1 -uroot -pnagiosxi nagiosxi -e "update xi_options set value = 'hostname/nagiosxi/' where name = 'url';"
And I'd prefer a similar direct to the DB solution for this rather than using the API.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: NXI 5.7.3 disable notifications and active service check

Post by dchurch »

If you're set on using the command line, then command should stop all service and host checks and pause all notifications.

Code: Select all

service nagios stop
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.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: NXI 5.7.3 disable notifications and active service check

Post by gormank »

I'm trying to disable the notifications and active checks much the same as I updated the program URL as shown above by updating the correct rows in a table. Please provide the table and row names the values are stored in. If you don't have the information, please go through your process of escalation or research the issue to provide a meaningful answer. Stopping the nagios service will cause an alert on the primary so it isn't a realistic solution.

Thanks
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: NXI 5.7.3 disable notifications and active service check

Post by gormank »

Since it does take a few seconds to actually apply the change maybe it isn't as simple as updating a table. If there isn't another way to do it, feel free to disallow my previous reply and close.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: NXI 5.7.3 disable notifications and active service check

Post by dchurch »

The program responsible for sending the notifications is that running Nagios Core program, sometimes called the Monitoring Engine. The command to disable notifications has to be sent to the running instance of the program. Anything you do to the database won't affect whether Nagios Core disables notifications.

The curl API call I put above really is the simplest way to do this.

It's possible also to disable notifications using the Host Detail page under Advanced. This also sends the appropriate command to Nagios Core.
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.
Locked