Hi Guys,
I have currently working on a discovery rule which I am using to generate items dynamically, basically, these items are about interfaces and rx power associated to those interfaces, that is, each item is an interface name and the value is a numerical value, my discovery rule is working and the items are generated dynamically but the cpu of my monitored device (OLT ) is reaching 90% each time the snmp walk is executed, the high cpu is related to the scan of the oids for all the interface names which are above 500 interface names, the reason is a bad design of the SNMP agent on the device and a poor cpu capacity, so I'm trying to optimize my rule to avoid the impact my OLT performance.
I am using an item that through a walk[ 1.3.6.1.4.1.5504.5.14.1.7.1.4 , 1.3.6.1.2.1.2.2.1.2 ] is receiving rxpower and interface names, I pasted a sample of the info received in the table below.
The discovery rule is like this:
My idea to improve my discovery rule is to avoid scanning the interface names, the reason is that these oids always are constant values (string), I mean, these oids don't change on each SNMP walk so It's not necessary to scan all this interface names every 5 minutes, my idea is to use a custom script (javascript code ) that using an array help me to insert this oid values on the PREPROCESSING STEP before LLD MACROS step, I think maybe I can store this interface names(strings) on a data structure statically, and on this way, I can generate my JSON fields using this script, I appreciated if you can confirm me if this approach is feasible or if you could suggest me alternate ideas to get these interface names without scanning the device, thanks to those that can take your time to help me with ideas, greetings from Colombia folks.
Sample of data received with the SNMP walk.
I have currently working on a discovery rule which I am using to generate items dynamically, basically, these items are about interfaces and rx power associated to those interfaces, that is, each item is an interface name and the value is a numerical value, my discovery rule is working and the items are generated dynamically but the cpu of my monitored device (OLT ) is reaching 90% each time the snmp walk is executed, the high cpu is related to the scan of the oids for all the interface names which are above 500 interface names, the reason is a bad design of the SNMP agent on the device and a poor cpu capacity, so I'm trying to optimize my rule to avoid the impact my OLT performance.
I am using an item that through a walk[ 1.3.6.1.4.1.5504.5.14.1.7.1.4 , 1.3.6.1.2.1.2.2.1.2 ] is receiving rxpower and interface names, I pasted a sample of the info received in the table below.
The discovery rule is like this:
- PREPROCESSING : using snmp walk to json I created two fields
- field : rxpower oid prefix: 1.3.6.1.4.1.5504.5.14.1.7.1.4
- field : ifname oid prefix: 1.3.6.1.2.1.2.2.1.2
- LLD MACROS : using the previous json fields I generated two lld macros
- {#IFNOMBRE} : JsonPath $.ifname
- {#RXPOWER} : Json path $.rxpower
- Item prototype: with the previous LLD macros I generate dynamically my items one for each pair, for example [name item "1-1-1-1", value item -205],[name item "1-1-1-2", value -301],[name item "1-1-1-3", value -306]
My idea to improve my discovery rule is to avoid scanning the interface names, the reason is that these oids always are constant values (string), I mean, these oids don't change on each SNMP walk so It's not necessary to scan all this interface names every 5 minutes, my idea is to use a custom script (javascript code ) that using an array help me to insert this oid values on the PREPROCESSING STEP before LLD MACROS step, I think maybe I can store this interface names(strings) on a data structure statically, and on this way, I can generate my JSON fields using this script, I appreciated if you can confirm me if this approach is feasible or if you could suggest me alternate ideas to get these interface names without scanning the device, thanks to those that can take your time to help me with ideas, greetings from Colombia folks.
Sample of data received with the SNMP walk.
| interface names oids | rx power values for each interface |
| .1.3.6.1.2.1.2.2.1.2.31 = STRING: "1-1-1-1" .1.3.6.1.2.1.2.2.1.2.32 = STRING: "1-1-1-2" .1.3.6.1.2.1.2.2.1.2.33 = STRING: "1-1-1-3" .1.3.6.1.2.1.2.2.1.2.34 = STRING: "1-1-1-4" .1.3.6.1.2.1.2.2.1.2.35 = STRING: "1-1-1-5" .1.3.6.1.2.1.2.2.1.2.36 = STRING: "1-1-1-6" .1.3.6.1.2.1.2.2.1.2.37 = STRING: "1-1-1-7" .1.3.6.1.2.1.2.2.1.2.38 = STRING: "1-1-1-8" .1.3.6.1.2.1.2.2.1.2.39 = STRING: "1-1-1-9" .1.3.6.1.2.1.2.2.1.2.40 = STRING: "1-1-1-10" .1.3.6.1.2.1.2.2.1.2.41 = STRING: "1-1-1-11" |
.1.3.6.1.4.1.5504.5.14.1.7.1.4.31 = INTEGER: -205 .1.3.6.1.4.1.5504.5.14.1.7.1.4.32 = INTEGER: -301 .1.3.6.1.4.1.5504.5.14.1.7.1.4.33 = INTEGER: -306 .1.3.6.1.4.1.5504.5.14.1.7.1.4.34 = INTEGER: 0 .1.3.6.1.4.1.5504.5.14.1.7.1.4.35 = INTEGER: 0 .1.3.6.1.4.1.5504.5.14.1.7.1.4.36 = INTEGER: 0 .1.3.6.1.4.1.5504.5.14.1.7.1.4.37 = INTEGER: 0 .1.3.6.1.4.1.5504.5.14.1.7.1.4.38 = INTEGER: 0 .1.3.6.1.4.1.5504.5.14.1.7.1.4.39 = INTEGER: 0 .1.3.6.1.4.1.5504.5.14.1.7.1.4.40 = INTEGER: 0 .1.3.6.1.4.1.5504.5.14.1.7.1.4.41 = INTEGER: 0 |