In Nagios 3.2.3, I'd like to see all the hosts/services that send notifications to a specific contact. Is that possible?
Asked
Active
Viewed 60 times
1 Answers
2
Ok, I can answer my own question after a bit more googling. In the Nagios Support forums, I found this answer:
https://support.nagios.com/forum/viewtopic.php?f=7&t=10329
It is pretty much exactly what I was looking for. I hope this can help someone else someday.
EDIT: Thanks for the tip Zoredache. The link says you can 'cat' and 'grep' Nagios's objects.cache file to get the items you need from the running config. From the link I used:
cat /usr/local/nagios/var/objects.cache | grep 'host_name\|service_description\|contacts\|notification_period' |grep -v command_name | sed 's/host_name/\n/g' > /tmp/contacts.txt
to get a list that I then ran through to pull the config items I wanted for the report. It exports like:
Server1
service_description Linux Raid Status checks /proc/mdstat
contacts sysadmin
notification_period 24x7
Server1
service_description Web Server Port 80 check
contacts sysadmin,developers
notification_period 24x7
I hope this helps someone else, and thanks for the tip again Zoredache.
rjholtz
- 41
- 5
-
Answers on serverfault really should be more then just a link to a forum that may die. You should at least minimally summarize what you found on the link, that way in the future people can possibly find a relocated page through a search. – Zoredache Aug 25 '15 at 17:40
-
@Zoredache the answer has been edited and extended, you can upvote now :) – sebix Aug 28 '15 at 18:32