RE: Working a whole device with Net::SNMP with Perl

"Mike Ayers" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <83E753BE7B6A324ABB336245BAF1DAAC08AAF746@mailserver.metatv-ds.metatv.com>
> From: [email protected] 
> [mailto:[email protected]] On 
> Behalf Of Thomas Bonham
> Sent: Tuesday, June 10, 2008 10:17 AM

> Wes Hardaker wrote:
> >>>>>> On Tue, 10 Jun 2008 05:08:11 -0700, Thomas Bonham 
> <[email protected]> said:
> >>>>>>             
> >
> > TB> I'm trying to figure out how to walk a whole device 
> using Net::SNMP in 
> > TB> perl.
> >
> > We aren't affiliated with the Net::SNMP perl module; the module that
> > binds to the Net-SNMP package is "SNMP" instead (in which 
> case, Dave's
> > answer is spot on)
> >   
> I didn't know that.

	Details, originally from Dave:

http://www.net-snmp.org/wiki/index.php/Which_Perl_module_should_I_use

> Maybe someone can tell me why I'm getting a error here with 
> this little 
> bit of perl.
> 
> Code:
> #/usr/bin/perl -w
> $host = "localhost";
> $st="public";
> $sess = new SNMP::Session(DestHost=>$host,Community=>$st);
> $val = $sess->get("sysDescr.0");
> die $sess->{ErrroStr} if($sess->{ErrorStr});
> 
> Error: Unknow user name at test.pl line 7.

	"User name" is an SNMP v3 concept, but you are setting a community, which implies v1/v2c operation.  You need to find and set the thingy that determines the SNMP version.  Sorry I can't give more detail, but I gleefully discarded perl years ago...


	HTH,

Mike

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.