Cannot change state on service attributes

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
aap
Posts: 180
Joined: Wed Oct 12, 2011 4:01 am

Cannot change state on service attributes

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Cannot change state on service attributes

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
aap
Posts: 180
Joined: Wed Oct 12, 2011 4:01 am

Re: Cannot change state on service attributes

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Cannot change state on service attributes

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
aap
Posts: 180
Joined: Wed Oct 12, 2011 4:01 am

Re: Cannot change state on service attributes

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Cannot change state on service attributes

Post 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
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.
aap
Posts: 180
Joined: Wed Oct 12, 2011 4:01 am

Re: Cannot change state on service attributes

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Cannot change state on service attributes

Post 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.
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
aap
Posts: 180
Joined: Wed Oct 12, 2011 4:01 am

Re: Cannot change state on service attributes

Post by aap »

Thanks

File backed up and replaced.

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

You can close this one.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Cannot change state on service attributes

Post by lmiltchev »

I am glad to hear that! :)

I am locking the topic.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked