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.
I'm receiving the well-known "Error: Could not open command file '/usr/local/nagios/var/rw/nagios.cmd' for update!" error message on Nagios Core 4.0.7 on Ubuntu 14.04 LTS running under Nginx.
I can su to the www-data user and create files in that directory, as well as echo data to the pipe.
Any ideas as to where the problem may be? I'm pretty sure everything is set up correctly and I've performed many Nagios installations previously without encountering this problem.
I've tried it with Apparmor disabled too in case that was a problem, which it isn't.
I just want to start by clarifing, are you seeing:
"Error: Could not open command file '/usr/local/nagios/var/rw/nagios.cmd' for update!"
OR
"Error: Could not open command file '/usr/local/nagios-4.0.7/var/rw/nagios.cmd' for update!"
I only ask because the title seems rather specific and different from what you were showing in the post.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Thanks for the reply. I'm seeing ""Error: Could not open command file '/usr/local/nagios-4.0.7/var/rw/nagios.cmd' for update!"" - but /usr/local/nagios is just a symlink to /usr/local/nagios-4.0.7.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Thanks for getting back to me. I saw '--with-command-user=nagios' as a configure option and used it - although looking at the Quickstart guide it seems this isn't required and is perhaps the cause of my issue. Should I recompile Nagios with these options (including the --with-nagios-group and --with-nagios-user options) removed from the configure?
Does your nagios.cfg have the correct path for the "command_file" directive?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.