Error: Could not stat() command file '/usr/local/nagios/var/

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.
Locked
ywainberg
Posts: 3
Joined: Wed Apr 08, 2015 3:47 am

Error: Could not stat() command file '/usr/local/nagios/var/

Post by ywainberg »

Hi

i have an issue with nagios.cmd missing ,and as a result i keep getting an error "Error: Could not stat() command file '/usr/local/nagios/var/rw/nagios.cmd'!"

if i stop the service , kill all the nagios processes running and start the service again, the nagios.cmd return to "/usr/local/nagios/var/rw", but after a day or two ,the problem returns and the file is missing again

i encounter this issue before and solved it with fixing the permission on the nagios directories , but it didn't work.

any ideas how to solve it?

thanks
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Error: Could not stat() command file '/usr/local/nagios/

Post by cdienger »

The nagios.cmd file should be opened by the child process which could be crashing for some reason and then unable to open a new nagios.cmd(maybe due to the parent still being alive). Try running nagios in the foreground to see if any errors occur around the time you notice the problem:

/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg

You can also check the process ids and verify which one has nagios.cmd open with:

lsof /usr/local/nagios/var/rw/nagios.cmd
ps -Fa | grep nagios.cfg
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked