Page 3 of 3
Re: Scheduled Downtime not working
Posted: Thu Oct 04, 2018 10:44 am
by RyanMule
ssax wrote: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
Hello ssax,
Thank you for your input.
Yes we are using a few SNMP traps. I have attached the requested file.
I reran the following commands and believe I am receiving the proper output now
[root@nagios02 ~]# service nagios stop
Stopping nagios:. done.
[root@nagios02 ~]# killall -9 nagios
nagios: no process killed
[root@nagios02 ~]# rm -f /usr/local/nagios/var/rw/nagios.cmd
[root@nagios02 ~]# service nagios start
Starting nagios: done.
[root@nagios02 ~]# ls -al /usr/local/nagios/var/rw/nagios.cmd
prw-rw---- 1 nagios nagcmd 0 Oct 4 11:36 /usr/local/nagios/var/rw/nagios.cmd
[root@nagios02 ~]# ^C
[root@nagios02 ~]#
Schedule downtime through the UI is working now!!!
I don't know how the pipe tag would have been dropped but that appears to be the issue.
Re: Scheduled Downtime not working
Posted: Thu Oct 04, 2018 4:34 pm
by ssax
Yep, that's the issue. So if you run this command on your system you will see that it doesn't return anything:
Code: Select all
grep ISFIFO /usr/local/bin/snmptraphandling.py
Please run these commands to fix the issue:
Code: Select all
cd /tmp
wget https://assets.nagios.com/downloads/nagiosxi/scripts/NagiosXI-SNMPTrap-setup.sh
sh ./NagiosXI-SNMPTrap-setup.sh
Now if you run this command you will see that it does return the line (which happens to make sure the file is a FIFO before writing):
Code: Select all
[root@xid tmp]# grep ISFIFO /usr/local/bin/snmptraphandling.py
if os.path.exists('/usr/local/nagios/var/rw/nagios.cmd') and stat.S_ISFIFO(os.stat('/usr/local/nagios/var/rw/nagios.cmd').st_mode):
Re: Scheduled Downtime not working
Posted: Fri Oct 05, 2018 9:58 am
by RyanMule
I apologize but I am confused. This is related to the downtime issue?
Here is the output of the commands below
Thank you!
========================================
SNMP Trap Support Installation Complete!
========================================
[root@nagios02 tmp]# grep ISFIFO /usr/local/bin/snmptraphandling.py
if os.path.exists('/usr/local/nagios/var/rw/nagios.cmd') and stat.S_ISFIFO(os.stat('/usr/local/nagios/var/rw/nagios.cmd').st_mode):
ssax wrote:Yep, that's the issue. So if you run this command on your system you will see that it doesn't return anything:
Code: Select all
grep ISFIFO /usr/local/bin/snmptraphandling.py
Please run these commands to fix the issue:
Code: Select all
cd /tmp
wget https://assets.nagios.com/downloads/nagiosxi/scripts/NagiosXI-SNMPTrap-setup.sh
sh ./NagiosXI-SNMPTrap-setup.sh
Now if you run this command you will see that it does return the line (which happens to make sure the file is a FIFO before writing):
Code: Select all
[root@xid tmp]# grep ISFIFO /usr/local/bin/snmptraphandling.py
if os.path.exists('/usr/local/nagios/var/rw/nagios.cmd') and stat.S_ISFIFO(os.stat('/usr/local/nagios/var/rw/nagios.cmd').st_mode):
Re: Scheduled Downtime not working
Posted: Fri Oct 05, 2018 10:21 am
by scottwilkerson
RyanMule wrote:I apologize but I am confused. This is related to the downtime issue?
Here is the output of the commands below
I know it sounds weird, but it is related, and here's why.
There was a bug in old versions of the snmptraphandling.py file which didn't check to make sure the file was a pipe before writing to it.
When this happened, if nagios was in the process of restarting it would actually create a nagios.cmd file and after nagios starts it could not create the nagios.cmd command pipe, which is required to submit commands such as downtime from the UI.
Re: Scheduled Downtime not working
Posted: Fri Oct 05, 2018 2:44 pm
by RyanMule
Hey Scottwilkerson,
thank you for the explanation and help! You can lock this thread again if you wish. We are working!
Also thank you Ssax for the additional input!
scottwilkerson wrote:RyanMule wrote:I apologize but I am confused. This is related to the downtime issue?
Here is the output of the commands below
I know it sounds weird, bu it is related, and here's why.
There was a bug in old versions of the snmptraphandling.py file which didn't check to make sure the file was a pipe before writing to it.
When this happened, if nagios was in the process of restarting it would actually create a nagios.cmd file and after nagios starts it could not create the nagios.cmd command pipe, which is required to submit commands such as downtime from the UI.
Re: Scheduled Downtime not working
Posted: Fri Oct 05, 2018 2:45 pm
by scottwilkerson
RyanMule wrote:Hey Scottwilkerson,
thank you for the explanation and help! You can lock this thread again if you wish. We are working!
Also thank you Ssax for the additional input!
scottwilkerson wrote:RyanMule wrote:I apologize but I am confused. This is related to the downtime issue?
Here is the output of the commands below
I know it sounds weird, bu it is related, and here's why.
There was a bug in old versions of the snmptraphandling.py file which didn't check to make sure the file was a pipe before writing to it.
When this happened, if nagios was in the process of restarting it would actually create a nagios.cmd file and after nagios starts it could not create the nagios.cmd command pipe, which is required to submit commands such as downtime from the UI.
Great!
Locking