I have some SNMP sensors that retrieve an integer value that represents a bit field of possible states. I only care about one of the bits in the returned value, but can't figure out a way to monitor for that single bit to be true.
Ideally, what I would like is to be able to bit-wise AND the returned value with a mask so that the sensor stores either a 0 or a 1 (similar in function to the multiply or divide that is currently possible).
For example, if I only care about the 2nd least-significant bit in the returned value, I would like to know that any of the following return values have that bit set to a '1':
22 = 00010110 & 00000010 = 1 83 = 01010011 & 00000010 = 1 80 = 01010000 & 00000010 = 0
I hope that explains what I am trying to accomplish.
Article Comments
Hi,
I will forward your request to our developers and also put it on the wishlist for upcoming releases. But please understand that I cannot guarantee if or when it will be implmented.
Best regards
Jun, 2012 - Permalink
Hi! Is this request still pending?
I too would like to have this option available because it would enable PRTG to monitor the alerts generated by Ricoh printers and MFP's of all our customers.
Can Paessler please take this into consideration? Thanks in advance!
May, 2013 - Permalink
This may be possible now, with Lookups. Please see the according manual chapter: PRTG Manual: Define Lookups.
May, 2013 - Permalink
This is currently possible, via Lookups:
Please beware however that this will only be possible for devices which report the numerical value as an Integer. If the device reports the bitmask using a different SNMP Datatype (for example [HEX_STRING] which is fairly common) it will NOT WORK because PRTG can't decode the HEX-Encoded string.
Assuming that you want/need to monitor the dsx1LineStatus from the DS1-MIB, this is how the bit-mask lookup will look like:
<?xml version="1.0" encoding="UTF-8"?> <ValueLookup id="prtg.customlookups.bitmask" desiredValue="1" undefinedState="Warning"> <Lookups> <BitField state="Ok" value="1">No Alarm</BitField> <BitField state="Warning" value="2">Far end LOF</BitField> <BitField state="Warning" value="4">Near end sending LOF Indication</BitField> <BitField state="Warning" value="8">Far end sending AIS</BitField> <BitField state="Warning" value="16">Near end sending AIS</BitField> <BitField state="Error" value="32">Near end LOF </BitField> <BitField state="Error" value="64">Near end Loss Of Signal</BitField> <BitField state="Error" value="128">Near end is looped</BitField> <BitField state="Error" value="256">E1 TS16 AIS</BitField> <BitField state="Error" value="512">Far End Sending TS16 LOMF</BitField> <BitField state="Error" value="1024">Near End Sending TS16 LOMF</BitField> <BitField state="Error" value="2048">Near End detects a test code</BitField> <BitField state="Error" value="4096">Any line status not defined here</BitField> <BitField state="Error" value="8192">Near End in Unavailable Signal State</BitField> <BitField state="Error" value="16384">Carrier Equipment Out of Service</BitField> <BitField state="Error" value="32768">DS2 Payload AIS</BitField> <BitField state="Error" value="65536">DS2 Performance Threshold Exceeded</BitField> </Lookups> </ValueLookup>
When there are conflicting statuses, for instance when using the lookup above, the value is 40 (8 (Warn.)+ 32(Error)), the sensor will go into Error(Down). The "worst" state will prevail. Below is a screenshot of the outcome for reference.
For more details and examples about lookups:
- PRTG Manual: Define Lookups
- KB: Value interpretation (aka Lookups)
- KB: Monitor and "Lookup" a SNMP String value
- KB: APC UPS SNMP Battery Replace Sensor
- KB: Custom value lookup range
Best Regards,
Luciano Lingnau [Paessler Support]
Nov, 2016 - Permalink
Can a feature be requested to add this feature?
A possible alternative would be to add '&' (bit-wise AND) to the Factory Sensor formula grammar.
Jun, 2012 - Permalink