Sponsored Content
Top Forums Shell Programming and Scripting perl Net::SNMP version getting info from cisco switch Post 302540846 by dynamax on Thursday 21st of July 2011 05:48:06 PM
Old 07-21-2011
Computer perl Net::SNMP version getting info from cisco switch

I am having trouble working with SNMP module with perl. I am trying to get SNMP version of target system. I use following code to get it however it resturns error as "Argument "v6.0.1" isn't numeric in numeric lt (<) at ./chk_env_upd.pl line 447."

Code:
 Get load table
my $resultat = (Net::SNMP->VERSION < 4) ?
                  $session->get_table($ciscoEnvMonMIB)
                : $session->get_table(Baseoid => $ciscoEnvMonMIB);

Any help is appreciated
 

7 More Discussions You Might Find Interesting

1. Ubuntu

how to connect to Cisco switch from Ubnutu

Hi, I installed Ubnutu on my old laptop which does have COMM port, I want to connect to Cisco switch, I have Cisco cable connected to laptop. On Windows, I usually bring up "Hyper Terminal" how do I do it here? Please advice. Thanks. (7 Replies)
Discussion started by: samnyc
7 Replies

2. Shell Programming and Scripting

using if to identify proper mib for use with a cisco switch

Happy ThanksGiving guys, I'm working on a script that will use nmap to enumerate a network for active cisco switches. Once the list is complete, we use sed to clean up the file (called nmapres) so it is only a list of IP addresses. Next I want to use a while statement to go down that list of... (6 Replies)
Discussion started by: mitch
6 Replies

3. Infrastructure Monitoring

HPUX net-SNMP interpreter "/bin/perl" not found

I am trying to install net-snmp on an HPUX box. I am getting the fallowing error message when I try to run the snmpconf file. I installed the fallowing version of net-snmp net-snmp-5.0.10.2-HP-UX_B.11.11_9000_800.tar and my HPUX box is version HP-UX commnms B.11.11 U 9000/800... (2 Replies)
Discussion started by: krisarmstrong
2 Replies

4. Shell Programming and Scripting

Perl variables inside Net::Telnet::Cisco Module doesn't work

I am writing perl script to configure Cisco device but Variables inside Net::Telnet::Cisco Module doesn't work and passed to device without resolving. Please advise. here is a sample of script: use Net::Telnet::Cisco; $device = "10.14.199.1"; ($o1, $o2, $o3, $o4) = split(/\./,$device);... (5 Replies)
Discussion started by: ahmed_zaher
5 Replies

5. IP Networking

cisco switch + firewall configuration upgrade

Hi experts, I need to cope configuration from one switch/firewall to another switch/firewall. I have copied running configs. The question is do I have to clear the existing configuration on the dest. devices Or can I copy it(replace) directly without clearing previous config ? If... (2 Replies)
Discussion started by: hernand
2 Replies

6. Infrastructure Monitoring

Nagios 3.3.1 SNMP with Cisco Switch Fails

Hello all! I am running Nagios 3.3.1 and I am trying to get it to monitor the ports on my Cisco Catalyst 3524-XL-PWR Managed Switch. But I keep getting "(Return code of 127 is out of bounds - plugin may be missing)" I have installed and compiled the plugins and the snmp services on the Ubuntu... (0 Replies)
Discussion started by: RossIV
0 Replies

7. Solaris

Error occurred while making the net-snmp 5.4.4 on Solaris 5.10 version.

Hi all, Error occurred while making the net-snmp-5.4.4 on Solaris 5.10 version. Environment - Solaris 5.10-x86 - Net-SNMP-5.4.4.tar.gz - Path (/etc/profile) PATH=/usr/local/bin:$PATH export PATH LD_LIBRARY_PATHUSR=/usr/ccs/bin: export LD_LIBRARY_PATH Error01 - summary ***... (3 Replies)
Discussion started by: ziosnim
3 Replies
VARIABLES(5)							     Net-SNMP							      VARIABLES(5)

