z

Commercial Support Clients: Clients with support contracts can get escalated support assistance by visiting Nagios Answer Hub. These forums are for community support services. Although we at Nagios try our best to help out on the forums here, we always give priority support to our support clients.

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.

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

Postby happy » Wed Nov 28, 2012 4:56 pm

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!
happy
 
Posts: 20
Joined: Wed Nov 28, 2012 4:37 pm

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

Postby slansing » Wed Nov 28, 2012 5:03 pm

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:

Code: Select all
getenforce


if it is enabled run:

Code: Select all
setenforce 0


Code: Select all
service nagios restart


Let me know if this helps.
slansing
 
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/

Postby happy » Wed Nov 28, 2012 5:30 pm

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!
happy
 
Posts: 20
Joined: Wed Nov 28, 2012 4:37 pm

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

Postby happy » Wed Nov 28, 2012 5:32 pm

duplicate ....
Last edited by happy on Wed Nov 28, 2012 6:16 pm, edited 1 time in total.
happy
 
Posts: 20
Joined: Wed Nov 28, 2012 4:37 pm

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

Postby slansing » Wed Nov 28, 2012 5:36 pm

Alright! Sounds good :)
slansing
 
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/

Postby AlexeyKozik » Fri Dec 18, 2015 9:43 am

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
AlexeyKozik
 
Posts: 1
Joined: Tue Jun 25, 2013 10:07 am

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

Postby rkennedy » Fri Dec 18, 2015 10:08 am

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


Return to Open Source Nagios Projects

Who is online

Users browsing this forum: Majestic-12 [Bot] and 32 guests