Azmawee 127.0.0.1

"Mauiwagen. Das Server." – pub 4096R/712DAA69

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Azmawee 127.0.0.1
MaUi^ - pub 4096R/712DAA69
Fingerprint 8BF7 D0AF CA45 5313 A3BF ACFB B90B 66C7 712D AA69
Website Security Test
0110010101100001011100110111010001100101011100100010000001100101011001110110011100100000011011100110111100101110001000000011000000110110