Does anyone use PRTG?

I found PRTG about a month before open hab. It’s really a ticketing & server monitoring system but I have it easily monitoring my greenhouse and a few other things. It can do things like send a http push notification when a sensor goes to a warning/error state.

Whilst I know OpenHab supports graphs and sensors like this quite nicely, prtg just takes it to the next level (And supports things like server monitoring, traffic analysis etc).

So I was wondering, is anyone else using PRTG in combination with OpenHab?

I have used PRTG before and was just checking the limitations with the free edition. But now it 100 sensors which seems enough. Before it was only 10 sensors. How do you monitor the data in prtg ? is that with the rest value ? MQTT ?

I use the rest api, and have a small javascript transform script that extracts the required value (and fixes a silly bug in the rest api).

Can you share how you set it up with the transform file ? No rush i cannot do the PRTG config until tomorrow evening, but interested in setting this up. And there is no need for me to reinvent the wheel.

Thanks in advance.

no probs at all, I’ll pull it up here tonight.

So I register the http uri in the config:

http:Greenhouse.url=http://prtgserver/api/table.json?id=2247&content=channels&output=json&columns=name,lastvalue_&username=prtgadmin&passhash=pwdhash
http:Greenhouse.updateInterval=60000

You will need to get your own password hash using this uri: https://prtg_hostname_or_ip_address/api/getpasshash.htm?username=myuser&password=mypass

Now you can add an item as follows:

Number Greenhouse_Light “Light [%.1f %%]” (greenhouse) {http="<[Greenhouse:60000:JS(getGreenhouseLight.JS)]" }

And my transform looks like this:

var channel=2;
(function(i) {
var value = (JSON.parse(i).channels[channel].lastvalue_raw + “”).replace(“0.”,".");
var result = parseFloat(value);
if(value.indexOf(".")==-1)
{
result = result/10;
}
return result;
})(input)

You would only use that transform on a float. simply set the correct channel and it should work. The reason it’s needed is because for some reason the rest api mangles numbers in the following way:

1 = 10
1.1 = 10.1
1.2 = 10.2

I have no idea why it’s not been fixed yet, but that transform fixes it.

Let me know what you do with it!

Thank you for posting your config. This is actually the other way around then i thought you meant. You are using PRTG (api) as source for an Openhab item. I was thinking the other way around. I want to use the graphing and analysis of PRTG by feeding PRTG openhab data from REST.

I have most of my sensors in Openhab with Arduino (Mysensors). Currently i am struggling with the MQTT gateway instead of serial. But later i will use your ‘binding’ to check the status of my internet connection.

How did you get your Greenhouse data into PRTG ? what sensor(s) do you use ?

I have an arduino outputting data as rest. Just using a custom sensor that can take in the channels. Works really well.