Solved

Nagios External commands problem: Could not stat command file

Posted on 2010-11-25
4
1,435 Views
Last Modified: 2012-05-10
Hi,
I have just installed nagios3 on ubuntu. I  have setup my  windows machine with nsclient++. I can see my machine's up on nagios (ping) but when i try to  schedule a check, i get the followinfg error:

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

I have  this file does not exist!

Any help is apreciated!
Cheers
0
Comment
Question by:maxalarie
  • 2
4 Comments
 
LVL 18

Expert Comment

by:Sanga Collins
ID: 34214153
did you complete this step of the setup? it is supposed to configure nagios to allow running of external commands on other systems.

make install-commandmode
0
 
LVL 2

Author Comment

by:maxalarie
ID: 34214156
I  have used  ubuntu, i got nagios3 by goin: apt-get isntall nagios3 nagios3-plugins
i have also enabled the external_command in nagios.cfg file.
0
 
LVL 2

Accepted Solution

by:
koffu earned 500 total points
ID: 34238227
# grep -R 'nagios.cmd' /etc/nagios*
/etc/nagios3/nagios.cfg:command_file=/var/lib/nagios3/rw/nagios.cmd
# ls -l /var/lib/nagios3/
total 1220
-rw-r--r-- 1 nagios nagios     15733 2009-03-11 12:31 nagios.debug
-rw-r--r-- 1 root   root         366 2010-08-19 12:37 nagios.log
-rw------- 1 nagios www-data 1213812 2010-11-30 14:36 retention.dat
drwx--s--- 2 nagios www-data    4096 2010-09-24 11:47 rw
drwxr-x--- 3 nagios nagios      4096 2009-03-10 12:05 spool

# ls -l /var/lib/nagios3/rw/
total 0
prw-rw---- 1 nagios www-data 0 2010-11-30 14:25 nagios.cmd

Open in new window


be sure directory /var/lib/nagios3/rw exist and have valid permissions. If pipe does not exist, simple create it: mkpipe /var/lib/nagios3/rw/nagios.cmd ; chown nagios:www-data /var/lib/nagios3/rw/nagios.cmd ; chmod 660 /var/lib/nagios3/rw/nagios.cmd
0
 
LVL 2

Author Closing Comment

by:maxalarie
ID: 34269086
Thanks.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question