Re: snmpget and compound MIB variables
Alexander Shikoff <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Dave, On Thu, Sep 03, 2009 at 10:09:35AM +0100, Dave Shield wrote: > 2009/9/2 Alexander Shikoff <[email protected]>: > > $ENV{'MIBDIRS'} = '/usr/local/share/snmp/mibs:/data/noc/mrtg/MIBs/Juniper/9.5'; > > $ENV{'MIBS'} = 'JUNIPER-SCU-MIB'; > > It would probably be sensible to insert a '+' before these two values, > as you did with the command-line arguments. It loads MIB normally, jnxScuStatsBytes is normally converted by &SNMP::translateObj to numeric OID. > > > my $sess = new SNMP::Session(DestHost => 'br1-gdr', Community => 'public', Version => '2c' ); > > print $sess->get('jnxScuStatsBytes.208.ipv4."from-World"'), "\n"; > > > > But script returns error NOSUCHINSTANCE. > > Debugging shows that jnxScuStatsBytes.208.ipv4."from-World" is not > > converted to OID correctly: > > What happens if you try replacing: > > a) "ipv4" with the numeric enumeration value print $sess->get('jnxScuStatsBytes.208.1."from-World"'), "\n"; # ./test.pl NOSUCHINSTANCE > b) "from-World" with the equivalent list of numeric OIDs > (10.102.114.111.199.45.87.111.114.108.100) ^^^^^^^ here should be 109, not 199 print $sess->get('jnxScuStatsBytes.208.ipv4.10.102.114.111.109.45.87.111.114.108.100'), "\n"; # ./test.pl NOSUCHINSTANCE > c) both of the above print $sess->get('jnxScuStatsBytes.208.1.10.102.114.111.109.45.87.111.114.108.100'), "\n"; # ./test.pl 570840089787 Now it works. Net-SNMP command line tools work normally in any case but SNMP perl interface does not. -- MINO-RIPE ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ 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