Use Gotify with NUT Server

📆 2024-07-08 13:43

We setup Nut Server and Gotify in our home lab:

🔌 Installing and configuring NUT (Network UPS Tools) for your home lab

Gotify - Get notifications about everything on your phone

It's time to mix them together and get notified by Gotify whenever something happens with the UPS. This tutorial applies if you followed the tutorials linked above. If you have another NUT setup make sure to adapt to it.

Sending Gotify notifications from NUT server is a very simple process. All you have to do is to edit /bin/upssched-cmd.

Let's create the function to send notifications via Gotify. Add to /bin/upssched-cmd:

At the bottom of the file make sure to call the function.

What this does

If the title and message parameters are present the function will execute the curl command. If you now edit a case in /bin/upssched-cmd and add the title and message parameters like:

/bin/upssched-cmd will trigger the gotify notification if the UPS is on battery power.

Here's the full script from the connected PC to the UPS

You can also find the full config for NUT server and client on my GitHub repository:

Nut Config on GitHub/SavaAlexandruStefan

🚶 Back to my blog

The page https://sava.rocks/blog/use-gotify-with-nut-server/ is served from my cluster by tiny and available on 2 other protocols:
Gemini:
gemini://sava.rocks/blog/use-gotify-with-nut-server/
Gopher:
gopher://sava.rocks/1/blog/use-gotify-with-nut-server/
How can you reach these protocols ?
It's simple. Details are found here for gopher and here for gemini on Wikipedia.
Website Meta
text/gemini
Mastodon