Could not open command file '/usr/local/nagios/var/rw/nagios

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
aanataliya
Posts: 12
Joined: Thu Mar 15, 2018 11:51 am

Could not open command file '/usr/local/nagios/var/rw/nagios

Post by aanataliya »

I am getting below error when I try to send custom notification from nagios dashboard.

I am using Amazon Linux and nagios core 4.2.0.

This is my permissions.

Code: Select all

/usr/local/nagios/var

drwxr--r-- 2 nagios apache    4096 Jul 17 23:59 archives
-rw-r--r-- 1 nagios nagios      34 Jul 18 17:29 nagios.configtest
-rw-r--r-- 1 nagios nagios   80377 Jul 18 17:36 nagios.debug
-rw-r--r-- 1 nagios apache 1000024 Jul 18 17:23 nagios.debug.old
-rw-r--r-- 1 nagios nagios       6 Jul 18 17:29 nagios.lock
-rwxr--r-- 1 nagios nagios   38614 Jul 18 17:29 nagios.log
-rwxr--r-- 1 nagios apache   33131 Jul 18 17:29 objects.cache
-rwxr--r-- 1 nagios apache   33131 Jul 18 17:29 objects.precache
-rw------- 1 nagios nagios   43059 Jul 18 17:29 retention.dat
drwxrws--- 2 nagios apache    4096 Jul 18 17:29 rw
drwxrwxr-x 3 nagios apache    4096 May 30 12:23 spool
-rw-rw-r-- 1 nagios nagios   43361 Jul 18 17:36 status.dat
 

and 

/usr/local/nagios/var/rw

prw-rw---- 1 nagios apache 0 Jul 18 17:29 nagios.cmd
srw-rw---- 1 nagios apache 0 Jul 18 17:29 nagios.qh

I tried to chown for entire directory with nagios:nagcmd, apache:apache and restarted apache but still getting error.

below is groups resutl

Code: Select all


[root@mjc2zwyyzwvjymm rw]# groups nagios
nagios : nagios nagcmd
[root@mjc2zwyyzwvjymm rw]# groups apache
apache : apache nagios nagcmd
[root@mjc2zwyyzwvjymm rw]#

How to troubleshoot issue? What nagios internally does when user clicks send custom notification from dashboard?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Could not open command file '/usr/local/nagios/var/rw/na

Post by lmiltchev »

Try changing the ownership of all items in the "/usr/local/nagios/var" directory with the exception of "rw" to nagios.nagios.

Code: Select all

cd /usr/local/nagios/var
chown nagios.nagios *
The ownership of the "rw" directory, and the nagios.cmd and nagios.qh files in it should be nagios.nagcmd. Try changing it by running:

Code: Select all

chown -R nagios.nagcmd /usr/local/nagios/var/rw
Let us know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked