Power Outage Monitor [Solved]

I have another location that sometimes loses power. If I'm not there, I would still like to know when/how often/how long power outages are. (There usually isn't much I can do about it - I'm just curious...)

I have seen that other Linux distributions have uptimed - this apparently tracks uptime/reboots, and displays them with the uprecords command.

Does anyone know of a similar facility for a LEDE/OpenWrt router? Thanks.

Doesn't collectd have an uptime plugin?

It has: https://lede-project.org/packages/pkgdata/collectd-mod-uptime

I have munin lite going but that's not self contained

Thanks to @tmomas, it appears that collectd and the luci-app-statistics will answer my question. I used the LuCI GUI to install:

  • collectd
  • collectd-mod-uptime
  • luci-app-statistics

The latter adds a new "Statistics" menu. I didn't record the steps carefully, but it's pretty obvious how to configure it to monitor uptime.

The LuCI statistics page shows RRD charts of whatever you're graphing. The Uptime graph shows the uptime value (number of seconds since boot) increasing over time. When the router reboots, uptime drops to zero, then starts increasing again. You get a sawtooth graph, with drops showing when outages occurred.

Update: By default, luci-app-statistics keeps its stats in /tmp/rrd. This works fine, but you lose all the stats in a reboot. There is a howto on the wiki that describes how to save the stats on a USB drive, or other ways to preserve the data.

I did not investigate uptimed or munin, since collectd does what I need it to do. Thanks all!

Just note that by default the collectd database is stored on ramdisk, so you need to either config it to be saved on flash or USB stick, or use the network plugin to store the data on a remote router.

1 Like

Yes, as the reboot of my router showed - no data! :slight_smile:

I will do more research and update my note above. Thanks.