Panduan Setup Prolink UPS di FreeBSD dengan Network UPS Tools (NUT)
Langkah-Langkah Setup Prolink UPS di FreeBSD dengan Auto Shutdown Battery 50%
Prolink UPS boleh dikawal dengan Network UPS Tools (NUT) di FreeBSD. Berikut adalah panduan setup penuh dari mula hingga auto shutdown apabila bateri UPS turun ke 50%.
1. Pasang NUT di FreeBSD
Jalankan perintah ini untuk install NUT:
pkg install nut
2. Edit fail /usr/local/etc/nut/ups.conf
[prolink]
driver = nutdrv_qx
port = auto
vendorid = 0665
productid = 5161
desc = "Prolink UPS"
3. Setup fail /usr/local/etc/nut/upsd.conf
LISTEN 127.0.0.1 3493
4. Setup fail /usr/local/etc/nut/upsd.users
(guna password rahsia
)
[monuser]
password = rahsia
upsmon master
actions = SET
instcmds = ALL
5. Setup fail /usr/local/etc/nut/upsmon.conf
untuk auto shutdown 50%
MONITOR prolink@localhost 1 monuser rahsia master
MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -p now"
NOTIFYCMD /usr/local/bin/upssched
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC
NOTIFYFLAG FSD SYSLOG+WALL+EXEC
RBWARNTIME 43200
NOCOMMWARNTIME 300
FINALDELAY 5
POWERDOWNFLAG /etc/killpower
LOWBATT 50
6. Buat skrip /usr/local/bin/upssched
untuk shutdown automatik
#!/bin/sh
case "$1" in
onbatt)
logger "UPS on battery"
;;
lowbatt)
logger "UPS battery low, shutting down now!"
/sbin/shutdown -p now
;;
*)
logger "UPS event $1"
;;
esac
Pastikan skrip ini boleh dijalankan:
chmod +x /usr/local/bin/upssched
7. Enable dan start servis NUT
echo 'nut_enable="YES"' >> /etc/rc.conf
echo 'nut_ups="prolink"' >> /etc/rc.conf
echo 'nut_user="nut"' >> /etc/rc.conf
echo 'nut_group="nut"' >> /etc/rc.conf
echo 'nutd_enable="YES"' >> /etc/rc.conf
service nut start
8. Semak status UPS
upsc prolink
Dengan konfigurasi ini, apabila bateri UPS turun ke 50%, skrip upssched
akan trigger shutdown automatik untuk selamatkan sistem anda.
Latest posts by Maui (see all)
- Setup Rangkaian Rumah Power User Guna FreeBSD, MikroTik & Peranti Pintar - June 22, 2025
- Panduan Setup Prolink UPS di FreeBSD dengan Network UPS Tools (NUT) - June 1, 2025
- Bad disk detached and I wonder why, why, why, why, why. - September 21, 2016
Bad disk detached and I wonder why, why, why, why, why. Setup Rangkaian Rumah Power User Guna FreeBSD, MikroTik & Peranti Pintar