Changeset 359
- Timestamp:
- Sep 14, 2018, 8:44:13 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ddt/ddt
r358 r359 2686 2686 2687 2687 my $help = get_cmd_name(); 2688 my ($opt_direct, $opt_reverse );2688 my ($opt_direct, $opt_reverse, $opt_byip); 2689 2689 2690 2690 GetOptions( 2691 2691 'direct|d' => \$opt_direct, 2692 2692 'reverse|r' => \$opt_reverse, 2693 'by-ip|b' => \$opt_byip, 2693 2694 ); 2694 2695 2695 2696 my $computer_db = ipamdb_load($COMPUTER_YAML); 2696 2697 2697 if ($opt_direct or not $opt_reverse) { # DDT to DNS check2698 if ($opt_direct or not ($opt_reverse or $opt_byip)) { # DDT to DNS check 2698 2699 LOOP_ON_SECTOR: 2699 2700 for my $sector_current (keys %{$computer_db}) { … … 2752 2753 printf "Unkown IP: %-15s / %s\n", $ip, $hostname_fq; 2753 2754 next LOOP_ON_IP; 2755 } 2756 } 2757 } 2758 } 2759 2760 if ($opt_byip) { # IP Range DDT check 2761 my @ip_check; 2762 LOOP_ON_SECTOR: 2763 for my $sector_current (@{$computer_db->{'dset'}}) { 2764 next LOOP_ON_SECTOR if not exists $computer_db->{'dset'}{'ip_range'}; 2765 2766 LOOP_ON_CIDR: 2767 for my $ip_range (@{$computer_db->{'dset'}{'ip_range'}}) { 2768 2769 LOOP_ON_IP: 2770 for my $ip (NetAddr::IP->new($ip_range)->hostenum()) { 2771 print "$ip\n"; 2754 2772 } 2755 2773 }
Note: See TracChangeset
for help on using the changeset viewer.