Page 2 of 3

Re: Scheduled Downtime not working

Posted: Mon Oct 01, 2018 11:28 am
by RyanMule
Hey Scottwilkerson,

I have pulled the logs and reran that command from before while in the broken state. We are still on version 5.4.13. please see below.

Thank you!

[root@nagios02 /]# ps -ef|grep nagios.cfg
nagios 20363 1 2 Sep29 ? 01:08:26 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
root 25810 9129 0 10:29 pts/0 00:00:00 grep nagios.cfg



scottwilkerson wrote:
RyanMule wrote:Yup no problem, I apologize for the confusion. I will update this when I experience the issue again.

Thank you!
Thanks!

Re: Scheduled Downtime not working

Posted: Mon Oct 01, 2018 3:40 pm
by scottwilkerson
Can you share the output of the following?

Code: Select all

cat /etc/hosts

Re: Scheduled Downtime not working

Posted: Tue Oct 02, 2018 7:49 am
by RyanMule
Yup,

[root@nagios02 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 localhost
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 l

scottwilkerson wrote:Can you share the output of the following?

Code: Select all

cat /etc/hosts

Re: Scheduled Downtime not working

Posted: Tue Oct 02, 2018 1:45 pm
by scottwilkerson
I guess I need to have you run a few more commands, I'm not sure yet why/how this could be happening.

Code: Select all

ls -al /usr/local/nagios/var
ls -al /usr/local/nagios/var/rw

Re: Scheduled Downtime not working

Posted: Wed Oct 03, 2018 7:51 am
by RyanMule
Oh boy ok :shock: thank you again for looking!

[root@nagios02 ~]# ls -al /usr/local/nagios/var
total 99832
drwxrwxr-x. 6 nagios nagios 4096 Oct 3 08:49 .
drwxr-xr-x. 11 root root 4096 Jun 14 2017 ..
drwxrwxr-x. 2 nagios nagios 61440 Oct 2 23:59 archives
-rw-r--r-- 1 apache apache 8533 Jun 11 2014 graphapi.log
-rw-r--r-- 1 root root 4432848 Jul 11 2016 nagios2.txt
-rw-r--r-- 1 nagios nagios 36270 Oct 2 11:55 nagios.configtest
-rw-r--r-- 1 nagios nagios 6 Oct 2 11:55 nagios.lock
-rw-rw-r-- 1 nagios nagios 3366943 Oct 3 08:49 nagios.log
-rw------- 1 nagios nagios 0 Oct 26 2015 nagios.tmp71obg7
-rw------- 1 nagios nagios 327680 Jun 8 2015 nagios.tmpB84ME4
-rw------- 1 nagios nagios 21453761 Jul 19 2017 nagios.tmpFS8YcY
-rw------- 1 nagios nagios 8867840 Mar 6 2015 nagios.tmpHuwDIb
-rw------- 1 nagios nagios 876544 Nov 13 2017 nagios.tmpI93gZ2
-rw------- 1 nagios nagios 0 Apr 24 16:44 nagios.tmpMFQ8nS
-rw------- 1 nagios nagios 8740864 Oct 3 08:49 nagios.tmpQMtvmZ
-rw------- 1 nagios nagios 8949760 Jan 7 2018 nagios.tmpxbhOSm
-rw-r--r-- 1 root root 3992620 Jul 11 2016 nagios.txt
-rw-r--r-- 1 nagios nagios 6 Sep 29 09:08 ndo2db.lock
-rw-r--r-- 1 nagios nagios 0 Oct 2 11:55 ndomod.tmp
srwxr-xr-x 1 nagios nagios 0 Sep 29 09:08 ndo.sock
-rw-r--r-- 1 nagios nagios 1609354 Oct 3 08:49 npcd.log
-rw-r--r-- 1 nagios nagios 1719 Oct 3 04:18 npcd.log.old
-rw-r--r--. 1 nagios nagios 4492644 Aug 20 2013 objects.cache
-rw-r--r-- 1 nagios nagios 13367101 Oct 2 11:55 objects.precache
-rw-rw-rw-. 1 nagios nagios 951859 Oct 3 08:49 perfdata.log
-rw------- 1 nagios nagios 20621725 Oct 3 07:55 retention.dat
drwxrwsrwx. 2 nagios nagcmd 4096 Oct 2 11:55 rw
drwxr-xr-x. 5 root root 4096 Jan 24 2014 spool
drwxr-xr-x. 2 nagios nagios 4096 Oct 3 08:49 stats


[root@nagios02 ~]# ls -al /usr/local/nagios/var/rw
total 16
drwxrwsrwx. 2 nagios nagcmd 4096 Oct 2 11:55 .
drwxrwxr-x. 6 nagios nagios 4096 Oct 3 08:51 ..
-rw-rw-r-- 1 root nagcmd 179 Oct 3 08:51 nagios.cmd
srw-rw---- 1 nagios nagcmd 0 Oct 2 11:55 nagios.qh
-rw-rw-r-- 1 nagios nagcmd 3200 May 14 15:13 nsca.dump



scottwilkerson wrote:I guess I need to have you run a few more commands, I'm not sure yet why/how this could be happening.

Code: Select all

ls -al /usr/local/nagios/var
ls -al /usr/local/nagios/var/rw

Re: Scheduled Downtime not working

Posted: Wed Oct 03, 2018 9:44 am
by scottwilkerson
looks like somehow your nagios command is a file and not a pipe like it is supposed to be

Let run the following

Code: Select all

service nagios stop
killall -9 nagios
rm -f /usr/local/nagios/var/rw/nagios.cmd
service nagios start
this should allow the downtime command to be submitted again

Re: Scheduled Downtime not working

Posted: Wed Oct 03, 2018 12:29 pm
by RyanMule
I ran the following and looks like reoccurring downtime is working however when I try to schedule downtime for a specific host or service it never applies in the UI still.
scottwilkerson wrote:looks like somehow your nagios command is a file and not a pipe like it is supposed to be

Let run the following

Code: Select all

service nagios stop
killall -9 nagios
rm -f /usr/local/nagios/var/rw/nagios.cmd
service nagios start
this should allow the downtime command to be submitted again

Re: Scheduled Downtime not working

Posted: Wed Oct 03, 2018 1:02 pm
by scottwilkerson
Can you show the permissions of this again

Code: Select all

ls -al /usr/local/nagios/var/rw/nagios.cmd

Re: Scheduled Downtime not working

Posted: Wed Oct 03, 2018 2:44 pm
by RyanMule
scottwilkerson wrote:Can you show the permissions of this again

Code: Select all

ls -al /usr/local/nagios/var/rw/nagios.cmd
[root@nagios02 ~]# ls -al /usr/local/nagios/var/rw/nagios.cmd
-rw-rw-r-- 1 root nagcmd 178 Oct 3 15:44 /usr/local/nagios/var/rw/nagios.cmd

Re: Scheduled Downtime not working

Posted: Wed Oct 03, 2018 3:43 pm
by ssax
Are you using SNMP Traps by chance? If so, can you please attach this file:

Code: Select all

/usr/local/bin/snmptraphandling.py
You will need to run these commands again:

Code: Select all

service nagios stop
killall -9 nagios
rm -f /usr/local/nagios/var/rw/nagios.cmd
service nagios start
Here is your output (notice the missing p on the begging showing it's a pipe file):

Code: Select all

[root@nagios02 ~]# ls -al /usr/local/nagios/var/rw/nagios.cmd
-rw-rw-r-- 1 root nagcmd 178 Oct 3 15:44 /usr/local/nagios/var/rw/nagios.cmd
Here is a proper output (notice the first p on the permissions indicating it is a pipe file):

Code: Select all

[root@xid mysql]# ls -l /usr/local/nagios/var/rw/nagios.cmd
prw-rw---- 1 nagios nagcmd 0 Oct  3 15:32 /usr/local/nagios/var/rw/nagios.cmd