[hobbit] RE: Troubleshooting Alerts -- Having Problems

Stef Coene stef.coene at docum.org
Tue Apr 14 22:18:00 CEST 2009


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



More information about the Xymon mailing list