Page 1 of 1

Could not stat() command file

Posted: Sun Apr 24, 2016 3:53 pm
by jplamb13
Hello All,

i am having trouble when asking nagios to reschedule a check eg ping, when i try i get the error message below.
Error: Could not stat() command file '/usr/local/nagios/var/rw/nagios.cmd'!
The external command file may be missing, Nagios may not be running, and/or Nagios may not be checking external commands.
An error occurred while attempting to commit your command for processing.

Return from whence you came

I have tried all of the commands similar to this and not had any luck. (rebooted both Apache and Nagios afterwards)

Code: Select all

usermod -G nagcmd nagios
usermod -G nagcmd apache
chown nagios:nagcmd /usr/local/nagios/var/rw 
chown nagios:nagcmd /usr/local/nagios/var/rw/nagios.cmd
In case it is helpful (seen in other posts

grep nag /etc/group
nagios:x:1001:
nagcmd:x:1002:apache,nagios
This seems to be a really common issue however i dont seem to be having much luck.

I am running the latest version of nagios (only installed last week, on CentOS 7. any help or pointers will be much appreciated!

cheers

Re: Could not stat() command file

Posted: Mon Apr 25, 2016 10:00 am
by rkennedy
What are the permissions for the file? ls -l /usr/local/nagios/var/rw/

Also, did you turn SELinux off? What is the output of getenforce?

I wrote this guide, for installing Core on CentOS 7, which should work without issues. It might help, depending on how / what guide you followed -
https://assets.nagios.com/downloads/nag ... entos7.pdf