Use of uninitialized value in subroutine entry at D:/Perl/lib/Socket.pm line 370
, <NAV> line 655.
Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16 at D:/P
erl/lib/Socket.pm line 370, <NAV> line 655.
Here is the script I am using.
use File::Copy;
use Net:
ing;
my $host = Net:
ing->new("icmp");
#print_text();
gather_info();
##### Open logfiles for input and Read in machines to be evaluated #####
open (SIGNATURES, ">>d:\\scripts\\Symantec\\Check_wks_dates\\NAV_Sigs.log");
open (UNREACHABLE, ">>d:\\scripts\\Symantec\\Check_wks_dates\\UnReachable.log");
open (NAV, "<d:\\scripts\\Symantec\\Check_wks_dates\\All_DLS_Workstations.log") || die ("Cannot open All_DLS_Workstations.log: $!"); ##### Here is where you modify your list ####
while(<NAV>) {
chomp $_;
$_ =~ tr/a-z/A-Z/;
if ($host->ping($_, 5)){&wks}
else {
print "$_ unreachable\n";
print UNREACHABLE ("$_\n")}
}
close SIGNATURES;
close NAV;
$host->close();
#####################################################################
##### Compare <STDIN> Nav date with value on workstation #####
sub wks
{
if (-e "d:\\scripts\\Symantec\\Check_wks_dates\\wks.txt"){`del d:\\scripts\\Symantec\\Check_wks_dates\\wks.txt`;}
if (-e "\\\\$_\\tivoli\$\\progra~1\\common~1\\symant~1\\virusd~1\\definfo.dat"){copy ("\\\\$_\\tivoli\$\\progra~1\\common~1\\symant~1\\virusd~1\\definfo.dat","d:\\scripts\\Symantec\\Check_wks_dates\\wks.txt");}
$wks_cur_nav = `grep CurDefs= wks.txt | cut -c 9-22`; chomp $wks_cur_nav;
$wks_old_nav = `grep LastDefs= wks.txt | cut -c 10-22`; chomp $wks_old_nav;
print SIGNATURES "$_,$wks_cur_nav,$wks_old_nav,$cur_nav_sig\n";
print "$_\n";
}
##### Gather Information ########
sub gather_info
{
if (-e "d:\\scripts\\Symantec\\Check_wks_dates\\SAV_Server.txt"){`del d:\\scripts\\Symantec\\Check_wks_dates\\SAV_Server.txt`;}
if (-e "\\\\12.12.12.12\\c\$\\progra~1\\common~1\\symant~1\\virusd~1\\definfo.dat"){copy ("\\\\12.12.12.12\\c\$\\progra~1\\common~1\\symant~1\\virusd~1\\definfo.dat","d:\\scripts\\Symantec\\Check_wks_dates\\SAV_Server.txt");}
$cur_nav_sig = `grep CurDefs= SAV_Server.txt | cut -c 9-21`; chomp $cur_nav_sig;
}
, <NAV> line 655.
Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16 at D:/P
erl/lib/Socket.pm line 370, <NAV> line 655.
Here is the script I am using.
use File::Copy;
use Net:
my $host = Net:
#print_text();
gather_info();
##### Open logfiles for input and Read in machines to be evaluated #####
open (SIGNATURES, ">>d:\\scripts\\Symantec\\Check_wks_dates\\NAV_Sigs.log");
open (UNREACHABLE, ">>d:\\scripts\\Symantec\\Check_wks_dates\\UnReachable.log");
open (NAV, "<d:\\scripts\\Symantec\\Check_wks_dates\\All_DLS_Workstations.log") || die ("Cannot open All_DLS_Workstations.log: $!"); ##### Here is where you modify your list ####
while(<NAV>) {
chomp $_;
$_ =~ tr/a-z/A-Z/;
if ($host->ping($_, 5)){&wks}
else {
print "$_ unreachable\n";
print UNREACHABLE ("$_\n")}
}
close SIGNATURES;
close NAV;
$host->close();
#####################################################################
##### Compare <STDIN> Nav date with value on workstation #####
sub wks
{
if (-e "d:\\scripts\\Symantec\\Check_wks_dates\\wks.txt"){`del d:\\scripts\\Symantec\\Check_wks_dates\\wks.txt`;}
if (-e "\\\\$_\\tivoli\$\\progra~1\\common~1\\symant~1\\virusd~1\\definfo.dat"){copy ("\\\\$_\\tivoli\$\\progra~1\\common~1\\symant~1\\virusd~1\\definfo.dat","d:\\scripts\\Symantec\\Check_wks_dates\\wks.txt");}
$wks_cur_nav = `grep CurDefs= wks.txt | cut -c 9-22`; chomp $wks_cur_nav;
$wks_old_nav = `grep LastDefs= wks.txt | cut -c 10-22`; chomp $wks_old_nav;
print SIGNATURES "$_,$wks_cur_nav,$wks_old_nav,$cur_nav_sig\n";
print "$_\n";
}
##### Gather Information ########
sub gather_info
{
if (-e "d:\\scripts\\Symantec\\Check_wks_dates\\SAV_Server.txt"){`del d:\\scripts\\Symantec\\Check_wks_dates\\SAV_Server.txt`;}
if (-e "\\\\12.12.12.12\\c\$\\progra~1\\common~1\\symant~1\\virusd~1\\definfo.dat"){copy ("\\\\12.12.12.12\\c\$\\progra~1\\common~1\\symant~1\\virusd~1\\definfo.dat","d:\\scripts\\Symantec\\Check_wks_dates\\SAV_Server.txt");}
$cur_nav_sig = `grep CurDefs= SAV_Server.txt | cut -c 9-21`; chomp $cur_nav_sig;
}