diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-02 13:16:24 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-02 13:16:24 +0200 |
commit | b15adb7762b6caaecaa83637abfcf5fdb4802092 (patch) | |
tree | 64eddbe2aa1a7f98a140be0f7973f05d7a781ae0 /contrib/sched_downtime.pl | |
parent | c4d5882b9e1d07c7b61091062b7d085fa5f00284 (diff) | |
download | monitoring-plugins-b15adb7762b6caaecaa83637abfcf5fdb4802092.tar.gz |
Remove "contrib" plugins
These days, sites such as "Nagios Exchange" are a much better place for
publishing plugins not maintained by the Plugins Development Team.
Diffstat (limited to 'contrib/sched_downtime.pl')
-rw-r--r-- | contrib/sched_downtime.pl | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/contrib/sched_downtime.pl b/contrib/sched_downtime.pl deleted file mode 100644 index b46b482c..00000000 --- a/contrib/sched_downtime.pl +++ /dev/null @@ -1,47 +0,0 @@ -#! /usr/bin/perl -w -# -# Marko Riedel, EDV Neue Arbeit gGmbH, mriedel@neuearbeit.de -# -# -# -# -use POSIX qw(strtol); - -my $command_file = '/usr/local/nagios/var/rw/nagios.cmd'; - -my $hour = (60*60); -my $next_day = (24*60*60); - -my $downtimes = - [ - { - host => 'somehost', - service => 'SERVICE', - times => [ ["00:00", 9], ["18:00", 6] ] - } - ]; - -foreach my $entry (@$downtimes) { - my ($secstart, $secend, $cmd, $current); - - $current = `/bin/date +"%s"`; - chomp $current; - - foreach my $tperiod (@{ $entry->{times} }){ - $secstart = strtol(`/bin/date -d "$tperiod->[0]" +"%s"`); - $secend = $secstart+$tperiod->[1]*$hour; - - $secstart += $next_day; - $secend += $next_day; - - $cmd = "[$current] SCHEDULE_SVC_DOWNTIME;"; - $cmd .= "$entry->{host};$entry->{service};"; - $cmd .= "$secstart;$secend;"; - $cmd .= "1;0;$0;automatically scheduled;\n"; - - print STDERR $cmd; - - system "echo \"$cmd\" >> $command_file"; - } -} - |