Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Baffled newbie SNMP script

Reply
Thread Tools

Baffled newbie SNMP script

 
 
Steve The Geek
Guest
Posts: n/a
 
      09-24-2003
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>
 
Reply With Quote
 
 
 
 
Steve The Geek
Guest
Posts: n/a
 
      09-24-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (Steve The Geek) wrote in message news:<(E-Mail Removed). com>...
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SNMP module to query net-snmp milaus Perl Misc 3 08-31-2006 03:31 PM
Absolutely baffled - card not seeing network =?Utf-8?B?QW5ndXM=?= Wireless Networking 4 10-30-2005 10:04 PM
newbie baffled by de/referencing with subroutines Jessica Perl Misc 6 04-16-2005 12:29 AM
Baffled by Wireless Connection =?Utf-8?B?UGFt?= Wireless Networking 2 03-07-2005 01:13 AM
SNMP - Cisco - SNMP news.easynews.com Cisco 0 03-04-2004 10:44 PM



Advertisments