Error : could not open command file /usr/local/nagios/var/rw

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.
Locked
NNC
Posts: 14
Joined: Thu Oct 25, 2012 8:51 am

Error : could not open command file /usr/local/nagios/var/rw

Post by NNC »

Getting error
Error : could not open command file /usr/local/nagios/var/rw/nagios.cmd

for update.
The permission on extrnal command file and or dir may b incorct.

Error ocourd whle attmptng to commit
NNC
Posts: 14
Joined: Thu Oct 25, 2012 8:51 am

Re: Error : could not open command file /usr/local/nagios/va

Post by NNC »

Can anyone reply this
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Error : could not open command file /usr/local/nagios/va

Post by slansing »

Hello,

Change the ownership for the directory with the following:

Code: Select all

chmod +rwx /usr/local/nagios/var/rw
NNC
Posts: 14
Joined: Thu Oct 25, 2012 8:51 am

Re: Error : could not open command file /usr/local/nagios/va

Post by NNC »

Still same error.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Error : could not open command file /usr/local/nagios/va

Post by slansing »

Can you run the following and report the output back here:

Code: Select all

ls -ld /usr/local/nagios/var/rw/

Additionally can you send a copy of your nagios.cfg file, it is locate at:

Code: Select all

/usr/local/nagios/etc/nagios.cfg
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Error : could not open command file /usr/local/nagios/va

Post by mguthrie »

Nagios recreates that file after each restart, so updating permissions from the system won't fix that. What are the permissions on that file?

Are external commands enabled in the main nagios.cfg file?
check_external_commands=1
g.turri
Posts: 7
Joined: Tue Oct 16, 2012 3:51 am

Re: Error : could not open command file /usr/local/nagios/va

Post by g.turri »

Hi,
Look at the last page of this guide where you can find the correct sequence of command to submit

http://giuseppeturri.it/NAGIOS_INSTALLATION_GUIDE.pdf

Let me know
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Error : could not open command file /usr/local/nagios/va

Post by lmiltchev »

Is apache member of nagcmd group?

Code: Select all

cat /etc/group | grep nag
Be sure to check out our Knowledgebase for helpful articles and solutions!
Bozb
Posts: 1
Joined: Wed Apr 30, 2014 11:46 am

Re: Error : could not open command file /usr/local/nagios/va

Post by Bozb »

I believe that the correct command would be:

Code: Select all

usermod -G nagios apache
and

Code: Select all

usermod -G nadcmd apache
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Error : could not open command file /usr/local/nagios/va

Post by tmcdonald »

Thread is incredibly old so I will be closing this now.
Former Nagios employee
Locked