Baffled newbie SNMP script

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>
 
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.**
<<much snippage>>

Never mind. I'm an idiot.

It woulda helped if I actually put the subroutines in.

Steve the (embarrassed) Geek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top