Watchdog for the unreliable nut-driver on the Raspberry Pi

nut-watcher

For some reason, nut-driver on the Raspberry Pi likes to break. Every few days it stalls out trying to talk to my UPS. nut-watcher is a simple Go service that polls the driver and if it fails to poll 3 times in a row, it instructs systemd to restart nut-driver.service.

Building

To build for a raspberry pi:

GOOS=linux GOARCH=arm64 go build -o nut-watcher -v main.go

An example systemd unit:

[Unit]
Description=Network UPS Tools Watchdog
After=network.target nut-server.service nut-driver.service nut-monitor.service

[Service]
Environment=NUT_EXPORTER_PASSWORD=***
ExecStart=/usr/local/bin/nut-watcher --username=***
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target
Owner
Nathan Lowe
SRE for Starlink at SpaceX. Linux and Open Source enthusiast. I also like technical theater! Opinions are my own.
Nathan Lowe
Similar Resources

Git watchdog will scan your public repository and find out the vulnerabilities

Dependencies Docker Go 1.17 MySQL 8.0.25 Bootstrap Run chmod +x start.sh if start.sh script does not have privileged to run Run ./start.sh --bootstrap

Dec 30, 2021

A watchdog for Kubernetes rolebindings. Barks (Slack notifications) when something is happening on your front porch.

A watchdog for Kubernetes rolebindings. Barks (Slack notifications) when something is happening on your front porch.

Cave canem - Beware of the dog A fun little application that acts as a watchdog for Kubernetes rolebindings. If something happens on the front porch i

Jan 7, 2023

Go-redisson: A redisson like distributed redis lock, support watchdog、reentrant lock

go-redisson a Redisson like distributed locking implementation using Redis. Installation go get github.com/cheerego/go-redisson Lock Category Mutex Ex

Dec 17, 2022

Go-watchdog - a web application observability tool built for Go

Go-watchdog - a web application observability tool built for Go

Go-watchdog is a web application observability tool built for Go, it exposes a status endpoint for application services like databases, caches, message-brokers, mails and storages.

Jul 11, 2022

Go MySQL Driver is a MySQL driver for Go's (golang) database/sql package

Go-MySQL-Driver A MySQL-Driver for Go's database/sql package Features Requirements Installation Usage DSN (Data Source Name) Password Protocol Address

Jan 4, 2023

Qmgo - The Go driver for MongoDB. It‘s based on official mongo-go-driver but easier to use like Mgo.

Qmgo English | 简体中文 Qmgo is a Go driver for MongoDB . It is based on MongoDB official driver, but easier to use like mgo (such as the chain call). Qmg

Dec 28, 2022

Go driver for PostgreSQL over SSH. This driver can connect to postgres on a server via SSH using the local ssh-agent, password, or private-key.

pqssh Go driver for PostgreSQL over SSH. This driver can connect to postgres on a server via SSH using the local ssh-agent, password, or private-key.

Nov 6, 2022

Devcloud-go provides a sql-driver for mysql which named devspore driver and a redis client which named devspore client,

Devcloud-go Devcloud-go provides a sql-driver for mysql which named devspore driver and a redis client which named devspore client, you can use them w

Jun 9, 2022

Hexagonal architecture paradigms, such as dividing adapters into primary (driver) and secondary (driven)Hexagonal architecture paradigms, such as dividing adapters into primary (driver) and secondary (driven)

authorizer Architecture In this project, I tried to apply hexagonal architecture paradigms, such as dividing adapters into primary (driver) and second

Dec 7, 2021

The Container Storage Interface (CSI) Driver for Fortress Block Storage This driver allows you to use Fortress Block Storage with your container orchestrator

fortress-csi The Container Storage Interface (CSI) Driver for Fortress Block Storage This driver allows you to use Fortress Block Storage with your co

Jan 23, 2022

Go-driver-benchmark - Driver benchmark with golang

We use ClickkHouse for time-series databases, and the driver's performance is ve

Sep 5, 2022

Test-csi-driver - Amazon Elastic Block Store (EBS) CSI driver

Amazon Elastic Block Store (EBS) CSI driver Overview The Amazon Elastic Block St

Feb 1, 2022

Go/TinyGo driver for Lumissil IS31FL3731 matrix LED driver

Go/TinyGo driver for Lumissil IS31FL3731 matrix LED driver

IS31FL3731 Go/TinyGo driver for Lumissil IS31FL3731 matrix LED driver. PR to include this driver to the official TinyGo driver list What's implemented

