Hi,
My data in Influx comes from LibreNMS, which is polling devices for uptime every 5 minutes. The uptime is stored in seconds. I want to get an uptime percentage per month.
E.g.
- Device is up for 30 days (or goes down and comes back up immediately), percentage=100%.
The way I currently have it setup, it will go down to 0% everytime the device goes down and start counting again.
Current config using InfluxQL:
SELECT mean("uptime") / 2592000
FROM "uptime"
WHERE ("hostname" = '10.237.150.20') AND $timeFilter
GROUP BY time($__interval) fill(null)
An idea I’ve had to fix this;
- Get a count of everytime the uptime goes to 0, the count increases every 300s (5min) and minuses from the total seconds per month (2592000)
- I dont know if that will work.
- I’m not very familiar with Flux but am happy to have a go.
I am making these graphs in Grafana but I can test in InfluxQL/Flux and make changes to suite Grafana.
Do you have any advice or queries I should try for this?
Thanks,
Arno.