Monday, November 23, 2020

OPENNMS : How to get OID for custom scripts

add your script on target nodes.

edit snmpd.conf accordingly

restart snmpd

Run below command

# for i in `snmpwalk -v 2c -c TselSA 127.0.0.1 NET-SNMP-EXTEND-MIB::nsExtendObjects| grep "NET-SNMP-EXTEND-MIB::nsExtendOutLine." | cut -d "=" -f1`; do echo $i; echo "snmptranslate -On '$i'" >> a.sh ; done

NET-SNMP-EXTEND-MIB::nsExtendOutLine."OM_LATEST".1

NET-SNMP-EXTEND-MIB::nsExtendOutLine."OM_LATEST".2

NET-SNMP-EXTEND-MIB::nsExtendOutLine."OM_LATEST".3

NET-SNMP-EXTEND-MIB::nsExtendOutLine."OM_LATEST".4

NET-SNMP-EXTEND-MIB::nsExtendOutLine."billingApi".1

NET-SNMP-EXTEND-MIB::nsExtendOutLine."billingApi".2

NET-SNMP-EXTEND-MIB::nsExtendOutLine."billingApi".3

NET-SNMP-EXTEND-MIB::nsExtendOutLine."Erecharge_Session_JWT".1

# cat a.sh

snmptranslate -On 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."OM_LATEST".1'

snmptranslate -On 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."OM_LATEST".2'

snmptranslate -On 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."OM_LATEST".3'

snmptranslate -On 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."OM_LATEST".4'

snmptranslate -On 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."billingApi".1'

snmptranslate -On 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."billingApi".2'

snmptranslate -On 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."billingApi".3'

snmptranslate -On 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."Erecharge_Session_JWT".1'

# sh a.sh

.1.3.6.1.4.1.8072.1.3.2.4.1.2.9.79.77.95.76.65.84.69.83.84.1

.1.3.6.1.4.1.8072.1.3.2.4.1.2.9.79.77.95.76.65.84.69.83.84.2

.1.3.6.1.4.1.8072.1.3.2.4.1.2.9.79.77.95.76.65.84.69.83.84.3

.1.3.6.1.4.1.8072.1.3.2.4.1.2.9.79.77.95.76.65.84.69.83.84.4

.1.3.6.1.4.1.8072.1.3.2.4.1.2.10.98.105.108.108.105.110.103.65.112.105.1

.1.3.6.1.4.1.8072.1.3.2.4.1.2.10.98.105.108.108.105.110.103.65.112.105.2

.1.3.6.1.4.1.8072.1.3.2.4.1.2.10.98.105.108.108.105.110.103.65.112.105.3

.1.3.6.1.4.1.8072.1.3.2.4.1.2.21.69.114.101.99.104.97.114.103.101.95.83.101.115.115.105.111.110.95.74.87.84.1

Add above IOD to polling setting to monitor

No comments:

UNIX: How to print column nicely using printf

[user@hostfwnms1-oam tmp]# cat b.sh printf "%-26s %-19s %-8s %-8s %-s %-s\n" HOSTNAME IP PING SNMPWALK 0-ok 1-fail for i in `cat n...