Page 1 of 1

Cannot change state on service attributes

Posted: Fri May 15, 2015 3:25 am
by aap
Hello,

We are running NagiosXI 2014R2.6 and in the last few days are now experiencing a problem with changing anything on the service attributes.

There are some services that are currently passive checks that we need to set to active however when this is attempted, you get the error Please Wait - An error occurred processing your request.

Also, when doing an immediate check on services for a server the following error:

Error: Could not open command file '/usr/local/nagios/var/rw/nagios.cmd' for update!
The permissions on the external command file and/or directory may be incorrect. Read the FAQs on how to setup proper permissions.
An error occurred while attempting to commit your command for processing.
Return from whence you came


The services can however be set to Active using the CCM without any problems.

Any help is appreciated.

Re: Cannot change state on service attributes

Posted: Fri May 15, 2015 7:42 am
by lmiltchev
Run the following commands and show us the output:

Code: Select all

ll -d /usr/local/nagios/var/rw
ll /usr/local/nagios/var/rw
grep check_external /usr/local/nagios/etc/nagios.cfg
grep nag /etc/group

Re: Cannot change state on service attributes

Posted: Fri May 15, 2015 7:49 am
by aap
Thanks. Please see output below for each of the commands

drwxrwsr-x. 2 nagios nagcmd 4096 May 15 10:16 /usr/local/nagios/var/rw

total 32
-rw-r--r-- 1 root nagcmd 136 May 15 13:45 nagios.cmd
srw-rw---- 1 nagios nagcmd 0 May 15 10:16 nagios.qh
-rw-rw-r-- 1 nagios nagcmd 25969 May 5 19:40 nsca.dump

check_external_commands=1

nagios:x:500:nagios,apache,snmptt
nagcmd:x:501:nagios,apache,snmptt


Thanks again.

Re: Cannot change state on service attributes

Posted: Fri May 15, 2015 9:28 am
by lmiltchev
-rw-r--r-- 1 root nagcmd 136 May 15 13:45 nagios.cmd
These permissions are not correct. You need to have a "p" in there (pipeline file), i.e.

Code: Select all

prw-rw---- 1 nagios nagcmd      0 May 15 07:48 nagios.cmd
This file should get recreated on nagios restart. Try stopping/starting nagios and see if the file will be recreated with correct permissions.

Re: Cannot change state on service attributes

Posted: Fri May 15, 2015 9:40 am
by aap
Hi,

Thanks. I have just done a full restart of the system and the output is still the same.

total 32
-rw-r--r-- 1 root nagcmd 136 May 15 15:39 nagios.cmd
srw-rw---- 1 nagios nagcmd 0 May 15 15:39 nagios.qh
-rw-rw-r-- 1 nagios nagcmd 25969 May 5 19:40 nsca.dump

Re: Cannot change state on service attributes

Posted: Fri May 15, 2015 11:07 am
by abrist
Do you use traps in your environment? If so, an incoming trap may be forcing the pipe to be created before nagios can recreate on restart. This was fixed as of recently, so there is a patch if this is truly the case.

To test, stop the trap services, restart nagios, and then check the pipe permissions (post the output of the following):

Code: Select all

service snmptt stop
service snmptrapd stop
ls -la /usr/local/nagios/var/rw/nagios.cmd
service nagios restart 
ls -la /usr/local/nagios/var/rw/nagios.cmd
service snmptt start
service snmptrapd start

Re: Cannot change state on service attributes

Posted: Fri May 15, 2015 1:18 pm
by aap
Thanks very much.

Yes indeed you are correct. We do use snmp traps in our environment . The test works. Stopping snmptrapd and snmptt and restarting nagios resolved the issue.

At the moment, i have left both services off for now. Ho do we implement the fix to resolve the issue?

Thanks again.

Re: Cannot change state on service attributes

Posted: Fri May 15, 2015 2:48 pm
by lmiltchev
I believe this is the file you need:
snmptraphandling.zip
Download it, unzip it and overwrite the original file in "/usr/local/bin/snmptraphandling.py". I would recommend backing up the original file first. :)

Let us know if this fixed your issue.

Re: Cannot change state on service attributes

Posted: Fri May 15, 2015 3:41 pm
by aap
Thanks

File backed up and replaced.

Nagios restarted and all issue resolved. Thanks for your help.

You can close this one.

Re: Cannot change state on service attributes

Posted: Mon May 18, 2015 9:02 am
by lmiltchev
I am glad to hear that! :)

I am locking the topic.