Hello guys,

please help me create a .template file for PRTG Rest custom sensor. I want to monitor my UPS connected via USB to remote server. UPS (connected via USB) is managed by PowerPanel web app that offers interface to access JSON response containing the status info.

In my case the address of REST is http://192.168.0.60:3052/agent/ppbe.js/init_status.js and the response is:

var ppbeJsObj={"status":{"communicationAvaiable":true,"onlyPhaseArch":false,"utility":{"state":"Normal","stateWarning":false,"voltage":"238.0","frequency":null,"voltages":null,"currents":null,"frequencies":null,"powerFactors":null},"bypass":{"state":"Normal","stateWarning":false,"voltage":null,"current":null,"frequency":null,"voltages":null,"currents":null,"frequencies":null,"powerFactors":null},"output":{"state":"Normal","stateWarning":false,"voltage":"238.0","frequency":null,"load":15,"watt":64,"va":null,"current":null,"outputLoadWarning":false,"outlet1":null,"outlet2":null,"activePower":null,"apparentPower":null,"reactivePower":null,"voltages":null,"currents":null,"frequencies":null,"powerFactors":null,"loads":null,"activePowers":null,"apparentPowers":null,"reactivePowers":null,"emergencyOff":null,"batteryExhausted":null},"battery":{"state":"Normal, Fully Charged","stateWarning":false,"voltage":"134.0","capacity":100,"runtimeFormat":1,"modularUpsRuntimeZero":false,"runtimeFormatWarning":false,"runtimeHour":0,"runtimeMinute":38,"chargetimeFormat":null,"chargetimeHour":null,"chargetimeMinute":null,"temperatureCelsius":null,"highVoltage":null,"lowVoltage":null,"highCurrent":null,"lowCurrent":null},"upsSystem":{"state":"Normal","stateWarning":false,"temperatureCelsius":null,"temperatureFahrenheit":null,"maintenanceBreak":null,"systemFaultDueBypass":null,"systemFaultDueBypassFan":null,"originalHardwareFaultCode":""},"modules":null,"deviceId":0}};

In fact, looking at the response, it is not a JSON data. The response begins with the object definition "var ppbeJsObj =". Can this REST custom sensor handle? Is there some documentation of .template file syntax?


Article Comments

Hi Adampelikan,

Did you already take a look at this article. This article describes how to monitor UPS systems via PRTG.


Mar, 2020 - Permalink

Hi Moritz,

thanks for reply.

My UPS itself is not a network device. It is connected to computer via USB and on the computer there is a windows-based daemon running. Through this dameon the UPS can be accessed via network, but this daemon does not provide any SNMP. Therefore I think I can't use referenced article. The daemon only provides a web application and the endpoint returining the JSON object describing current state.

So I guess I really need to use the JSON custom sensor.

A.


Mar, 2020 - Permalink

Hi adampelikan,

Thank you for the clarification. In this case I recommend the REST Custom Sensor.

As a side note, please refer to the following article which explains why we can't really offer any customization help for PRTG: https://helpdesk.paessler.com/en/support/solutions/articles/76000065319-what-is-your-position-towards-customizing-the-prtg-web-interface


Mar, 2020 - Permalink