Notification disabled report

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
naranant
Posts: 90
Joined: Tue Oct 24, 2017 10:50 am

Notification disabled report

Post by naranant »

We often find people disables notification for hosts/services and forgot to enable them when the finish. Is the a way to run a report to show all the hosts/services with notification disabled?

Can we create a schedule report to provide his information.
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: Notification disabled report

Post by tacolover101 »

built in? i don't think so.

would make an interesting feature request though.

to solve this for the time being you could parse the status.dat or objects.cache for notifications_enabled 0, pick up the host / service that has it assigned, and output to wherever you'd like.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Notification disabled report

Post by tgriep »

Thanks for your help @tacolover101.
@naranant let us know if you have any other questions.
Be sure to check out our Knowledgebase for helpful articles and solutions!
naranant
Posts: 90
Joined: Tue Oct 24, 2017 10:50 am

Re: Notification disabled report

Post by naranant »

Thank you for that. It would be better if this can be add as the feature in the reporting..
dwasswa

Re: Notification disabled report

Post by dwasswa »

Thanks @tacolover101.

@naranant, you can put in a feature request at....https://github.com/NagiosEnterprises/nagioscore/issues.

If you have an account with GitHub, click on New issue.

note: You will need to create an account with GitHub if you don't already have one.

Please let us know if you have any questions.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Notification disabled report

Post by mcapra »

Man I've been grepping a lot lately.
tacolover101 wrote:to solve this for the time being you could parse the status.dat
This command should list the name of every Host and Service object that has the notifications_enabled=0 flag:

Code: Select all

grep 'notifications_enabled=0' -B 41 /usr/local/nagios/var/status.dat | grep 'host_name\|service_description\|servicestatus\|hoststatus\|notifications_enabled'
In action:

Code: Select all

[root@nagios ~]# grep 'notifications_enabled=0' -B 41 /usr/local/nagios/var/status.dat | grep 'host_name\|service_description\|servicestatus\|hoststatus\|notifications_enabled'
hoststatus {
        host_name=esprod00
        notifications_enabled=0
hoststatus {
        host_name=datamart
        notifications_enabled=0
servicestatus {
        host_name=datamart
        service_description=Assessment Table Top 1
        notifications_enabled=0
Be sure the Nagios Core daemon is running when you run that command. You may also need to change the path to status.dat depending on how Nagios Core is configured (mine is the 4.3.2 default).
Former Nagios employee
https://www.mcapra.com/
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Notification disabled report

Post by dwhitfield »

mcapra wrote:depending on how Nagios Core is configured
On that note....what version of Core are you using? Was it compiled from source or installed from distro repos? On what OS/version is nagios running? cat /etc/*-release may be of use. Those questions will help us determine file paths so that we can help you.

Also, is there a reason your co-workers are disabling notifications temporarily? It sounds like they might find the acknowledgement feature handy. It's possible to click the link in the UI, but also:
https://old.nagios.org/developerinfo/ex ... mand_id=40
https://old.nagios.org/developerinfo/ex ... mand_id=39
naranant
Posts: 90
Joined: Tue Oct 24, 2017 10:50 am

Re: Notification disabled report

Post by naranant »

We are using the Nagios XI. Yes I have suggested to either move the node to downtime or acknowledge the alerts. Some case we are still seeing someone disable the alert and forgot to re-enable the same. So I am looking at creating a report which can generate the notifications disabled for host/service.
kyang

Re: Notification disabled report

Post by kyang »

Since you are using Nagios XI. (I can move your thread into Nagios XI, since you posted this into Nagios Core)

Putting them in a scheduled downtime is probably the best as of now. There is no way to create a report on this for which hosts/services have notifications disabled.

+1 for @mcapra grep command. If you add > /tmp/xxx.csv, it will create a csv file with the hosts/services that have notifications disabled. Or add .txt if you don't want it in a csv.

Code: Select all

grep 'notifications_enabled=0' -B 41 /usr/local/nagios/var/status.dat | grep 'host_name\|service_description\|servicestatus\|hoststatus\|notifications_enabled' > /tmp/disablednotifs.csv
naranant
Posts: 90
Joined: Tue Oct 24, 2017 10:50 am

Re: Notification disabled report

Post by naranant »

Sure thank you.. The grep command works. i will see if we can create a script run this report.
Locked