Getting error when using external command [Solved]

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
msachikanta
Posts: 58
Joined: Tue Jan 03, 2012 2:35 am

Getting error when using external command [Solved]

Post by msachikanta »

Hi,

I am getting the below error while trying to update External commands like "Send Custom Service Notification" from Nagios Web Interface. Can Someone please help me to resolve this issue..? Thanks in advance.

----------------------------------------------------------------------------------------------------------------------------------------------------------------
Error: Could not open command file '/apps/tools/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
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

I have given the drwxrwsrwx permission for 'rw' directory. refer the below details for rw directory permission.
drwxrwsrwx 2 nagios nagcmd 4096 May 25 10:16 rw

Regards,
Sachikanta
Last edited by msachikanta on Wed Jun 20, 2012 7:45 am, edited 1 time in total.
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Getting error while trying to update external command

Post by agriffin »

Do all the directories leading up to 'rw' also have good permissions for nagios?
msachikanta
Posts: 58
Joined: Tue Jan 03, 2012 2:35 am

Re: Getting error while trying to update external command

Post by msachikanta »

yes.. infact Nagios is the owner and having 775 permission to all the leading directories to 'rw'. here is the details for your reference.

drwxrwxr-x 11 nagios nagios 4096 Mar 20 15:32 nagios
drwxrwxr-x 5 nagios nagios 4096 May 28 11:28 var
drwxrwsrwx 2 nagios nagcmd 4096 May 25 10:16 rw

Regards,
Sachikanta
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Getting error while trying to update external command

Post by lmiltchev »

Open "/etc/group" in a text editor:

Code: Select all

vi /etc/group
and make sure you have "apache" (if you are using apache) added to the "nagcmd":

Code: Select all

nagcmd:x:501:nagios,apache
Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
msachikanta
Posts: 58
Joined: Tue Jan 03, 2012 2:35 am

Re: Error while trying to update external command [solved]

Post by msachikanta »

Thanks... it works... :)

additionally i changed the permission for rw directory as below.

chmod -R u=rwx,g=rwxs,o=rwx rw/

then it started working fine.

Regards,
Sachikanta
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Getting error while trying to update external command

Post by agriffin »

Glad your issue was resolved.
Locked