Sponsored Content
Top Forums Shell Programming and Scripting perl Net::SNMP version getting info from cisco switch Post 302540851 by radoulov on Thursday 21st of July 2011 06:24:49 PM
Old 07-21-2011
Something like this:


Code:
% perl -Mstrict -MNet::SNMP -wle'
  ( my $mod_version = Net::SNMP->VERSION ) =~ s/\D+(\d+).*/$1/;
  print $mod_version > 4 ? "OK" : "KO" ;
  '
OK

 

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
Info::Layer3::Pf(3pm)					User Contributed Perl Documentation				     Info::Layer3::Pf(3pm)

NAME
SNMP::Info::Layer3::Pf - SNMP Interface to FreeBSD-Based Firewalls using Pf /Pf Sense AUTHOR
Max Baker SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. my $pf = new SNMP::Info( AutoSpecify => 1, Debug => 1, # These arguments are passed directly to SNMP::Session DestHost => 'myswitch', Community => 'public', Version => 2 ) or die "Can't connect to DestHost. "; my $class = $pf->class(); print "SNMP::Info determined this device to fall under subclass : $class "; DESCRIPTION
Subclass for Free-BSD PF-Based devices LLDP Support LLDP Support is included but untested in this Device Class. It is reported that the available CDP/LLDP modules for net-snmp don't work on FreeBSD (on which pfSense is based) as they assume certain Linux specific Ethernet structures. This problem is apparently solved on PF based firewall appliances by using the ladvd package, for which a port may be found here: <http://www.freshports.org/net/ladvd/>. I'm not sure if this module ties into Net-SNMP or not. Inherited Classes SNMP::Info::Layer3 SNMP::Info::LLDP Required MIBs FOKUS-MIB Inherited Classes' MIBs See "Required MIBs" in SNMP::Info::Layer3 for its own MIB requirements. See "Required MIBs" in SNMP::Info::LLDP for its own MIB requirements. GLOBALS
These are methods that return scalar values from SNMP $pf->vendor() Returns 'FreeBSD' $pf->hasCDP() Returns whether LLDP is enabled. $pf->model() Grabs the os version from "sysDescr" $pf->os() Returns 'Pf' $pf->os_ver() Tries to reference $pf->id() to one of the product MIBs listed above. Will probably return a truncation of the default OID for pf- based systems "enterprises.12325.1.1.2.1.1". Global Methods imported from SNMP::Info::Layer3 See documentation in "GLOBALS" in SNMP::Info::Layer3 for details. TABLE METHODS
These are methods that return tables of information in the form of a reference to a hash. $pf->c_id() Returns LLDP information. $pf->c_if() Returns LLDP information. $pf->c_ip() Returns LLDP information. $pf->c_platform() Returns LLDP information. $pf->c_port() Returns LLDP information. Table Methods imported from SNMP::Info::Layer3 See documentation in "TABLE METHODS" in SNMP::Info::Layer3 for details. Table Methods imported from SNMP::Info::LLDP See documentation in "TABLE METHODS" in SNMP::Info::LLDP for details. perl v5.12.4 2011-09-28 Info::Layer3::Pf(3pm)
All times are GMT -4. The time now is 04:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy