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.
# /etc/init.d/nagios status
* status: crashed
nagios ~ # /etc/init.d/nagios restart
* Verifying config files ... [ ok ]
* Stopping nagios ...
* Failed to stop nagios [ !! ]
* ERROR: nagios failed to stop
i tried uninstalling nagios and reemerging it but that didn't help, now i have to reboot to change nagios config. Nagios works nevertheless. I'd rather not upgrade from source.
what to do?
Seek and you shall find, knock and it shall be opened, cry and you shall find comfort
We haven't had any reports of this behavior aside from yours, which leads me to believe that if an answer is found it will likely be from the Gentoo forum members as this does not appear to strictly be an issue with the Nagios codebase, but rather the Gentoo package/atom/whatever the term is. We're also more of a CentOS/RHEL and Debian/Ubuntu forum generally, so our Gentoo-specific knowledge is not as great as theirs will be. As such, if the file paths or commands we post are inaccurate for a Gentoo system we apologize in advance.
To add on to what @dwhitfield posted, if you are using PNP as a module does the issue still occur if you disable it? That would help narrow down where the problem stems from.
Can you post or PM your commands.cfg? If you don't literally have something called commands.cfg, just whatever config file where the commands are defined.
~ # tail -f /var/log/messages
Dec 18 11:37:02 nagios /etc/init.d/nagios[12243]: ERROR: nagios failed to stop
Dec 18 11:37:07 nagios sudo[12080]: pam_unix(sudo:session): session closed for user root
Dec 18 11:37:12 nagios check_nrpe[12363]: Remote 10.1.1.13 does not support Version 3 Packets
Dec 18 11:37:12 nagios check_nrpe[12363]: Remote 10.1.1.13 accepted a Version 2 Packet
I would make the paths the same and verify that the nagios user account has the permissions to create the lock file in that folder and see if the init script can restart the nagios daemon now that it can find the lock file.
Be sure to check out our Knowledgebase for helpful articles and solutions!