Is There Anybody Out There?

while searching for a way to get the information if there is still someone connected to a Cisco router (without connecting myself) I found How To Get Information About Users Connected To The TTY By Using SNMP English.

I added some configuration to the router:

access-list 60 remark protect snmp
access-list 60 permit
snmp-server community private RW 60
snmp-server community public RO 60

Beware: The community strings are an example and shouldn’t be used on real equipment or outside a test lab!

While I was connected (from another session) to the console port of the router I tried to look for tsLineActive (that means: actice lines on the router).

crissa@unseen:~$ snmpwalk -v 2c -c public
SNMPv2-SMI::enterprises. = INTEGER: 1
SNMPv2-SMI::enterprises. = INTEGER: 0
SNMPv2-SMI::enterprises. = INTEGER: 0

Double check on the router.

    Line       User       Host(s)              Idle       Location
*  0 con 0     cisco      idle                 00:00:00   

  Interface    User               Mode         Idle     Peer Address

But I just need the value of the used ports.

crissa@unseen:~$ snmpwalk -v 2c -c public | grep "INTEGER: 1" | wc -l

If you know how to ask it is easy to get the information you need! Without SNMP the only way to get this information is to connect to the router and to use the command “who” or “show user”.
Bye, Tore

This entry was posted in Cisco, General and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *