Error while scheduling host downtime

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
rituraj966323
Posts: 24
Joined: Tue Jul 17, 2018 9:40 am

Error while scheduling host downtime

Post by rituraj966323 »

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
nagios:x:1000:
nagcmd:x:1001: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
rituraj966323
Posts: 24
Joined: Tue Jul 17, 2018 9:40 am

Re: Error while scheduling host downtime

Post by rituraj966323 »

it works after enable external command .thank you
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Error while scheduling host downtime

Post by cdienger »

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.
Locked