NAME
variables - Format of specifying variable names to SNMP tools. DESCRIPTION
The syntax and semantics of management information in SNMP is given by the definitions of MIB objects, loaded from one or more MIB files (or "MIB modules"). These definitions are not strictly required for the SNMP protocol to operate correctly, but are typically needed by SNMP client applications to display information in a meaningful manner. The MIB file also serves as a design document when developing an SNMP agent (or sub-agent) that provides this information, and ensures that client and server share a common understanding about what management information represents. OIDs MIB objects are specified using Object Identifiers (OIDs), which can take a number of forms. Note that all of the examples in this sec- tion refer to the same MIB object. Numeric OIDs The fundamental format of an OID is a sequence of integer values (or "subidentifiers"), typically written using dots to separate the indi- vidual subidentifiers. .1.3.6.1.2.1.1.1 This is the format that is used within the SNMP protocol itself, in the packets that are sent over the network. This form of representing an OID does not require MIB files or MIB object definitions to be available. However it does rely on the client application and/or network administrator knowing what a given numeric OID refers to. As such, it is not a particularly helpful representa- tion to anyone just starting out with SNMP. This format can be obtained by giving the command-line option -On to most Net-SNMP commands. Full OID path A similar (but somewhat more informative) format uses the same dotted list representation, but with the numeric subidentifiers replaced by names, taken from the relevant MIB file(s). .iso.org.dod.internet.mgmt.mib-2.system.sysDescr This uniquely identifies a particular MIB object (as with the numeric OID), but the list of names should hopefully give some indication as to what information this object represents. However it does rely on the relevant MIB files being available (as do all formats other than the purely numeric OID). Such OIDs also tend to be fairly long! This format can be obtained by giving the command-line option -Of to most Net-SNMP commands. A variant of this (typically used when writing OIDs in descriptive text, rather than running programs), is to combine the name and numeric subidentifier: .iso(1).org(3).dod(6).internet(1).mgmt(2).mib-2(1).system(1).sysDescr(1) Module-qualified OIDs An alternative way to (more-or-less) uniquely specify an OID, is to give the name of the MIB object, together with the MIB module where it is defined. SNMPv2-MIB::sysDescr MIB object names are unique within a given module, so as long as there are not two MIB modules with the same name (which is unusual, though not unheard of), this format specifies the desired object in a reasonably compact form. It also makes it relatively easy to find the defi- nition of the MIB object. This is the default format for displaying OIDs in Net-SNMP applications. It can also be specified explicitly by giving the command-line option -OS to most Net-SNMP commands. Object name Possibly the most common form for specifying MIB objects is using the name of the object alone - without the full path or the name of the module that defines it. sysDescr This is by far the shortest and most convenient way to refer to a MIB object. However the danger is that if two MIB modules each define a MIB object with the same name (which is perfectly legal in some circumstances), then it's not necessarily clear which MIB object is actu- ally meant. For day-to-day use, particularly when using standard MIB objects, this is probaby safe. But it's important to be aware of the potential ambiguities. This format can be obtained by giving the command-line option -Os to most Net-SNMP commands. UCD-format Previous versions of the code (UCD v4.x and earlier) used a simple approach to shortening the way OIDs were specified. If the full path of the OID began with .iso.org.dod.internet.mgmt.mib-2 then this prefix was removed from the OID before displaying it. All other OIDs were displayed in full. Similarly, if an OID was passed to the UCD library that did not begin with a dot (and wasn't in the module::name format), then the same prefix was prepended. The example OID from the formats listed above would therefore be given or displayed as system.sysDescr The inconsistent handling of OIDs, depending on their location within the OID tree, proved to be more trouble than it was worth, and this format is no longer recommended. The previous behaviour can be obtained by giving the command-line option -Ou (for displaying output), or -Iu (for interpreting input OIDs without a leading dot) to most Net-SNMP commands. SEE ALSO
snmpcmd(1) BUGS
The parser of the MIB files file is not expected to handle bizarre (although correct) interpretations of the ASN.1 notation. V5.7.2 01 Oct 2010 VARIABLES(5)
All times are GMT -4. The time now is 02:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy