[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] RE: Troubleshooting Alerts -- Having Problems
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] RE: Troubleshooting Alerts -- Having Problems
- From: Stef Coene <stef.coene (at) docum.org>
- Date: Tue, 14 Apr 2009 22:18:00 +0200
- References: <09f601c9bd37$3700a590$ef6828a8 (at) hhsea.txnet.state.tx.us>
- User-agent: KMail/1.9.10
On Tuesday 14 April 2009, James Wade wrote:
> The problem with no SMS notification was a slow email
> server. So, SMS works fine. However, the message is way to short.
>
> For example, if it is alerting on a disk threshold, then
> all I get on the SMS is the server name, and the test name
> that is failing. I don't actually get the partition (filesystem)
> that exceeded the threshold.
>
> If I use PLAIN or just leave it at default, I get to much
> information and it overruns the poor little cell phone.
>
> Does anyone have any suggestions?
I use FORMAT=TEXT and some perl magic to filter out the relevant lines from
the full size message for disk, memory and procs.
if ( $type eq "disk" ) {
foreach my $line (@message) {
if ( $line =~ /&yellow (.*) \((.*)% used\) has reached the WARNING level
\(.*%\)/ ) {
$return .= "warn $1 $2% "
} elsif ( $line =~ /&red (.*) \((.*)% used\) has reached the PANIC level
\(.*%\)/ ) {
$return .= "error $1 $2% "
}
}
} elsif ( $type eq "memory" ) {
foreach my $line (@message) {
if ( $line =~ /&yellow +([a-z]+).+ (\d+)%/i ) {
$return .= "warn $1 $2% "
} elsif ( $line =~ /&red +([a-z]+).+ (\d+)%/i ) {
$return .= "error $1 $2% "
} else {
}
}
} elsif ( $type eq "procs" ) {
foreach my $line (@message) {
if ( $line =~ /&yellow (.+)$/ ) {
$return .= "warn $1 "
} elsif ( $line =~ /&red (.+)$/ ) {
$return .= "error $1 "
} else {
}
}
}
Stef