Page 1 of 1

Error: Could not stat() command file '/var/nagios/rw/nagios.

Posted: Sat Mar 16, 2013 11:58 pm
by amc_oldsarge
I'm having a little trouble with Nagios starting up correcly.

Right after a reboot of my server, if I try to execute a manual service check I get:

Error: Could not stat() command file '/var/nagios/rw/nagios.cmd'!

But if I simply restart the nagios service, I can complete the manual service check without issue.

This happens after EVERY reboot. Now I could simply restart nagios after every reboot, but I'd really like to solve this permanently.

When I run: ls -al /var/nagios/rw

I get the following results:

drwxrwsrwx 2 nagios nagiocmd 4096 Mar 16 01:24 .
drwxrwxr-x 5 nagios nagios 4096 Mar 16 01:29 ..

After running: service nagios restart

Then running: ls -al /var/nagios/rw

drwxrwsrwx 2 nagios nagiocmd 4096 Mar 16 01:31 .
drwxrwxr-x 5 nagios nagios 4096 Mar 16 01:32 ..
srw-rw---- 1 nagios nagiocmd 0 Mar 16 01:31 live
prw-rw---- 1 nagios nagiocmd 0 Mar 16 01:32 nagios.cmd

after the nagios service restart nagios.cmd file shows up in the directory.

I following the instructions on this site:

http://nagios.manubulon.com/traduction/ ... dfile.html

I know this error is a common one and typically pertains to permissions, but I have tried reseting and even adding the nagiocmd group, but nothing has helped thus far.

Thanks for the assistance!

Re: Error: Could not stat() command file '/var/nagios/rw/nag

Posted: Mon Mar 18, 2013 12:36 pm
by scottwilkerson
This is because nagios isn't running yet. The following files are created when nagios starts

Code: Select all

srw-rw---- 1 nagios nagiocmd 0 Mar 16 01:31 live
prw-rw---- 1 nagios nagiocmd 0 Mar 16 01:32 nagios.cmd