I want to set up a watchdog process to keep checking if my ups (pi_ups) is reachable. Something is causing the nut-server to die and the restart script doesn't work but stopping and starting it does.> Broadcast message from nut at gw (somewhere) (Mon Jul 23 21:27:05 2018): > > UPS pi_ups at localhost is unavailable > $ upsc -l > Init SSL without certificate database > Error while connecting to localhost, disconnect > Error: Server disconnected > $ sudo /etc/init.d/nut-server restart > [....] Restarting nut-server (via systemctl): nut-server.serviceJob for nut-server.service failed because a timeout was exceeded. > See "systemctl status nut-server.service" and "journalctl -xe" for details. > failed! > > Broadcast message from nut at gw (somewhere) (Mon Jul 23 21:37:12 2018): > > UPS pi_ups at localhost is unavailable > > ^C > $ sudo /etc/init.d/nut-server stop > [ ok ] Stopping nut-server (via systemctl): nut-server.service. > $ sudo /etc/init.d/nut-server start > [ ok ] Starting nut-server (via systemctl): nut-server.service. > $ upsc -l > Init SSL without certificate database > > Broadcast message from nut at gw (somewhere) (Mon Jul 23 21:38:27 2018): > > Communications with UPS pi_ups at localhost established > > pi_ups-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20180725/a56c616e/attachment.html>
On Wed, 25 Jul 2018, James wrote:> I want to set up a watchdog process to keep checking if my ups (pi_ups) > is reachable.There is a detailed description of an end-to-end heartbeat mechanism in chapter 6 of http://rogerprice.org/NUT/ConfigExamples.A5.pdf Alternatively you could run a cron job every 5 minutes which attempts the command upsc pi_ups battery.charge 2>/dev/null and looks at the result. Roger