Subversion Repositories sysadmin_scripts

Rev

Rev 157 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 157 Rev 164
Line 74... Line 74...
74
#
74
#
75
# 20230326 RWR v3.0.2
75
# 20230326 RWR v3.0.2
76
# set it up so if net::dns not loadable, will revert to ionet
76
# set it up so if net::dns not loadable, will revert to ionet
77
# 20240810 RWR v3.4.0
77
# 20240810 RWR v3.4.0
78
# Added code in getDNSNames to use dig if it is available and all other ways have failed to find a hostname
78
# Added code in getDNSNames to use dig if it is available and all other ways have failed to find a hostname
-
 
79
# 20240818 RWR v3.4.1
-
 
80
# Fixed so empty IP/Mac does not cause error
79
 
81
 
80
 
82
 
81
# for Debian, to get the required libraries
83
# for Debian, to get the required libraries
82
# apt install libyaml-tiny-perl libnet-dns-perl snmp
84
# apt install libyaml-tiny-perl libnet-dns-perl snmp
83
 
85
 
Line 92... Line 94...
92
my $DEBUG = 0;
94
my $DEBUG = 0;
93
 
95
 
94
# define the version number
96
# define the version number
95
# see https://metacpan.org/pod/release/JPEACOCK/version-0.97/lib/version.pod
97
# see https://metacpan.org/pod/release/JPEACOCK/version-0.97/lib/version.pod
96
use version;
98
use version;
97
our $VERSION = version->declare("v3.4.0");
99
our $VERSION = version->declare("v3.4.1");
98
 
100
 
99
# see https://perldoc.perl.org/Getopt/Long.html
101
# see https://perldoc.perl.org/Getopt/Long.html
100
use Getopt::Long;
102
use Getopt::Long;
101
# allow -vvn (ie, --verbose --verbose --dryrun)
103
# allow -vvn (ie, --verbose --verbose --dryrun)
102
Getopt::Long::Configure ("bundling");
104
Getopt::Long::Configure ("bundling");
Line 343... Line 345...
343
         chomp $line;
345
         chomp $line;
344
         my @values = split( "\t", $line );
346
         my @values = split( "\t", $line );
345
         my $mac = &cleanMac($values[$macIndex]);
347
         my $mac = &cleanMac($values[$macIndex]);
346
         for( my $i = 0; $i < @headers; $i++ ) {
348
         for( my $i = 0; $i < @headers; $i++ ) {
347
            # update the value if one does not already exist
349
            # update the value if one does not already exist
-
 
350
            if ( $values[$i] ) {
348
            $routerARP->{$mac}->{$headers[$i]} = lc $values[$i] unless $routerARP->{$mac}->{$headers[$i]};
351
               $routerARP->{$mac}->{$headers[$i]} = lc $values[$i] unless $routerARP->{$mac}->{$headers[$i]};
-
 
352
            }
349
         }
353
         }
350
      }
354
      }
351
      close FN;
355
      close FN;
352
   }
356
   }
353
   # now, update from our staticmaps
357
   # now, update from our staticmaps