Monday, August 26, 2013

Nagios - Hosts Disappear

Well I had configured my nagios setup and everything seemed to be fine, then i noticed something strange! The hosts keep disappearing time to time. They do come up at an odd time but not always. Well lot of time was spent on configurations analyzing what went wrong and what ! no LUCK!! :(

So to all those who has this problem, here's something that you might want to check for. Such an issue arises due to more number of nagios PIDs, ie the shutdown of previous nagios was not proper and that PID is messing up with the new one. So to troubleshoot stop nagios, check for orphaned PIDs.. kill it and start nagios again. Voila the hosts started appearing with no issues again!! :)

[root@server ~]#    ps -ef | grep -i  nagios
nagios   23581     1  0 Aug22 ?        00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios   24686     1  0 Aug19 ?        00:00:01 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
root     29749 27976  0 07:14 pts/0    00:00:00 grep -i nagios

[root@server ~]#    /etc/init.d/nagios stop

[root@server ~]#     ps -ef | grep -i  nagios
nagios   24686     1  0 Aug19 ?        00:00:01 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
root     29760 27976  0 07:14 pts/0    00:00:00 grep -i nagios

[root@server ~]#     kill -9 24686

[root@server ~]#     ps -ef | grep -i  nagios
root     29762 27976  0 07:14 pts/0    00:00:00 grep -i nagios

[root@server ~]#     /etc/init.d/nagios start
Starting nagios: done.

[root@server ~]#     ps -ef | grep -i  nagios
nagios   29791     1  0 07:14 ?        00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
root     29795 27976  0 07:14 pts/0    00:00:00 grep -i nagios

No comments:

Post a Comment