S
Steve The Geek
I grabbed SNMP_Session-0.98 and well, wow.
What I'm trying to do is read an iplist from file and set the time on
the devices using the snmpset subroutine. The module compiles, but
terminates with error **Undefined subroutine &main::snmpset called at
Set-time-all.pl line 31, <IPLIST> line 139.**
I'm reasonably sure the script is bombing due to the <IPLIST> file
EOF, only because I can change the error line from 139 by adding (or
removing) blank entries from the file $IPLIST.
Any ideas, other than get the O'Reilly book and study?
TIA
Steve the (newbie to Perl) Geek
<begin script paste>
######################################
## Initialize
######################################
require 5.002;
use strict;
use SNMP_Session;
use BER;
my ($community, $oid, $IPLIST, @IPLIST_DATA, $host, $response);
$community = 'public', $oid = '1.3.6.1.4.1.52.4.3.3.1.1.0', $IPLIST =
'H:/CT_HW_IP.txt';
######################################
## Open file with IP list for all
## Cabletron/Enterasys devices
######################################
my $IPLIST = 'H:/CT_HW_IP.txt';
open ( IPLIST, $IPLIST) or die "Unable to open $IPLIST \n";
@IPLIST_DATA = <IPLIST>;
##########################
###### NOTE: script bails at this point with
##Undefined subroutine &main::snmpset called at
C:\DOCUME~1\TA3SXK~1.TAL\Desktop\SNMP_S~1.98\test\SET-TI~1.PL line 34,
<IPLIST> line 139.
####################
foreach $host (@IPLIST_DATA)
{
$response = &snmpset($host, $community, $oid, 'string', '084800');
}
close(IPLIST);
exit;
<end script paste>
What I'm trying to do is read an iplist from file and set the time on
the devices using the snmpset subroutine. The module compiles, but
terminates with error **Undefined subroutine &main::snmpset called at
Set-time-all.pl line 31, <IPLIST> line 139.**
I'm reasonably sure the script is bombing due to the <IPLIST> file
EOF, only because I can change the error line from 139 by adding (or
removing) blank entries from the file $IPLIST.
Any ideas, other than get the O'Reilly book and study?
TIA
Steve the (newbie to Perl) Geek
<begin script paste>
######################################
## Initialize
######################################
require 5.002;
use strict;
use SNMP_Session;
use BER;
my ($community, $oid, $IPLIST, @IPLIST_DATA, $host, $response);
$community = 'public', $oid = '1.3.6.1.4.1.52.4.3.3.1.1.0', $IPLIST =
'H:/CT_HW_IP.txt';
######################################
## Open file with IP list for all
## Cabletron/Enterasys devices
######################################
my $IPLIST = 'H:/CT_HW_IP.txt';
open ( IPLIST, $IPLIST) or die "Unable to open $IPLIST \n";
@IPLIST_DATA = <IPLIST>;
##########################
###### NOTE: script bails at this point with
##Undefined subroutine &main::snmpset called at
C:\DOCUME~1\TA3SXK~1.TAL\Desktop\SNMP_S~1.98\test\SET-TI~1.PL line 34,
<IPLIST> line 139.
####################
foreach $host (@IPLIST_DATA)
{
$response = &snmpset($host, $community, $oid, 'string', '084800');
}
close(IPLIST);
exit;
<end script paste>