Subject: | udp port checking |
Date: | Thu, 23 Aug 2007 13:35:17 +0300 |
To: | bug-IO-Socket-PortState [...] rt.cpan.org |
From: | Edmondas Girkantas <eg [...] bsd.lt> |
Hi,
check_ports() does not check properly udp ports, try to check your
localhost for 53 (dns) port:
#!/usr/bin/perl
use strict;
use warnings;
require 'PortState.pm';
my %porthash = ( udp => { 53 => { name => 'DNS' }, }, );
my $host = '127.0.0.1';
my $timeout = 5;
IO::Socket::PortState::check_ports( $host, $timeout, \%porthash );
for my $proto ( keys %porthash ) {
for ( keys %{ $porthash{$proto} } ) {
print "$proto $_ is not open " . ( $porthash{$proto}->{$_}->
{name} ) if !$porthash{$proto}->{$_}->{open};
}
}
You must listen for icmp messages. Read more about that at:
http://www.decorous.co.uk/perl.html
PortState version: 0.03
Perl version: 5.8.8
Operating system: FreeBSD 6.2-STABLE
--
Edmondas Girkantas <eg@bsd.lt>