Hi there,
we would like use an external Interface for setting up and deleting downtimes.
With setting up downtimes everything works brilliant, but I'm not able to get the external command DEL_HOST_DOWNTIME working.
Assuming that we have a host dowtime set with scheduleddowntime_id = 221, I'm firing the following command from apache via php:
echo "[%lu] DEL_HOST_DOWNTIME;221\n" $now > $commandfile
I find instantly the following log entry:
EXTERNAL COMMAND: DEL_HOST_DOWNTIME;221
but in fact the downtime is still there...
We are using the Nagios Appliance running under CentOS, Nagios XI Version 5.2.9.
Any ideas?
Best regards,
Michael
External command DEL_HOST_DOWNTIME not working
Re: External command DEL_HOST_DOWNTIME not working
H-m-m, I am not able to recreate the issue. I had a scheduled downtime on localhost with downtime ID = 911.
I was able to cancel it by running my "test.sh" script from the CLI.
I no longer see the downtime in the GUI.
Are you sure you used the correct downtime ID?
Code: Select all
[root@localhost ~]# cat /tmp/test.sh
#!/bin/sh
# This is a sample shell script showing how you can submit the DEL_HOST_DOWNTIME command
# to Nagios. Adjust variables to fit your environment as necessary.
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
/bin/printf "[%lu] DEL_HOST_DOWNTIME;911\n" $now > $commandfileCode: Select all
[root@localhost ~]# /tmp/test.sh
[root@localhost ~]# tail /usr/local/nagios/var/nagios.log | grep -i downtime
[1472220945] HOST DOWNTIME ALERT: localhost;CANCELLED; Scheduled downtime for host has been cancelled.Are you sure you used the correct downtime ID?
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: External command DEL_HOST_DOWNTIME not working
S H A M E on ME!
To get the downtime ID, I read value scheduleddowntime_id from table nagios_scheduleddowntime, what was obviously wrong...
The correct value is in field internal_downtime_id, so now my script works as expected.
Many thanks for your help and input!!!
Best regards,
Michael
To get the downtime ID, I read value scheduleddowntime_id from table nagios_scheduleddowntime, what was obviously wrong...
The correct value is in field internal_downtime_id, so now my script works as expected.
Many thanks for your help and input!!!
Best regards,
Michael
Re: External command DEL_HOST_DOWNTIME not working
I am glad I could help! 
Be sure to check out our Knowledgebase for helpful articles and solutions!