Peter's Portfolio

[Proxmox] Setup an APC UPS monitoring with self power-off on on Proxmox 5.3

STEP1.

Install the software
apt-get update
apt-get install apcupsd apcupsd-doc apcupsd-cgi

STEP2. 

Edit the configured file.
nano /etc/apcupsd/apcupsd.conf

STEP3.

If you lost this file or open the file with a blank page. This is the original config file to download (v.1.1)

Edit the following arguments

You should change the values inside the “@“ quote (delete @ marks too.)

▽ Edit a random name that less than 8 words in the quote

UPSNAME @NAME@

▽ Type USB in the quote if your UPS are connected via USB cable

UPSCABLE @CABLE@

▽ Type USB in the quote if your UPS are connected via USB cable. Leave a blank to let system auto detected the device.

UPSTYPE @TYPE@
DEVICE @DEVICE@

▽ Delete the # before POLLTIME value

POLLTIME 60

▽ Scroll down and check is the values same with below.

LOCKFILE /var/lock
SCRIPTDIR /etc/apcupsd
PWRFAILDIR /etc/apcupsd
NOLOGINDIR /etc
EVENTSFILE /var/log/apcupsd.events
STATFILE /var/log/apcupsd.status

You can set this value to customize auto shutdown for your server

▽ The ONBATTERYDELAY is the time in seconds from when a power failure is detected until we react to it with an onbattery event.

ONBATTERYDELAY (default 6)

▽ BATTERYLEVEL LEFT to auto shutdown

BATTERYLEVEL (default 5)

▽ BATTERY MINUTES LEFT to auto shutdown

MINUTES (default 3)

Notes:  BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so the first that occurs will cause the initiation of a shutdown.

ctrl+o and Yes to save
ctrl+q to quit

 

STEP4.

Edit the configured file.
nano /etc/default/apcupsd

▽ Change “no” to “yes”

ISCONFIGURED= yes

ctrl+o and Yes to save
ctrl+q to quit

 

STEP5.

Change the privilege to 664.
chmod 644 /etc/apcupsd/apcupsd.conf

 

STEP6.

Do UPS test to check the configured is successful or not.

Stop apcupsd service before check you UPS.

systemctl stop apcupsd

Do UPS test by entering “apctest”.

apctest

If you are able to see the following menu, than continue setting, if not review two configured file we had set and check is there any error.

STEP7.

Start apcupsd service first.

systemctl start apcupsd

To check the status by using following command.

systemctl status apcupsd.service

 

STEP8. 

After you start your apcupsd service again. Do a quick check to see if the system had connect to UPS

/sbin/apcaccess

If there is no error occurred and appear with the UPS information message. You configured are done.
Try to plug off the power of your UPS to test if self power-off mode work or not. 

Software Version/Hardware Model:

Proxmox: v5.3-8
Apcupsd: v3.14.14
UPS: Back-UPS CS 1100U

Ref:

1 則留言

  1. 谢谢 很有帮助

    Broadcast message from root@PVE (somewhere) (Sun Feb 2 20:50:27 2020):

    Power failure on UPS apc. Running on batteries.

    Broadcast message from root@PVE (somewhere) (Sun Feb 2 20:50:46 2020):

    Power has returned on UPS apc…

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料