Questa è una vecchia versione del documento!
Installazione
In tutti i computer/server, MASTER and SLAVE(S), apri un terminale ed esgui:
sudo apt-get install apcupsd
Configurazioni nel MASTER
1 - Edita il file diconfigurazione: Prima fai una copia del originale:
sudo cp /etc/apcupsd/apcupsd.conf /etc/apcupsd/apcupsd.conf.bak
Poi
sudo nano /etc/apcupsd/apcupsd.conf
Trova e modifica: UPSCABLE, UPSTYPE, DEVICE, POLLTIME, BATTERYLEVEL e MINUTES
In genere le opzioni come sotto indicati dovrebbero bastare
## apcupsd.conf v1.1 ## # # for apcupsd release 3.14.12 (29 March 2014) - debian # # "apcupsd" POSIX config file # # ========= General configuration parameters ============ # ... UPSCABLE usb ... UPSTYPE usb ... #DEVICE /dev/ttyS0 # POLLTIME <int> # Interval (in seconds) at which apcupsd polls the UPS for status. This # setting applies both to directly-attached UPSes (UPSTYPE apcsmart, usb, # dumb) and networked UPSes (UPSTYPE net, snmp). Lowering this setting # will improve apcupsd's responsiveness to certain events at the cost of # higher CPU utilization. The default of 60 is appropriate for most # situations. #POLLTIME 60 # # ======== Configuration parameters used during power failures ========== # # Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so # the first that occurs will cause the initation of a shutdown. ... # If during a power failure, the remaining battery percentage # (as reported by the UPS) is below or equal to BATTERYLEVEL, # apcupsd will initiate a system shutdown. BATTERYLEVEL 30 ... # If during a power failure, the remaining runtime in minutes # (as calculated internally by the UPS) is below or equal to MINUTES, # apcupsd, will initiate a system shutdown. MINUTES 10 # # ==== Configuration statements for Network Information Server ==== # # NETSERVER [ on | off ] on enables, off disables the network # information server. ... NETSERVER on # NISIP <dotted notation ip address> ... NISIP 0.0.0.0
2 - Editare etc/apcupsd/hosts.conf
Questo file contiene i computer o server protetti dal UPS. Nel nostro caso
# Network UPS Tools - hosts.conf # # This file does double duty - it lists the systems that multimon will # monitor, and also specifies the systems that upsstats is allowed to # watch. It keeps people from feeding random addresses to upsstats, # among other things. upsimage also uses this file to know who it # may speak to. upsfstats too. # # Usage: list systems running upsd that you want to monitor # # MONITOR <address> "<host description>" MONITOR 127.0.0.1 "localhost" MONITOR 10.17.61.87 "Hansel Proxmox"
3 - Editare /etc/default/apcupsd
sudo nano /etc/default/apcupsd
impostare:
... ISCONFIGURED=yes ...
4 - Puoi riavviare il servizio apcupsd
sudo systemctl restart apcupsd.service
Configurazioni nel SLAVE
1 - Editare il file di configurazione Prima fare un backup:
sudo cp /etc/apcupsd/apcupsd.conf /etc/apcupsd/apcupsd.conf.bak
Poi
sudo nano /etc/apcupsd/apcupsd.conf
Trova e edita:UPSCABLE, UPSTYPE, DEVICE, POLLTIME, BATTERYLEVEL e MINUTES In molti casi le configurazioni in seguito possono bastare.
## apcupsd.conf v1.1 ## # # for apcupsd release 3.14.12 (29 March 2014) - debian # # "apcupsd" POSIX config file # # ========= General configuration parameters ============ # ... UPSCABLE ether ... UPSTYPE net ... # set the MASTER COMPUTER IP (10.17.61.21 nel caso nostro) # The default port for apcupsd is 3551 DEVICE 10.17.61.21:3551 # POLLTIME <int> # Interval (in seconds) at which apcupsd polls the UPS for status. This # setting applies both to directly-attached UPSes (UPSTYPE apcsmart, usb, # dumb) and networked UPSes (UPSTYPE net, snmp). Lowering this setting # will improve apcupsd's responsiveness to certain events at the cost of # higher CPU utilization. The default of 60 is appropriate for most # situations. POLLTIME 10 ... # # ======== Configuration parameters used during power failures ========== # # Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so # the first that occurs will cause the initation of a shutdown. ... # If during a power failure, the remaining battery percentage # (as reported by the UPS) is below or equal to BATTERYLEVEL, # apcupsd will initiate a system shutdown. BATTERYLEVEL 40 ... # If during a power failure, the remaining runtime in minutes # (as calculated internally by the UPS) is below or equal to MINUTES, # apcupsd, will initiate a system shutdown. MINUTES 15 # # ==== Configuration statements for Network Information Server ==== # # NETSERVER [ on | off ] on enables, off disables the network # information server. ... NETSERVER on # NISIP <dotted notation ip address> ... NISIP 0.0.0.0
2 - Editare /etc/default/apcupsd
sudo nano /etc/default/apcupsd
imposta:
... ISCONFIGURED=yes ...
3 - In fine riavviare apcupsd
sudo systemctl restart apcupsd.service