Nagios Error Could Not Stat Command File
Contents |
• All times are UTC - 6 hours [ DST ] Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Comment if you encounter this little beauty: Error: Could not stat() command file '/usr/local/nagios/var/rw/nagios.cmd'! try testing your selinux settings start with: setenforce selinux nagios 0 this will disable for now The following two tabs change
Nagios External Command
content below.BioLatest Posts charlie rootVP of keeping it real / HNIC at pissedoffadmins.com I bring the error: could not open command file '/var/lib/nagios3/rw/nagios.cmd' for update! cold coffee. Latest posts by charlie root (see all) Command line bar graph - September 29, 2016 tmux run command on idle - September 28, 2016 https://support.nagios.com/forum/viewtopic.php?f=7&t=27662 Fortiswitch 224d-poe screenshot - September 8, 2016 13 comments so far Add Your Comment Reply hakabesaid:2016.05.1520:30 It worked. Also you might wanna check the .cmd path in cgi.cfg. Reply Bradsaid:2015.11.0616:09 It is a nice check but how do you get it working with selinux? Reply miltonsaid:2015.10.1917:55 thanks , working Reply Nigelsaid:2014.10.2906:12 Fantastic - http://pissedoffadmins.com/nagios/nagios-error-could-not-stat-command-file-usrlocalnagiosvarrwnagios-cmd.html not sure if it was SELINUX=disable did or /etc/sysconfig/selinux and change it to SELINUX=permissive that did the trick. I am sure I needed to restart the Nagios Box - and it worked. Reply gunterzilesaid:2014.10.1605:26 Its work for me also Thank you very much guy BR Reply Amitsaid:2014.10.0806:55 Its work for me also Thank You Reply Sandersaid:2014.06.1906:38 Figured that this would solve it, thanks a lot! None of the other blogs mention selinux, only the permissions. Reply Rumpolesaid:2013.09.1021:23 Awesome, It worked! Reply amerthissaid:2013.07.3118:16 thanks, it works for me. Reply Karthiksaid:2013.04.0114:02 thanks Reply Scottsaid:2012.05.3013:52 Oh AND editing SELINUX=disable did not work for me, I had to go into /etc/sysconfig/selinux and change it to SELINUX=permissive Reply Scottsaid:2012.05.3013:38 Restart nagios after killing selinux Reply Sandeepsaid:2012.04.1901:57 Tried that. It’s working. Reply austinsaid:2011.06.0216:41 Tried that. didn't work. Your Comment Change mind? Click here to cancel. Name* : Email* : URI : Wordpress Hashcash needs javascript to work, but your browser has javascript disabled.
Nagios installations!): Error: Could not stat() command file ‘/var/lib/nagios3/rw/nagios.cmd'! The external command file may be http://www.barryodonovan.com/2013/06/20/enabling-external-commands-in-nagios-ubuntu missing, Nagios may not be running, and/or Nagios may not https://www.krenger.ch/blog/nagios-error-could-not-stat-command-file/ be checking external commands. An error occurred while attempting to commit your command for processing. The correct way to fix this in Ubuntu is: service nagios3 stop dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw dpkg-statoverride --update --add nagios nagios could not 751 /var/lib/nagios3 service nagios3 start 1234 service nagios3 stopdpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rwdpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3service nagios3 start Share this:Click to share on Facebook (Opens in new window)Click to share on Twitter (Opens in new window)Click to email this to a friend (Opens in new could not stat window)Click to share on LinkedIn (Opens in new window)Click to print (Opens in new window)Click to share on Google+ (Opens in new window) Author Barry O'DonovanPosted on June 20, 2013Categories Linux, Recipes, WorkTags linux, nagios Post navigation Previous Previous post: Translating SNMP OIDs Using MIB FilesNext Next post: Atheist Ireland Losing the Plot Thoughts, ramblings and rants of a husband, father, network engineer, sysadmin, coder, company owner, employer, closet geek, sci fi fan, political anorak, impatient grump... I live in Dublin, Ireland with my wife and daughter. Co-founder of Island Bridge Networks - a company specialising in internet infrastructure providing NetDevOps services. Founder of Open Solutions which provides an out-sourced CTO service to start-ups. I also help ensure the internet keeps working in Ireland with INEX. Search Search for: Search Subscribe to My Blog Enter your email address to subscribe to this blog and receive notificat
installed Nagios on a brand new Debian (6.0.3) host, I was greeted with the following error message after logging into the Nagios web interface and clicking a link that uses external commands: Error: Could not stat() command file ‘/var/lib/nagios3/rw/nagios.cmd' What? Well, after making sure my configuration is correct, I figured that this must be some kind of permission problem… So the problem is that Nagios cannot write to the command file (which is a pipe according to the documentation): This is the file that Nagios will check for external commands to process. The command CGI writes commands to this file. The external command file is implemented as a named pipe (FIFO), which is created when Nagios starts and removed when it shuts down. - Nagios documentation A quick search through Google (I don't want to imagine what I would do without google), I came across the blog of Lars Schenk, where I found the clean way to fix this problem: # dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw # dpkg-statoverride --update --add nagios www-data 751 /var/lib/nagios3 After applying this fix, restart the service # /etc/init.d/nagios3 restart and you are good to go! Tags: Debian, Linux, Nagios, Permissions, Troubleshooting Comments Sorry, because of spam and legal reasons, comments are disabled. If you want to get in touch with me, please do so via e -mail: No comments. krenger.ch - rockin' since 2011