Tuesday, December 8, 2015

Linux pc (arch) as slave to synology NAS that's connected to a UPS with USB

My synology NAS is connected to my UPS with USB. I want my linux pc to listen for UPS events and shut down when the power is low.

Step 1 - Set up UPS daemon the on the synology nas

192.168.1.148 is the IP of my PC.



Step 2  - Install network-ups-tools

https://aur4.archlinux.org/packages/network-ups-tools/

In my case it was
$aura -A network-ups-tools


Step 3 - Configure network ups tools client.

First I got the password from the synology ups daemon.
 $ ssh root@nas1
$ DS212J> cat /usr/syno/etc/ups/upsd.users

In my case it was:

[monuser]
password = secret
upsmon master

Second add the credentials to /etc/ups/upsmon.conf

For me it ended up being

MONITOR ups@192.168.1.69:3493 1 monuser secret slave
Step 4 - Enable the nut-monitor

sudo systemctl daemon-reload
sudo systemctl enable nut-monitor
sudo systemctl start nut-monitor

Step 5 - Test

$ sudo systemctl status nut-monitor

Dec 08 20:01:31 buggle upsmon[17335]: UPS ups@192.168.1.69:3493 on battery
Dec 08 20:02:01 buggle upsmon[17335]: UPS ups@192.168.1.69:3493 on line power
Dec 08 20:04:41 buggle upsmon[17335]: UPS ups@192.168.1.69:3493 battery is low

Step 6 - WalNUT

I installed https://github.com/zykh/walNUT to get some status in gnome shell.


1.) mkdir ~/.local/share/gnome-shell/extensions
2.) cd ~/.local/share/gnome-shell/extensions3.) git clone --depth 1 https://github.com/zykh/walNUT.git walnut@networkupstools

4.) glib-compile-schemas walnut@networkupstools/schemas/
5.) alt+f2 r (restart shell)
6.) Use gnome web browser to go to extensions.gnome.org
7.) Enable the extension.
8.) Click the magnifying glass and put in 192.168.1.69:3493 (ip of nas).

No comments:

Post a Comment