The inlined patch fixes:
"Use of uninitialized value in pattern match (m//) at
/usr/lib/mon/mon.d/phttp.monitor line 686."

...under certain error conditions. I would rather it tells me which site
is angry. Should apply to any recent snapshot of phttp.monitor.

Index: phttp.monitor
===================================================================
RCS file: /home/erik/.cvs/mon/mon.d/phttp.monitor,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- phttp.monitor       2003/10/14 15:22:25     1.7
+++ phttp.monitor       2003/10/28 16:00:08     1.8
@@ -683,24 +683,29 @@
                my $timeresponse = $client{$id}{'end'} - $client{$id}{'begin'};
                $debugAnalyse and print "$host response in $timeresponse s :\n$rbuf";

-               if ($rbuf =~ m~$regex~) {
+               if ($rbuf) {
+                       if ($rbuf =~ m~$regex~) {

-                       $client{$id}{"success"} .= "+ match the pattern expected\n";
-                       my $end = $client{$id}{'end'};
-                       my $begin = $client{$id}{'begin'};
-                       if (($end - $begin) > $softimeout) {
-                               # game over, baby.
-                               $client{$id}{"problem"} .= "- soft timeout reached\n";
-                               $debugAnalyse and print "soft timeout reached\n";
+                               $client{$id}{"success"} .= "+ match the pattern 
expected\n";
+                               my $end = $client{$id}{'end'};
+                               my $begin = $client{$id}{'begin'};
+                               if (($end - $begin) > $softimeout) {
+                                       # game over, baby.
+                                       $client{$id}{"problem"} .= "- soft timeout 
reached\n";
+                                       $debugAnalyse and print "soft timeout 
reached\n";
+                                       $badrace{$id}++;
+                               }
+                               else{
+                                       $pacerace{$id}++;
+                               };
+                       }else{
+                               $client{$id}{"problem"} .= "- did not match the 
pattern expected\n";
+                               $client{$id}{"problem"} .= "couldn't match the regexp 
\"$regex\"\n";
+                               $client{$id}{"problem"} .= "in the response 
below:\n\n$rbuf\n";
                                $badrace{$id}++;
                        }
-                       else{
-                               $pacerace{$id}++;
-                       };
                }else{
-                       $client{$id}{"problem"} .= "- did not match the pattern 
expected\n";
-                       $client{$id}{"problem"} .= "couldn't match the regexp 
\"$regex\"\n";
-                       $client{$id}{"problem"} .= "in the response below:\n\n$rbuf\n";
+                       $client{$id}{"problem"} .= "- returned an empty response\n";
                        $badrace{$id}++;
                }
        }

-- 
Erik I. Bols�, Triangel Software AS | Skybert AS
Tlf: 712 41 694         Mobil: 915 79 512

_______________________________________________
mon mailing list
[EMAIL PROTECTED]
http://linux.kernel.org/mailman/listinfo/mon

Reply via email to