FreeBSD determine if reboot was due to power loss

freebsdpower-supply-unittruenasups

We are running FreeNAS (which is built on FreeBSD) to run our data storage systems. It is running on an APC Smart-UPS 750VA X.

On a couple of occasions, I have been alerted to the fact that the server is down by our monitoring systems. After a few minutes the server is back up and running no problems.

When I run last I can see that the server has just booted and checking /var/log/messages I can see it has run through all of the boot process however I can't see any panics or any reason for it shutting down. It literally goes from being fine to outputting boot information.

So this has led me to wonder if its a power outage that is causing this to happen but how can I determine for sure this is the case? I guess getting an interactive card for the APC UPS and hooking it up to the network would be one way… Any other way of me finding out right now why this has happened?

Best Answer

I think there are a few obvious solutions to finding out more:

  • Hook up an additional device to the same UPS output. If both devices reboot simultaneously, that would be evidence of a power issue.
  • Hook up some equipment that can monitor the actual voltage output by the UPS output and record changes over time.