Could not stat() command file

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
jplamb13
Posts: 6
Joined: Sat Apr 23, 2016 2:20 am

Could not stat() command file

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Could not stat() command file

Post 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
Former Nagios Employee
Locked