Trying to Schedule Down time and getting errors

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
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Trying to Schedule Down time and getting errors

Post 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
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Re: Trying to Schedule Down time and getting errors

Post 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]$ 
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Re: Trying to Schedule Down time and getting errors

Post by Alan »

I also have authorized_for_system_commands=nagiosadmin
in the cgi.cfg file.
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Re: Trying to Schedule Down time and getting errors

Post 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?
Alan
Posts: 86
Joined: Wed Aug 21, 2019 4:14 pm

Re: Trying to Schedule Down time and getting errors

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Trying to Schedule Down time and getting errors

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked