diff options
author | Stanley Hopcroft <stanleyhopcroft@users.sourceforge.net> | 2004-11-29 05:07:34 +0000 |
---|---|---|
committer | Stanley Hopcroft <stanleyhopcroft@users.sourceforge.net> | 2004-11-29 05:07:34 +0000 |
commit | 8017a63d26f07d47ea8356588d7b38af952a5da5 (patch) | |
tree | df73782792e2a425971dda90c08957b943f9f099 /contrib/rblcheck-web | |
parent | b51ab9df98438e68c83ce20f896c9a7cb8bc1dcc (diff) | |
download | monitoring-plugins-8017a63d26f07d47ea8356588d7b38af952a5da5.tar.gz |
*** empty log message ***
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@949 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'contrib/rblcheck-web')
-rwxr-xr-x | contrib/rblcheck-web | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/contrib/rblcheck-web b/contrib/rblcheck-web new file mode 100755 index 00000000..eb4fcdec --- /dev/null +++ b/contrib/rblcheck-web | |||
@@ -0,0 +1,37 @@ | |||
1 | #!/usr/bin/perl | ||
2 | # Multi-RBL Query tool, developer Vikram <vr@udel.edu> | ||
3 | use IO::Socket::INET; | ||
4 | |||
5 | die "Syntax: $0 -H <ip address>\n" unless $ARGV[1]; | ||
6 | |||
7 | $soc = new IO::Socket::INET->new(PeerPort=>80, | ||
8 | Proto=>'tcp', | ||
9 | PeerAddr=>"rbls.org") or die("Cannot connect to CERT"); | ||
10 | |||
11 | $ip = $ARGV[1]; | ||
12 | $uri = '/?q='.$ip; | ||
13 | |||
14 | $soc->send("GET $uri HTTP/1.1\nHost: rbls.org\n\n"); | ||
15 | @buff = <$soc>; | ||
16 | delete @buff[0..7]; | ||
17 | $len = @buff; | ||
18 | |||
19 | $alert = 0; | ||
20 | |||
21 | |||
22 | for( $i=0;$i<$len;$i++ ) { | ||
23 | next unless( defined $buff[$i] ); | ||
24 | chomp($buff[$i]); | ||
25 | #print "$buff[$i]\n"; | ||
26 | |||
27 | if ( $buff[$i] eq "<tr bgcolor=#ffc0c0>" ) { | ||
28 | $rbl = substr($buff[$i+1], 5, index($buff[$i], "</tr>") - 5); | ||
29 | next if ( index($rbl, '.') == -1 ); | ||
30 | print "$ip is listed in the following RBLS: " if ( $alert == 0 ); | ||
31 | print "$rbl "; | ||
32 | $alert = 1; | ||
33 | } | ||
34 | } | ||
35 | print "$ip is not listed in any RBLS" if ( $alert == 0 ); | ||
36 | print "\n"; | ||
37 | exit($alert); | ||