1package Net::DNS::Check::Test::soa_expire_compare; 2 3use strict; 4use vars qw(@ISA $VERSION); 5 6@ISA = qw(Net::DNS::Check::Test); 7 8sub new { 9 my ($class) = shift; 10 11 my ($self) = bless {}, $class; 12 13 if ( @_ ) { 14 $self->_process_args(@_); 15 } 16 17 $self->test(); 18 19 return $self; 20} 21 22 23sub test() { 24 my ($self) = shift; 25 26 # return unless ( $self->{config} ); 27 28 my $test_status = 1; 29 my %compare_hash; 30 my $test_detail = {}; 31 32 foreach my $nsquery ( @{$self->{nsquery}} ) { 33 my $soa_expire = $nsquery->soa_expire(); 34 my $ns_name = $nsquery->ns_name(); 35 36 $compare_hash{$soa_expire}++; 37 $test_detail->{$ns_name}->{desc} = $soa_expire; 38 } 39 40 41 if ((scalar keys %compare_hash) > 1) { 42 $test_status = 0; 43 } 44 45 $self->{test_status} = $test_status; 46 $self->{test_detail} = $test_detail; 47 48 return $test_status; 49} 50 511; 52 53__END__ 54 55 56=head1 NAME 57 58Net::DNS::Check::Test::soa_expire_compare - Compare the expire time of all the authoritative nameservers 59 60=head1 SYNOPSIS 61 62C<use Net::DNS::Check::Test::soa_expire_compare>; 63 64=head1 DESCRIPTION 65 66Compare the expire time of all the authoritative nameservers 67 68=head1 METHODS 69 70=head1 COPYRIGHT 71 72Copyright (c) 2005 Lorenzo Luconi Trombacchi - IIT-CNR 73 74All rights reserved. This program is free software; you may redistribute 75it and/or modify it under the same terms as Perl itself. 76 77=head1 SEE ALSO 78 79L<perl(1)> 80 81=cut 82 83