Error: Could not stat() command file '/usr/local/nagios/var/
Error: Could not stat() command file '/usr/local/nagios/var/
I had my server up and running but had an issue with a VM host which caused some crashes. Now am having an issue with email notifications, and commands.
I am getting this whenever trying to execute something:
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.
I have seen this could be due to permissions, among other things. Below is some info from my setup. Any help would be greatly appreciated.
[root@uhc-ng01 ~]# service nagios status
nagios (pid 1049) is running...
[root@uhc-ng01 ~]# ls -l /usr/local/nagios/var/rw
total 0
prw-rw----. 1 nagios nagcmd 0 Nov 25 10:51 nagios.cmd
srw-rw----. 1 nagios nagcmd 0 Nov 25 10:51 nagios.qh
[root@uhc-ng01 ~]# grep nag /etc/group
nagios1000:nagios
nagcmd1001:apache
I am getting this whenever trying to execute something:
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.
I have seen this could be due to permissions, among other things. Below is some info from my setup. Any help would be greatly appreciated.
[root@uhc-ng01 ~]# service nagios status
nagios (pid 1049) is running...
[root@uhc-ng01 ~]# ls -l /usr/local/nagios/var/rw
total 0
prw-rw----. 1 nagios nagcmd 0 Nov 25 10:51 nagios.cmd
srw-rw----. 1 nagios nagcmd 0 Nov 25 10:51 nagios.qh
[root@uhc-ng01 ~]# grep nag /etc/group
nagios1000:nagios
nagcmd1001:apache
Re: Error: Could not stat() command file '/usr/local/nagios/
The nagios user should be a member of the nagcmd group:
Code: Select all
usermod -a -G nagcmd nagios
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.
"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.
-
- Posts: 2
- Joined: Tue Apr 21, 2015 3:16 pm
Re: Error: Could not stat() command file '/usr/local/nagios/
I've the same problem than you... and when i insert this command "#usermod -a -G nagcmd nagios" (obviously after "#service nagios restart"), no changes take place. i was searching a lot of forums, and nobody can help me.
I'm trying to update mi httpd since the web page of nagios, because i need that when this service is turn off, send me a notification.
Please help me!!!
I'm trying to update mi httpd since the web page of nagios, because i need that when this service is turn off, send me a notification.
Please help me!!!
Re: Error: Could not stat() command file '/usr/local/nagios/
Let's take a look at your users/groups:
Does nagios.cmd exist, and is it a named pipe?
Feel free to PM me if any of the above is sensitive. Thanks!
Code: Select all
cat /etc/passwd
cat /etc/group
Code: Select all
ls -l /usr/local/nagios/var/rw/nagios.cmd
file /usr/local/nagios/var/rw/nagios.cmd
-
- Posts: 2
- Joined: Tue Apr 21, 2015 3:16 pm
Re: Error: Could not stat() command file '/usr/local/nagios/
Ok, this was the outputjolson wrote:Let's take a look at your users/groups:Does nagios.cmd exist, and is it a named pipe?Code: Select all
cat /etc/passwd cat /etc/group
Code: Select all
ls -l /usr/local/nagios/var/rw/nagios.cmd file /usr/local/nagios/var/rw/nagios.cmd
Code: Select all
cat /etc/passwd
Code: Select all
cat /etc/group
nagcmd534:nagios,apache
And the others...
Code: Select all
ls -l /usr/local/nagios/var/rw/nagios.cmd
Code: Select all
file /usr/local/nagios/var/rw/nagios.cmd
Thanks for help!
Re: Error: Could not stat() command file '/usr/local/nagios/
cat /etc/group
nagios533:
It looks like the nagios user is not in the nagios group. Please add it with the following command:
Code: Select all
usermod -G nagios -a nagios
Code: Select all
service nagios restart
Code: Select all
service httpd restart
Please ignore this post - I forgot for a moment that users are tied to their own groups via UID/GUID.
Re: Error: Could not stat() command file '/usr/local/nagios/
Do you have selinux enabled by chance?
Code: Select all
sestatus