From: Elan Ruusamäe Date: Tue, 6 Apr 2010 17:53:34 +0000 (+0000) Subject: - try to follow upstream formatting X-Git-Tag: auto/ac/nagios-plugin-check_rbl-1_1_0-5~2 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fnagios-plugin-check_rbl.git;a=commitdiff_plain;h=16357e696a2678a5479e52fbfd8c0c2a158a5347 - try to follow upstream formatting Changed files: mdns.patch -> 1.2 --- diff --git a/mdns.patch b/mdns.patch index 6b6f79c..4c87bae 100644 --- a/mdns.patch +++ b/mdns.patch @@ -1,8 +1,6 @@ ---- check_rbl-1.1.0/check_rbl 2010-04-06 20:26:18.598337785 +0300 +--- check_rbl-1.2.0/check_rbl 2010-04-06 20:40:42.858468257 +0300 +++ check_rbl-1.2.0/check_rbl 2010-04-06 20:40:42.858468257 +0300 -@@ -2,8 +2,9 @@ - # check_rbl is a Nagios plugin to check if an SMTP server is blacklisted - # +@@ -4,6 +4,7 @@ # See the INSTALL file for installation instructions # # Copyright (c) 2007, ETH Zurich. @@ -10,7 +8,7 @@ # # This module is free software; you can redistribute it and/or modify it # under the terms of GNU general public license (gpl) version 3. -@@ -22,14 +23,12 @@ +@@ -22,13 +23,11 @@ use strict; use warnings; @@ -25,7 +23,6 @@ use Readonly; Readonly my $DEFAULT_RETRIES => 4; - Readonly my $DEFAULT_WORKERS => 20; @@ -47,48 +46,15 @@ # use vars qw( @@ -77,14 +74,15 @@ # Usage : verbose("some message string", $optional_verbosity_level); # Purpose : write a message if the verbosity level is high enough # Returns : n/a -@@ -122,37 +88,119 @@ - +@@ -123,36 +89,119 @@ } --############################################################################## + ############################################################################## -# Usage : check_server( $ip, $server ) -# Purpose : checks if $ip is blacklisted by $server --# Returns : n/a ++# Usage : mdns(\@addresses, $callback) ++# Purpose : Perform multiple DNS lookups in parallel + # Returns : n/a -# Arguments : $ip : host IP -# $server : RBL server -# Throws : n/a @@ -95,8 +93,7 @@ - my ($server) = @_; - - my $lookup_ip = $IP; -+=item B - +- - $lookup_ip =~ -s/(\d{1,3}) [.] (\d{1,3}) [.] (\d{1,3}) [.] (\d{1,3})/$4.$3.$2.$1.$server/mxs; - @@ -108,15 +105,16 @@ - return $lookup_ip; - - } -+Resolves all IPs in C<@addresses> in parallel. -+If answer is found C<$callback> is called with arguments as: $name, $host. - +- - verbose "OK: $lookup_ip\n"; -+Perform multiple DNS lookups in parallel. Based on Perl Net-DNS/mresolv. -+Elan Ruusamäe , (c) 1999-2010 - +- - return 0; -+=cut ++# See also : Perl Net::DNS module mresolv in examples ++# ++# Resolves all IPs in C<@addresses> in parallel. ++# If answer is found C<$callback> is called with arguments as: $name, $host. ++# ++# Author: Elan Ruusamäe , (c) 1999-2010 +sub mdns { + my $data = shift; + my $callback = shift; @@ -224,7 +222,7 @@ } ############################################################################## -@@ -232,9 +280,16 @@ +@@ -232,9 +281,16 @@ 'critical has to be greater or equal warning' ); } @@ -243,7 +241,7 @@ } if ( !$IP ) { -@@ -259,28 +314,37 @@ +@@ -259,28 +315,37 @@ verbose 'Checking ' . $OPTIONS->host . " ($IP) on $nservers server(s)\n";