Device Group Reports

HI,
I’ve got a few hundred devices in Libre, sorted into device groups for different sites.

I need a way to report availability on a device group basis, so Group 1 98% availability, Group 2 100% availability, etc, for the past month…. I know each device reports, it, but that would mean looking at each device and trying to work out the group availability, which is a very manual process.
Is there any way to pull the availability from a group? As I’m now required to report on it each month.

Thanks,

There is no option from web interface, if you have access to CLI and database, can use below query

SELECT
AVG(availability.availability_perc) AS average_availability,
device_groups.name AS device_group_name
FROM availability
JOIN devices ON availability.device_id = devices.device_id
JOIN device_group_device ON devices.device_id = device_group_device.device_id
JOIN device_groups ON device_groups.id = device_group_device.device_group_id
WHERE availability.duration = 2592000
GROUP BY device_groups.name;

Example:

1 Like

Thank you! This was something I was also looking for. Is there a repository of common queries to produce reports such as this?

Perfect, that’s exactly what I need.
Thanks

No , there is no such repository.

@RR1 Just another question, is it possiable to report on a date range, instead of duration? so instead of "WHERE availability.duration = 2592000 " I can enter a date range like the 1-31 April?

Looking at the DB table availability, the data looks to be pre made, and the query is just outputting it, not searchable VIA a date range.,

±----------------±----------±---------±------------------+
| availability_id | device_id | duration | availability_perc |
±----------------±----------±---------±------------------+
| 1 | 1 | 86400 | 100.000000 |
| 2 | 1 | 604800 | 100.000000 |
| 3 | 1 | 2592000 | 100.000000 |
| 4 | 1 | 31536000 | 100.000000 |
| 5 | 31 | 86400 | 100.000000 |
| 6 | 31 | 604800 | 100.000000 |
| 7 | 31 | 2592000 | 100.000000 |
| 8 | 31 | 31536000 | 99.955000 |

It would be great to have a Group availability on this page, when view availability for device, but also as a total for the entire group, that is easy searchable.

if want to search using data range, need to fetch details from rrdfiles using ‘rrdtool fetch’ command.

i have limited knowledge on that

in the graph, you can click on show command , it will show the command how it is extracting the data from rrd files