Hello
This is my first attempt to get Nagios working. I have installed it on CentOS 6.3. I followed a couple different tutorials online to attempt to configure it. I am also, fairly new to Linux.
At this point everything else is working except 2 things, one of which is as follow:
- when I login to web interface and try to run any host commands, (ie, Enable checks of all services on this host) and hit Commit, I get an error message:
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.
the permissions on the file in question are as this:
prw-rw----. 1 nagios nagcmd 0 Nov 28 13:34 nagios.cmd
In an attempt to troubleshoot this I have given full permissions 777 to this file but that also does not fix the issue. It also seems interesting that this file is of o bytes, is it supposed to be?
I would appreciate if anyone with experience in setting Nagios up can guide.
THANKS!
Error: Could not stat() command file '/usr/local/nagios/var/
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Error: Could not stat() command file '/usr/local/nagios/
Hi happy,
SElinux can throw some strange errors and not allow you to connect with the cgi's on certain stock Distro setups. What version of Core, and Nagios Plugins are you using? Can you run the following:
if it is enabled run:
Let me know if this helps.
SElinux can throw some strange errors and not allow you to connect with the cgi's on certain stock Distro setups. What version of Core, and Nagios Plugins are you using? Can you run the following:
Code: Select all
getenforce
Code: Select all
setenforce 0
Code: Select all
service nagios restart
Re: Error: Could not stat() command file '/usr/local/nagios/
Hi slansing
That's fixed it!!! I like to thank you for sharing your knowledge and giving you time to my question. I had spent many hours searching for it online ...
Many Thanks!
That's fixed it!!! I like to thank you for sharing your knowledge and giving you time to my question. I had spent many hours searching for it online ...
Many Thanks!
Re: Error: Could not stat() command file '/usr/local/nagios/
duplicate ....
Last edited by happy on Wed Nov 28, 2012 6:16 pm, edited 1 time in total.
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Error: Could not stat() command file '/usr/local/nagios/
Alright! Sounds good 

-
- Posts: 1
- Joined: Tue Jun 25, 2013 10:07 am
Re: Error: Could not stat() command file '/usr/local/nagios/
I know this is an ancient thread, but I just wanted to say thanks. I was having the same issue that I spend almost a full day on, and most of the google searches were leading me to the suggestions that were not helpful in my case.
Thanks slansing!
Alex
Thanks slansing!
Alex
Re: Error: Could not stat() command file '/usr/local/nagios/
Glad to see this old thread helped you out! I'm going to close this thread out now, but let us know if you ever need assistance in the future.
Former Nagios Employee