Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Is there any way to use the Net::SNMP module to connect to a Cisco router that is connected though a term server?

I can't figure out what parameters could be used when invoking the Net::SNMP->session method to create the session object. Is this even possible if I am connecting through a term server?

Typically I connect to my router through the following command:
% telnet <termServer Hostname> <port Router is connected to>

Our routers are on a private lab network.

My goal in using Net::SNMP to track the card inventory in the routers. For example, we want to know the details of what the "show module" displays (not all of it may be relevent). It would help us to track what inventory we have in our lab on each router. Does anyone how to find out what OIDs to use? I am not very familiar with SNMP so assume I have limited knowledge of how to find this out. I have a list of all the OIDs from the Cisco web site. However, I don't know how to correspond this to the info I want from the "show module" output (card type, model, serial num, etc).

Replies are listed 'Best First'.
Re: SNMP access for Cisco router with term server
by zengargoyle (Deacon) on Nov 13, 2003 at 00:46 UTC

    first check Net::Telnet::Cisco. it probably can take a port number and will probably work through your current terminal server setup (i'm assuming the terminal server connects to the console ports on the routers...). you may be able to get direct telnet access to the routers themselves and bypass the terminal server alltogether.

    Net::Telnet::Cisco will let you send 'terminal length 0' and then 'show module' and you get the output back in a nice regular Perl array.

    for SNMP you need direct access to the routers. there's no way i can think of to tunnel SNMP over the terminal server.

    usually the easiest way to dig info from SNMP is to do a 'snmpwalk' of the device starting at .1 (make sure to set your snmpwalk program to dump full OIDs, it makes it easier later). walk the device to a file, search the file for things that match the current config, then lookup the OIDs at the ever handy MibDepot.

    you'll often find information that isn't defined by the vendor MIBs but comes from some random 3rd party MIB.

    Net::Telnet::Cisco will get you started pretty quick...

Re: SNMP access for Cisco router with term server
by bobn (Chaplain) on Nov 13, 2003 at 05:14 UTC

    Since a terminal server uses a serial cable to connect to the router, if that's your only path to the router, you're out of luck using SNMP. Net::Telnet::Cisco is good stuff, but you'll probalby have to overried or modify the the new or login method to work through the terminal server.

    If you do find some way to access via the LAN, Cisco has an ftp server with its OIDs in files, I believe. Instructions for getting them are at: http://www.cisco.com/univercd/cc/td/doc/product/lan/cat5000/ent_mib/getmib.htm

    --Bob Niederman, http://bob-n.com

    All code given here is UNTESTED unless otherwise stated.