What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Can I bit-wise mask values retrieved from an SNMP sensor?

Votes:

0

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.

bit-mask bitmask custom-sensor lookup prtg snmp

Created on Jun 20, 2012 4:32:39 PM

Last change on Nov 30, 2016 11:46:11 AM by  Luciano Lingnau [Paessler]



Best Answer

Accepted Answer

Votes:

2

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.

Battery Sensor Details

Click here to enlarge.

For more details and examples about lookups:




Best Regards,
Luciano Lingnau [Paessler Support]

Created on Nov 30, 2016 11:33:45 AM by  Luciano Lingnau [Paessler]

Last change on Jul 29, 2020 3:32:45 PM by  Luciano Lingnau [Paessler]



5 Replies

Votes:

0

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.

Created on Jun 21, 2012 2:28:55 PM



Votes:

0

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

Created on Jun 21, 2012 2:51:41 PM by  Konstantin Wolff [Paessler Support]



Votes:

0

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!

Created on May 27, 2013 11:42:41 AM



Votes:

0

This may be possible now, with Lookups. Please see the according manual chapter: PRTG Manual: Define Lookups.

Created on May 28, 2013 1:27:04 PM by  Torsten Lindner [Paessler Support]



Accepted Answer

Votes:

2

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.

Battery Sensor Details

Click here to enlarge.

For more details and examples about lookups:




Best Regards,
Luciano Lingnau [Paessler Support]

Created on Nov 30, 2016 11:33:45 AM by  Luciano Lingnau [Paessler]

Last change on Jul 29, 2020 3:32:45 PM by  Luciano Lingnau [Paessler]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.