Page 1 of 1

Trying to Schedule Down time and getting errors

Posted: Fri Mar 06, 2020 4:50 pm
by Alan
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.

Return from whence you came

This was working. I added my user to the Nagios group I am not sure if this broke this or not.

Code: Select all

[alan@Svr-Monitor ~]$ grep nag /etc/group
nagios:x:1001:apache,nagios
nagcmd:x:1002:apache,nagios
[alan@Svr-Monitor ~]$ 

Code: Select all

[alan@Svr-Monitor ~]$ cd /usr/local/nagios/var/rw/
[alan@Svr-Monitor rw]$ ll
total 0
prw-rw----. 1 nagios nagcmd 0 Mar  6 13:39 nagios.cmd
srw-rw----. 1 nagios nagcmd 0 Mar  6 13:39 nagios.qh
[alan@Svr-Monitor rw]$ 
I also ran all of these commands from another form I found:

Code: Select all

usermod -G nagcmd nagios
usermod -G nagcmd apache
chown nagios:nagcmd /usr/local/nagios/var/rw
chown nagios:nagcmd /usr/local/nagios/var/rw/nagios.cmd
It was on this nagios topic - https://support.nagios.com/forum/viewto ... =7&t=27662

Re: Trying to Schedule Down time and getting errors

Posted: Fri Mar 06, 2020 5:05 pm
by Alan
One thing I see that changed was the getenforce changed to Enforcing I think it used to be Permissive.

Code: Select all

[alan@Svr-Monitor objects]$ getenforce
Enforcing
[alan@Svr-Monitor objects]$ grep nag /etc/group
nagios:x:1001:apache,nagios
nagcmd:x:1002:apache,nagios
[alan@Svr-Monitor objects]$ ls -al /usr/local/nagios/var/rw
total 0
drwxrwsr-x. 2 nagios nagcmd  41 Mar  6 13:39 .
drwxrwxr-x. 5 nagios nagios 191 Mar  6 14:00 ..
prw-rw----. 1 nagios nagcmd   0 Mar  6 13:39 nagios.cmd
srw-rw----. 1 nagios nagcmd   0 Mar  6 13:39 nagios.qh
[alan@Svr-Monitor objects]$ 

Re: Trying to Schedule Down time and getting errors

Posted: Fri Mar 06, 2020 5:19 pm
by Alan
I also have authorized_for_system_commands=nagiosadmin
in the cgi.cfg file.

Re: Trying to Schedule Down time and getting errors

Posted: Fri Mar 06, 2020 5:43 pm
by Alan
I ended up fixing this by changing getenforce back to Permissive. But by doing this it kicked me out of the nagios group. I am guessing if I add my self back to the nagios group it will put it back into Enforcing. Is there anyway to add my user account to the nagios group and keep getenforce Permissive mode?

Re: Trying to Schedule Down time and getting errors

Posted: Fri Mar 06, 2020 6:07 pm
by Alan
I got this all working now. I was able to re-add myself to the nagios group and permissive mode is still there and I can put things in downtime.

Re: Trying to Schedule Down time and getting errors

Posted: Mon Mar 09, 2020 10:17 am
by scottwilkerson
Alan wrote:I got this all working now. I was able to re-add myself to the nagios group and permissive mode is still there and I can put things in downtime.
Great!

Glad to hear you got it working!

Locking thread