Hi Team,
I have followed below scripts for scheduling downtime for respective hosts.
#!/bin/sh
# This is a sample shell script showing how you can submit the SCHEDULE_HOST_DOWNTIME command
# to Nagios. Adjust variables to fit your environment as necessary.
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
/usr/bin/printf "[%lu] SCHEDULE_HOST_DOWNTIME;nagios-test;1539852657;1539853857;0;0;600;nagios;Test Downtime Comment\n" $now > $commandfile
if [ $? -ne 1 ]; then
echo "Works....";
fi
[root@test ~]#
[root@test ~]# cat /etc/group | grep nag
nagios1000:
nagcmd1001:nagios,apache
[root@test ~]# sestatus
SELinux status: disabled
but getting error as below
October 18, 2018 16:00
External Command[10-18-2018 16:50:17] EXTERNAL COMMAND: SCHEDULE_HOST_DOWNTIME;nagios-test;1539852657;1539853857;0;0;600;nagios;Test Downtime Comment
External Command[10-18-2018 16:45:12] EXTERNAL COMMAND: SCHEDULE_HOST_DOWNTIME;nagios-test;1539852657;1539853857;0;0;600;nagios;Test Downtime Comment
External Command[10-18-2018 16:39:16] EXTERNAL COMMAND: SCHEDULE_HOST_DOWNTIME;nagios-test;1539852657;1539853857;0;0;600;nagios;Test Downtime Comment
Informational Message[10-18-2018 16:36:19] Auto-save of retention data completed successfully.
Informational Message[10-18-2018 16:19:15] External command error: Command failed
Request you to guide me to fix this issue.
I m using Nagios® Core™ 4.1.1 - http://www.nagios.org on centos 7
Regards,
Rituraj
Error while scheduling host downtime
-
- Posts: 24
- Joined: Tue Jul 17, 2018 9:40 am
Re: Error while scheduling host downtime
it works after enable external command .thank you
Re: Error while scheduling host downtime
Thanks for the update and posting the solution!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.