Show Disabled Notifications Hosts and Services

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
brdr
Posts: 312
Joined: Mon Jun 02, 2014 12:49 pm

Show Disabled Notifications Hosts and Services

Post by brdr »

Hello,

This question is related to the following article:

https://support.nagios.com/forum/viewto ... 16&t=44399

When I run the query to see what hosts have notifications disabled I see a handful. When I go in XI UI I manually enable notifications for the host that have notifications disabled. All is good.

However when I run the query:

echo 'select host_name from tbl_host where notifications_enabled=0\G;' | mysql -uroot -pnagiosxi nagiosql

These hosts that were just enabled still show up in the query as still being disabled....

echo 'select host_name from tbl_host where notifications_enabled=0\G;' | mysql -uroot -pnagiosxi nagiosql (I still get same hosts disabled, any idea why?)

Brdr
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Show Disabled Notifications Hosts and Services

Post by scottwilkerson »

This is because what you are querying in the database is the config value. However there is also a runtime value that takes precedence over the config value.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
brdr
Posts: 312
Joined: Mon Jun 02, 2014 12:49 pm

Re: Show Disabled Notifications Hosts and Services

Post by brdr »

Hi Scott, thanks for the reply.

Is there a way to force runtime to be the config value? Or, another option to see present value after I have renabled the hosts and services that were previously disabled?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Show Disabled Notifications Hosts and Services

Post by scottwilkerson »

brdr wrote:Is there a way to force runtime to be the config value?
no
brdr wrote:Or, another option to see present value after I have renabled the hosts and services that were previously disabled?
You can see the runtime values on the Status Detail Page -> Advanced Tab -> "Service Attributes" or "Host Attributes"
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
brdr
Posts: 312
Joined: Mon Jun 02, 2014 12:49 pm

Re: Show Disabled Notifications Hosts and Services

Post by brdr »

okie. Let me ask the question a different way:

We have 2000+ plus hosts, and 20,000+ services across our prod/non-prod XI instances. Within this domain roughly 80 users. These users schedule downtime, and acknowledge alerts. Occasionally, they will disable notifications for hosts/services; sometimes by design, sometimes by accident.

As a Nagios administrator how can I query Nagios system to find out hosts/services that have notifications disabled?

Thx
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Show Disabled Notifications Hosts and Services

Post by tgriep »

The current running status for hosts and services are stored in the nagios database.
The status of the hosts are in the nagios_hoststatus table and services are in the nagios_servicestatus table.
I think the query you have ran before would work but the database and tables would have to be adjusted.

Code: Select all

echo 'select host_object_id from nagios_hoststatus where notifications_enabled=0;' | mysql -uroot -pnagiosxi nagios 
Then the output of that command would have to be linked to the nagios_hosts table in the nagios database.
Be sure to check out our Knowledgebase for helpful articles and solutions!
brdr
Posts: 312
Joined: Mon Jun 02, 2014 12:49 pm

Re: Show Disabled Notifications Hosts and Services

Post by brdr »

That works. As always, thanks tgriep!

Please close.
Locked