Problem scheduling downtime externally
Marc Powell
marc at ena.com
Wed Jun 25 19:57:28 CEST 2008
On Jun 25, 2008, at 12:32 PM, Tony Rice (trice) wrote:
> Perl script looks like this:
>
> open (FILE, ">$cmd_file");
> print "[$epoch_now]
> SCHEDULE_HOST_DOWNTIME;$host;$epoch_start;$epoch_stop;0;0;$duration;
> $use
> rid;$comment\n";
> close (FILE);
>
> Nothing in the log indicating that this command is making it anywhere.
> Nothing in the log relevant either.
I use the following quite successfully if you don't mind making a
system call --
<snippet>
$cmdline="[$datetime] DEL_SVC_COMMENT;$comment\n";
$action = localtime($datetime) ." - $ticket - host: $host - service:
$service - state: $state - ticket: $status - Deleted Comment\n";
# append the command to the end of the command file
system("$echocmd \"$cmdline\" >> $CommandFile");
system("$echocmd \"$action\" >> $LogFile");
</snippet>
--
Marc
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list