Back | System Monitoring with Perl | Table Of Contents | Next |
#!/usr/bin/perl
use Getopt::Std; getopts ("S:u");
my $alert_type = $opt_u ? "UP:" : "DOWN:";
if ($opt_S) { $summary = $opt_S; } else { $summary = <STDIN>; chomp $summary; }
my $rest=""; while (<STDIN>) { $rest .= $_; }
my $alert_string = $alert_type.$opt_s." ".$summary."\n".$rest;
foreach $number (@ARGV) { system("/usr/local/bin/sendsms",$number,"marthag",$alert_string); }
Back | System Monitoring with Perl | Table Of Contents | Next |