11-30-2020 02:03 PM
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
11-30-2020 02:57 PM
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
11-30-2020 04:15 PM
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:
regards
12-01-2020 06:27 AM
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%
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide