Cisco Works, SNMP, MIBs.
User avatar
Farls
New Member
Posts:
23
Joined:
Mon Feb 28, 2011 12:01 pm
Certs:
ccna

Can you write interface descriptions using SNMP?

Wed Jan 25, 2012 12:06 pm

I can get a list of MACs mapped to computer names on my network, so I'm looking at a way to import the computer name into the description of an interface. I'm not very familiar with writing to a switch using SNMP, so I'm not sure if this is possible. Is there a better way to do this other than SNMP?

Thanks.

User avatar
ristau5741
Post Whore
Posts:
10492
Joined:
Tue Aug 21, 2007 2:15 pm
Certs:
Instanity

Re: Can you write interface descriptions using SNMP?

Wed Jan 25, 2012 12:31 pm

use your RW SNMP string and write to the correct MIB.
shouldn't bee a problem.
Tips of the day:
- The human mind is the ultimate creation invention.
- I have so many customers, my customers have customers.
- Sausage time
- POP, stack, and store

Perlhack
Member
Posts:
234
Joined:
Wed Aug 19, 2009 7:22 pm
Certs:
CCNP CCIP CCNA-S

Re: Can you write interface descriptions using SNMP?

Wed Jan 25, 2012 1:10 pm

The OID ifAlias can be found in the IF-MIB and it is writeable. Find the index values of the interfaces by doing an snmpwalk, then set the ifAlias.<index> OID. The running config will hold this as the interface description.

snmpset -v1 -c community isr ifAlias.2 s this_is_a_test_description 2>/dev/null
IF-MIB::ifAlias.2 = STRING: this_is_a_test_description

Verify snmpset is written:
snmpget -v 2c -c community isr ifAlias.2 2>/dev/null
IF-MIB::ifAlias.2 = STRING: this_is_a_test_description
_______________________________________________________________________
There are 10 types of people in the world. Those who understand binary and those who don't.

User avatar
Farls
New Member
Posts:
23
Joined:
Mon Feb 28, 2011 12:01 pm
Certs:
ccna

Re: Can you write interface descriptions using SNMP?

Wed Jan 25, 2012 2:11 pm

Thank you!
That worked perfectly.
Would you happen to know of an Oid that would get the mac address of the computer in each port?

Perlhack
Member
Posts:
234
Joined:
Wed Aug 19, 2009 7:22 pm
Certs:
CCNP CCIP CCNA-S

Re: Can you write interface descriptions using SNMP?

Wed Jan 25, 2012 3:01 pm

No OID is available. It can be mapped following the procedure listed here:
http://www.cisco.com/en/US/tech/tk648/t ... 9199.shtml
_______________________________________________________________________
There are 10 types of people in the world. Those who understand binary and those who don't.

User avatar
that1guy15
Post Whore
Posts:
3224
Joined:
Thu Apr 29, 2010 6:12 pm
Certs:
CCNP, CCDP, CCIP

Re: Can you write interface descriptions using SNMP?

Wed Jan 25, 2012 3:16 pm

Im not sure if this is something you are going to script but keep in mind that the Interface Index value for each interface could change apon a reboot of your device. Its annoying as hell and there is a command to lock it down but I hear it dosent work 100%

http://www.cisco.com/en/US/tech/tk648/t ... 4eec.shtml
http://blog.movingonesandzeros.net/

'

Return to Cisco Network Management

Who is online

Users browsing this forum: No registered users and 8 guests