cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1447
Views
5
Helpful
3
Replies

Is it possible to put information of a Cisco command within a oid Snmp?

I'm trying to develop a application by using snmp but first of all, I wanna know if it's possible to put information of a command (for example the power's values of "show interface transceiver details" ) in a new oid.

Is it possible to do that? or there's another way.

Thank you

3 Replies 3

julian.bendix
Level 3
Level 3

Hey!

No, you can just use existing OIDs which contain parts of the info you want to poll.
But can not create new OIDs containing custom infomation.

Best regards
Julian

pigallo
Cisco Employee
Cisco Employee

Hi,


not sure what you're trying to accomplish as question is way too generic.
When you work with SNMP you have limited set of operations like SNMP-SET option which is supposed to allow external modification of content where OID points to.

Basically, you cannot store and write returned value of an SNMP query (SNMP-GET for example) directly into a new OID as it's just pointer to actual content. And if you want to add new OIDs to the MIB you should build your own MIBs by working with an editor and validate it. But it's not an easy process to walk through.
In that case though, being able to read specific OID content from MIB data structure could probably allow your application to store specific MIB value retrieved from the device and then SET this value to different OID assuming at least that:

 

  1. SNMP-SET instruction is available for that leaf content (read and write / write-only defined for such objects).
  2. Source and destination SNMP leaf datatypes match

 

 

regards

 

 

 

 

Dan Frey
Cisco Employee
Cisco Employee

You can run "show commands" in IOS and stuff the output into an OID.   The OID will be in the DISMAN-EXPRESSION-MIB branch.   Here is an example that will update the show output every 3600 seconds, or I can run the embedded event manager manually.

 

event manager applet makeOID

event tag tag1 timer watchdog time 3600

event tag tag2 none

trigger

  correlate event tag1 or event tag2

action 010 cli command "enable"

action 030 cli command "show plat hard crypto-device util | inc ^ 5 min"

action 040 set myoid "$_cli_result"

action 050 cli command "conf t"

action 060 cli command "snmp mib expression owner fivemin name crypto"

action 070 cli command "description $myoid"

action 080 cli command "enable"

action 090 cli command "exit"

action 100 cli command "exit"

CLI output:

lab-csr7#show plat hard crypto-device util | inc ^ 5 min

5 min (percentage) : 0%

 

SNMP output:

[root@CrashCart TCL]# snmpwalk -v 2c -c public 192.168.0.74 iso.3.6.1.2.1.90.1.2.1.1 2>/dev/null

DISMAN-EXPRESSION-MIB::expExpressionComment."fivemin"."crypto" = STRING: 5 min (percentage) : 0%