Changeset 362 for trunk/ddt


Ignore:
Timestamp:
Sep 14, 2018, 10:13:58 PM (6 years ago)
Author:
g7moreau
Message:
  • Small in DNS check
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ddt/ddt

    r361 r362  
    2121use strict;
    2222#use warnings;
    23 use version; our $VERSION = version->declare('0.11.8');
     23use version; our $VERSION = version->declare('0.11.9');
    2424
    2525use Getopt::Long qw(GetOptions);
     
    27702770            for my $ip (NetAddr::IP->new($ip_range)->hostenum()) {
    27712771               $ip =~ s{/32$}{};
    2772                print "$ip\n";
    27732772               
    27742773               my $dns_hostname_fq = scalar gethostbyaddr(inet_aton($ip), AF_INET);
     
    27802779                  my $ip_address = inet_ntoa($packed_ip);
    27812780                  if ($ip ne $ip_address) {
    2782                      print "Error: bad IP $ip for reverse DNS on $dns_hostname_fq\n";
    2783                      #next LOOP_ON_IP;
     2781                     print "Error: bad IP $ip for reverse DNS on $dns_hostname_fq sector $sector_current\n";
    27842782                     }
    27852783                  }
    27862784
    2787                # Verify direct return same host
     2785               # Verify direct return same hostname
    27882786               LOOP_ON_COMPUTER:
    27892787               for my $computer (@{$computer_db->{$sector_current}}) {
     
    27922790                  next LOOP_ON_COMPUTER if $attribute->{'ip'} ne $ip;
    27932791
    2794                   next LOOP_ON_IP if $attribute->{'hostname'} eq $dns_hostname;
    2795                  
    2796                   print "Error: DNS bad host $dns_hostname for IP $ip\n";
     2792                  print "Error: bad DNS host $dns_hostname / DDT host $attribute->{'hostname'} in sector $sector_current with IP $ip\n"
     2793                     if $attribute->{'hostname'} ne $dns_hostname;
     2794
    27972795                  next LOOP_ON_IP;
    27982796                  }
     
    28002798               # Declare in DNS but not in DDT
    28012799               print "Error: DNS host $dns_hostname in sector $sector_current with IP $ip not declare in DDT database\n" if $dns_hostname ne '';
    2802                # Normally never arrive here
    2803 
    2804                #if ($computer_db->{$sector_current}{}$attribute->{'hostname'} ne $dns_hostname) {
    2805                #   print "$mac_address ($sector_current) $ip - $dns_hostname / $attribute->{'hostname'} # $attribute->{'comment'}\n";
    2806                #   next LOOP_ON_IP;
    2807                #   }
    28082800               }
    28092801            }
Note: See TracChangeset for help on using the changeset viewer.