Page 1 of 1

Show Disabled Notifications Hosts and Services

Posted: Fri Sep 08, 2017 2:38 pm
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

Re: Show Disabled Notifications Hosts and Services

Posted: Fri Sep 08, 2017 3:26 pm
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.

Re: Show Disabled Notifications Hosts and Services

Posted: Tue Sep 12, 2017 2:33 pm
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?

Re: Show Disabled Notifications Hosts and Services

Posted: Tue Sep 12, 2017 3:21 pm
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"

Re: Show Disabled Notifications Hosts and Services

Posted: Fri Sep 15, 2017 8:25 am
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

Re: Show Disabled Notifications Hosts and Services

Posted: Fri Sep 15, 2017 1:07 pm
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.

Re: Show Disabled Notifications Hosts and Services

Posted: Fri Sep 15, 2017 2:28 pm
by brdr
That works. As always, thanks tgriep!

Please close.