Page 1 of 1

Error: Could not stat() command file nagios.cmd

Posted: Sat Jul 09, 2016 5:27 am
by jim
Good Folks,

I have a question on how to resolve the following error:

Code: Select all

Error: Could not stat() command file '/usr/local/nagios/var/rw/nagios.cmd'!

The external command file may be missing, Nagios may not be running, and/or Nagios may not be checking external commands.

An error occurred while attempting to commit your command for processing.
I don't want to disable SELINUX as that is what said in general as I believe it is a security risk to disable it.

Furthermore here is the information which is required to troubleshoot the issue.

Code: Select all

[root@puppet local]# ls -l /usr/local/nagios/var/rw/nagios.cmd 
prw-rw----. 1 nagios nagcmd 0 Jul  9 19:43 /usr/local/nagios/var/rw/nagios.cmd
[root@puppet local]# ls -l /usr/local/nagios/var/rw/
total 0
prw-rw----. 1 nagios nagcmd 0 Jul  9 19:43 nagios.cmd
srw-rw----. 1 nagios nagcmd 0 Jul  9 19:43 nagios.qh
[root@puppet local]# ls -ld /usr/local/nagios/var/rw/
drwxrwsr-x. 2 nagios nagcmd 4096 Jul  9 19:43 /usr/local/nagios/var/rw/
[root@puppet local]# grep nag /etc/group
nagios:x:492:nagios
nagcmd:x:501:apache
[root@puppet local]# 

Code: Select all

[root@puppet etc]# cat cgi.cfg |grep authorized
authorized_for_system_information=nagios
authorized_for_configuration_information=nagios
authorized_for_system_commands=nagios
authorized_for_all_services=nagios
authorized_for_all_hosts=nagios
authorized_for_all_service_commands=nagios
authorized_for_all_host_commands=nagios
#authorized_for_read_only=user1,user2
[root@puppet etc]# 
Let me know if you need any further information.

Regards,
Jim

Re: Error: Could not stat() command file nagios.cmd

Posted: Sun Jul 10, 2016 8:30 am
by jim
Any update ? as I only see disabling SELINUX as the only viable solution. Disabling SELINUX is a security risk.

Re: Error: Could not stat() command file nagios.cmd

Posted: Mon Jul 11, 2016 2:15 am
by Box293

Re: Error: Could not stat() command file nagios.cmd

Posted: Tue Jul 12, 2016 9:45 am
by jim
Nope, Better article I think is this:
http://markelov.org/wiki/index.php/Nagios_and_SELinux

Doesn't work for me. What I do understand from CentOS is they recommend installing it with yum package. However that is old nagios (3.5). Compiling from source gives 4.1.1

I really want this to work but without disabling SELINUX............ I am stuck and thinking that I should disable SELINUX....

Re: Error: Could not stat() command file nagios.cmd

Posted: Tue Jul 12, 2016 11:04 am
by tmcdonald
Try disabling SELinux for just a moment and see if the error goes away. If it does, you can re-enable SELinux and configure it as needed:

https://access.redhat.com/documentation ... ors_Guide/