Random Project

had to modify slightly

At first this wasn’t working on 3.2.1

I could see it trying to process the command when I tail nagios.log but it wasn’t actually setting the downtime. I manually set a downtime through the web interface while watching the nagios.log and saw that the web interface was adding an extra parameter [0] (in between FIXED[1] and DYNDOWNDURATION[7200]) to the command that the perl script wasn’t.

Perl Script:
SCHEDULE_HOST_DOWNTIME;ATLSQL1;1356546900;1356552400;1;7200;Nagios;ScheduledDowntime_TEST_ATLSQL1

SCHEDULE_HOST_DOWNTIME;ATLSQL1;1356546900;1356552400;1;0;7200;Nagios;ScheduledDowntime_TEST_ATLSQL1

So I modified the printf line of the “sched_downtime” perl script to hard code that extra zero:

Before:
printf $CMD “[$EpochTime] SCHEDULE_HOST_DOWNTIME;$Hostname;$DownStartEpoch;$DownEndEpoch;$Fixed;$DynDownDuration;$Username;$Commentsn”;

After:
printf $CMD “[$EpochTime] SCHEDULE_HOST_DOWNTIME;$Hostname;$DownStartEpoch;$DownEndEpoch;$Fixed;0;$DynDownDuration;$Username;$Commentsn”;

Now it works great, thanks!