]> git.pld-linux.org Git - packages/nagios-plugin-check_rbl.git/blob - verbose-reporting.patch
- add mdns support (parallel DNS lookups instead of forking), performs a lot better
[packages/nagios-plugin-check_rbl.git] / verbose-reporting.patch
1 --- check_rbl-1.1.0/check_rbl   2010-02-01 18:28:07.075134119 +0200
2 +++ check_rbl-1.1.0/check_rbl   2010-02-01 18:28:07.075134119 +0200
3 @@ -144,10 +144,13 @@
4  
5      if ( lookup($lookup_ip) ) {
6  
7 +        verbose "LISTED: $lookup_ip\n";
8          return $lookup_ip;
9  
10      }
11  
12 +    verbose "OK: $lookup_ip\n";
13 +
14      return 0;
15  
16  }
17 @@ -238,6 +241,7 @@
18      $PLUGIN->nagios_exit( UNKNOWN, 'Cannot resolve ' . $OPTIONS->host );
19  }
20  
21 +verbose "Using " . $OPTIONS->timeout . " as global script timeout\n";
22  alarm $OPTIONS->timeout;
23  
24  ################
25 @@ -250,13 +254,16 @@
26  
27  ################################################################################
28  
29 -verbose 'Checking ' . $OPTIONS->host . " ($IP)\n";
30 +my @servers = @{$OPTIONS->server};
31 +my $nservers = scalar @servers;
32 +
33 +verbose 'Checking ' . $OPTIONS->host . " ($IP) on $nservers server(s)\n";
34  
35  my $iter = iterate(
36      { workers => $OPTIONS->workers },
37      \&check_server,
38      sub {
39 -        while ( my $server = pop @{ $OPTIONS->server } ) {
40 +        while ( my $server = pop @servers ) {
41              return $server;
42          }
43          return;
44 @@ -272,7 +279,7 @@
45  my $total = scalar @BLACKLISTED;
46  
47  my $status =
48 -  "BLACKLISTED on $total " . ( ( $total == 1 ) ? 'server' : 'servers' );
49 +  $OPTIONS->host. " BLACKLISTED on $total " . ( ( $total == 1 ) ? 'server' : 'servers' ) . " of $nservers";
50  
51  if ( $total > 0 ) {
52      $status .= " (@BLACKLISTED)";
This page took 0.091723 seconds and 3 git commands to generate.