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

SNMP - monitor flags in 64bit response




I get OID with basic ups status represented by 64 flags in 64bit string:

5/15/2019 1:17:17 PM (68 ms) : = "0001010000000000001000000000000000000000000000000000000000000000" [ASN_OCTET_STR]

I want to monitor first five flags from left which means: Flag 1: Abnormal Condition Present Flag 2: On Battery Flag 3: Low Battery Flag 4: On Line Flag 5: Replace Battery

I created a SNMP Custom String Lookup Sensor and define custom lookup: <?xml version="1.0" encoding="UTF-8"?> <ValueLookup id="ups.bitmask" desiredValue="1" undefinedState="Warning" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PaeValueLookup.xsd"> <Lookups> <BitField state="Ok" value="1152921504606846976">On Line</BitField> <BitField state="Error" value="2305843009213693952">Low Battery</BitField> <BitField state="Error" value="4611686018427387904">On Battery</BitField> <BitField state="Error" value="9223372036854775808">Abnormal Condition Present</BitField> <BitField state="Error" value="576460752303423488">Replace Battery</BitField> </Lookups> </ValueLookup>

But when run the sensor I get error message:

The lookup "ups.bitmask" does not contain a definition for "0001010000000000001000000000000000000000000000000000000000000000"

So, I must define all of the 64 flags in lookup or there is other problem?

flag lookups snmp

Created on May 15, 2019 11:31:37 AM

1 Reply



Hi giemzaa,

Thank you for your post!

Your idea is very good, but I'm afraid this won't work the way you're expecting it to. Or at least, not in a practicable way. When working with the SNMP Custom String Lookup Sensor the value that PRTG reads from the device needs to be placed in the <SingleInt> node, not the <value> node. If you were to make a lookup for a string that represents 4 bits, it would look like this:

<?xml version="1.0" encoding="UTF-8"?>
<ValueLookup id="prtg.custom.string.progress" desiredValue="0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PaeValueLookup.xsd">
		<SingleInt state="Ok" value="0">0000</SingleInt>
		<SingleInt state="Warning" value="1">0001</SingleInt>
		<SingleInt state="Error" value="2">0010</SingleInt>
		<SingleInt state="Error" value="3">0011</SingleInt>
		<SingleInt state="Error" value="4">0100</SingleInt>
		<SingleInt state="Error" value="5">0101</SingleInt>

And this would actually work. However, for 4 bits you would need a total of 16 entries in the lookup to cover all possible combinations (the example below is incomplete). Part of the reason for this is that when working with this sensor, you need to use the lookup type SingleInt for this sensor. BitFields and ranges are not supported (as per the Manual).

Please keep in mind that the intended usage of the SNMP Custom String Lookup Sensor is evaluating a string, like for example:


For more details, please refer to:

In your case (since the string needs to precisely match what the device provides ("0001010000000000001000000000000000000000000000000000000000000000") your lookup would end-up having thousands of single-int entries, because each possibility needs to be covered by one entry, you can't evaluate only the first bits.

If the value was the actual corresponding integer (1441187065130647552 for example) then you could simply use the SNMP Custom or SNMP Custom Advanced sensors with a Bitmask Lookup, that would work like a charm. The problem is that currently PRTG doesn't provide the capability of converting the binary string to a decimal value.

As an workaround (Since you seem to be trying to monitor an APC UPS) I'd recommend you to use the template available below instead. It will create several sensors (instead of one) but it will allow you to monitor several aspects of your UPS:

Best Regards,
Moritz Heller
Technical Support Team

Created on May 16, 2019 10:24:12 AM by  Moritz Heller [Paessler Support]

Last change on May 16, 2019 11:56:41 AM 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.