Page 1 of 1

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

Posted: Wed Jan 03, 2018 2:17 am
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

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

Posted: Wed Jan 03, 2018 2:58 pm
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