Feb 6, 2022

Nomad-driver-await-dependency - A Nomad driver that acts as blocker for subsequent task until a given Consul service has reached a given state

Nomad Skeleton Driver Plugin Skeleton project for Nomad task driver plugins. Thi

Feb 12, 2022

Qt binding for Go (Golang) with support for Windows / macOS / Linux / FreeBSD / Android / iOS / Sailfish OS / Raspberry Pi / AsteroidOS / Ubuntu Touch / JavaScript / WebAssembly

Introduction Qt is a free and open-source widget toolkit for creating graphical user interfaces as well as cross-platform applications that run on var

Jan 2, 2023

Raspberry Pi terminal based activity monitor

Raspberry Pi terminal based activity monitor

pitop Raspberry Pi terminal based activity monitor Yes I know there are plenty of solutions already available, but I wanted to build my own terminal b

Dec 11, 2022

Network scanner for Raspberry Pi

Network scanner for Raspberry Pi

╔═╗╦═╗╔═╗╦ ╠═╣╠╦╝╠═╝║ ╩ ╩╩╚═╩ ╩ Basic network scanner for Raspberry Pi Install Note: Prebuilt binaries (32-bit) doesn't require Go. Prereq

Jun 13, 2022

fbstatus graphically shows the gokrazy system status on the Linux frame buffer, which is typically available via HDMI when running on a Raspberry Pi or a PC.

fbstatus graphically shows the gokrazy system status on the Linux frame buffer, which is typically available via HDMI when running on a Raspberry Pi or a PC.

gokrazy framebuffer status (fbstatus) fbstatus graphically shows the gokrazy system status on the Linux frame buffer, which is typically available via

Aug 4, 2022

Raspberry Pi Archlinux Automated Offline Installer with Wi-Fi. Windows, Mac and more features coming.

Raspberry Pi Archlinux Automated Offline Installer with Wi-Fi. Windows, Mac and more features coming.

Raspberry Pi Archlinux Automated Installer with Wi-Fi. Windows, Mac and more features coming. Download Go to releases page and download the zip file f

Nov 22, 2022
An experimental vulkan 3d engine for linux (raspberry 4)

protomatter an experimental vulkan 3d engine for linux (raspberry 4).

Nov 14, 2021
Some plain Go/Golang i2c sensor bindings to Waveshare Sense HAT for raspberry pi

i2c some plain Go/Golang i2c sensor bindings to Waveshare Sense HAT for raspberry pi using https://periph.io Supported hardware: Raspberry Zero W 1 ht

Dec 31, 2021
Raspberry Pi alarm clock for childs, to let them know whether they can wake up or stay in bed

Miveil Raspberry Pi alarm clock for childs, to let them know whether they can wake up or stay in bed. The idea was to have a simple device that let my

Apr 14, 2022
A simple LCD controller package for raspberry pi liquid crystal I²C displays.

A simple LCD controller package for raspberry pi liquid crystal I²C displays.

Nov 1, 2022
Sensirion SCD30 CO2 sensor i2c driver module for Golang

Sensirion SCD30 CO2 sensor i2c driver module for Golang Overview With this module Sensirion SCD30 CO2 sensor can be accessed throug i2c bus. Implement

Oct 9, 2022
A go driver for the adafruit I2C 7 Segment display

A go driver for the adafruit I2C 7 Segment display

Nov 21, 2021
Nut is a tool to manage versioned Go source code packages, called "nuts".

nut Nut is a tool to manage versioned Go source code packages, called "nuts". gonuts.io – central repository (source code) Documents Stable API Mailin

Jul 15, 2021
UDP Transport: compress, encrypt and send any data reliably over unreliable UDP connections

udpt UDP Transport Compresses, encrypts and transfers data between a sender and receiver using UDP protocol. Features and Design Aims: Avoid the overh

Nov 5, 2022
Slow and unreliable JSON parser generator (in progress)

VivaceJSON Fast and reliable JSON parser generator Todo List parse fields parse types generate struct generate (keypath+key) to struct Value Mapping F

Nov 26, 2022
A realtime teenage driver behaviour monitoring system integrating OBII sensor, smart watch, smartphone, and Raspberry Pi, which examines over time novice teenage driving performance and risk

DriverMonitor A realtime teenage driver behaviour monitoring system integrating OBII sensor, smart watch, smartphone, and Raspberry Pi, which examines

Nov 27, 2021