Hello Marco,
thank you for the clarification.
In this case, the OID returns a numerical value which you want to map to a Status and String. This is the typical/ideal use-case for Lookups:
Just as intro, the MIB's documentation:
1.3.6.1.4.1.318.1.1.1.3.2.5.0 (ups adv input line fail cause) |
The reason for the occurrence of the last transfer to UPS battery power. The variable is set to: - noTransfer(1) -- if there is no transfer yet. - highLineVoltage(2) -- if the transfer to battery is caused by an over voltage greater than the high transfer voltage. - brownout(3) -- if the duration of the outage is greater than five seconds and the line voltage is between 40% of the rated output voltage and the low transfer voltage. - blackout(4) -- if the duration of the outage is greater than five seconds and the line voltage is between 40% of the rated output voltage and ground. - smallMomentarySag(5) -- if the duration of the outage is less than five seconds and the line voltage is between 40% of the rated output voltage and the low transfer voltage. - deepMomentarySag(6) -- if the duration of the outage is less than five seconds and the line voltage is between 40% of the rated output voltage and ground. The variable is set to - smallMomentarySpike(7) -- if the line failure is caused by a rate of change of input voltage less than ten volts per cycle. - largeMomentarySpike(8) -- if the line failure is caused by a rate of change of input voltage greater than ten volts per cycle. - selfTest(9) -- if the UPS was commanded to do a self test. - rateOfVoltageChange(10) -- if the failure is due to the rate of change of the line voltage. |
When importing the PowerNet-MIB this lookup will be created automatically by the SNMP Library Sensor during the import. It's also possible to manually create the lookup (for use with the Custom SNMP Sensor(s)) as described below:
1. Head to C:\Program Files (x86)\PRTG Network Monitor\lookups on your Core Server.
2. Copy one of the standard lookups (e.g. prtg.standardlookups.businessprocess.state.ovl) to the \custom\ subfolder, we'll use this file for reference.
3. Rename the file to your liking, e.g. prtg.customlookups.apc.failcause.ovl.
4. Open the copied file (in the \custom folder) with a text editor (the file is XML-like). Modify the id="prtg.standardlookups.businessprocess.state" to match the new file name e.g. id="prtg.customlookups.apc.failcause"
5. Modify the rest of the file to match the error codes and text returned by the APC OID/MIB, complying with the syntax of the original file. The end result should look like the following:
<?xml version="1.0" encoding="UTF-8"?>
<ValueLookup id="prtg.customlookups.apc.failcause" desiredValue="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PaeValueLookup.xsd" undefinedState="Warning">
<Lookups>
<SingleInt state="Ok" value="1">No Events</SingleInt>
<SingleInt state="Error" value="2">High line voltage</SingleInt>
<SingleInt state="Error" value="3">Brownout</SingleInt>
<SingleInt state="Error" value="4">Loss of mains power</SingleInt>
<SingleInt state="Warning" value="5">Small temporary power drop</SingleInt>
<SingleInt state="Error" value="6">Large temporary power drop</SingleInt>
<SingleInt state="Warning" value="7">Small spike</SingleInt>
<SingleInt state="Error" value="8">Large spike</SingleInt>
<SingleInt state="Ok" value="9">UPS self test</SingleInt>
<SingleInt state="Error" value="10">Excessive input voltage fluctuation</SingleInt>
</Lookups>
</ValueLookup>
This will map different states to different messages ("No Events", "High line voltage", etc) to different sensor states (Ok, Warning, Error). The desiredValue="1" impacts the sensor's averaging for Historic Data, it should be set to the "most common/desired" value for the sensor. The undefinedState="Warning" defines what state the sensor should have if the value doesn't match any of the defined states (e.g. if a value of 11 is received).
6. With the file stored and saved, head to Setup > Administrative Tools and perform a re-load lookups operation to make sure that PRTG has loaded the newly created lookup.
7. Within the Value channel of your newly created SNMP Custom Sensor (for OID 1.3.6.1.4.1.318.1.1.1.3.2.5.0) switch the Value Lookup from none to the newly created lookup (prtg.customlookups.apc.failcause). The sensor will now have it's status updated accordingly to the received value.
For further information regarding lookups:
Other SNMP-related topics:
Best Regards,
Luciano Lingnau [Paessler Support]
Add comment