Hello, Im trying to make a template that would walk CISCO-ENTITY-SENSOR-MIB and create items monitoring Transceiver Receive/Transmit Power Sensor values.
There are two important tables in the MIB:
1) 1.3.6.1.4.1.9.9.91.1.1.1 (entSensorValueTable)
2) 1.3.6.1.4.1.9.9.91.1.2.1 (entSensorThresholdTable)
Also I need to walk ENTITY-MIB to know which interface/sensor Im getting values of - im using 1.3.6.1.2.1.47.1.1.1.1.2 (entPhysicalDescr).
The catch is that not for every transceiver the entSensorThresholdTable is populated. In fact for most devices in our network from some reason there are no values in the MIB despite the device lists CISCO-ENTITY-SENSOR-MIB as supported. My goal is to create items related to this MIB only if the table is populated (which means that the macros exist and is not empty).
To get an idea, here is how it looks for one interface/optical sensor.
...
{"{#SNMPINDEX}":"300003533","{#ENTPHYSICALDESCR }": "Ethernet1/3 Lane 1 Transceiver Receive Power Sensor"}
,{"{#SNMPINDEX}":"300003533.1","{#ENTSENSORTHRESHO LDVALUE}":"5399"}
,{"{#SNMPINDEX}":"300003533.2","{#ENTSENSORTHRESHO LDVALUE}":"2399"}
,{"{#SNMPINDEX}":"300003533.3","{#ENTSENSORTHRESHO LDVALUE}":"-13306"}
,{"{#SNMPINDEX}":"300003533.4","{#ENTSENSORTHRESHO LDVALUE}":"-10301"}
...
I did as advised in https://www.zabbix.com/documentation...snmp_oids_walk so created one item with walk[1.3.6.1.2.1.47.1.1.1.1.2,1.3.6.1.4.1.9.9.91.1.2.1. 1.4] and then discovery rule as a dependent item with SNMP walk to JSON to fill those macros used above (see attached pics)
The issue is that while for macro {#ENTPHYSICALDESCR} I get {#SNMPINDEX} of 300003533, for the {#ENTSENSORTHRESHOLDVALUE} I get four different indexes with appended .1-.4
Therefor when I create item prototype with
Name: "{#SNMPINDEX} entSensorThresholdValue"
and
SNMP OID: "1.3.6.1.4.1.9.9.91.1.2.1.1.4.{#SNMPINDEX}"
I get an error that macro {#ENTPHYSICALDESCR} doesnt exist - because the {#SNMPINDEX} is 300003533.x. Im looking for a way how to remove the last digit and dot from the {#SNMPINDEX} macro.
Can anyone point me in the right direction, please? I thought I might try to use additional preprocessing step .regsub but couldnt get it working.
There are two important tables in the MIB:
1) 1.3.6.1.4.1.9.9.91.1.1.1 (entSensorValueTable)
2) 1.3.6.1.4.1.9.9.91.1.2.1 (entSensorThresholdTable)
Also I need to walk ENTITY-MIB to know which interface/sensor Im getting values of - im using 1.3.6.1.2.1.47.1.1.1.1.2 (entPhysicalDescr).
The catch is that not for every transceiver the entSensorThresholdTable is populated. In fact for most devices in our network from some reason there are no values in the MIB despite the device lists CISCO-ENTITY-SENSOR-MIB as supported. My goal is to create items related to this MIB only if the table is populated (which means that the macros exist and is not empty).
To get an idea, here is how it looks for one interface/optical sensor.
...
{"{#SNMPINDEX}":"300003533","{#ENTPHYSICALDESCR }": "Ethernet1/3 Lane 1 Transceiver Receive Power Sensor"}
,{"{#SNMPINDEX}":"300003533.1","{#ENTSENSORTHRESHO LDVALUE}":"5399"}
,{"{#SNMPINDEX}":"300003533.2","{#ENTSENSORTHRESHO LDVALUE}":"2399"}
,{"{#SNMPINDEX}":"300003533.3","{#ENTSENSORTHRESHO LDVALUE}":"-13306"}
,{"{#SNMPINDEX}":"300003533.4","{#ENTSENSORTHRESHO LDVALUE}":"-10301"}
...
I did as advised in https://www.zabbix.com/documentation...snmp_oids_walk so created one item with walk[1.3.6.1.2.1.47.1.1.1.1.2,1.3.6.1.4.1.9.9.91.1.2.1. 1.4] and then discovery rule as a dependent item with SNMP walk to JSON to fill those macros used above (see attached pics)
The issue is that while for macro {#ENTPHYSICALDESCR} I get {#SNMPINDEX} of 300003533, for the {#ENTSENSORTHRESHOLDVALUE} I get four different indexes with appended .1-.4
Therefor when I create item prototype with
Name: "{#SNMPINDEX} entSensorThresholdValue"
and
SNMP OID: "1.3.6.1.4.1.9.9.91.1.2.1.1.4.{#SNMPINDEX}"
I get an error that macro {#ENTPHYSICALDESCR} doesnt exist - because the {#SNMPINDEX} is 300003533.x. Im looking for a way how to remove the last digit and dot from the {#SNMPINDEX} macro.
Can anyone point me in the right direction, please? I thought I might try to use additional preprocessing step .regsub but couldnt get it working.
.
Comment