Configurazione di un UPS

From RVM Wiki
Revision as of 13:26, 23 May 2005 by Gabriele.vivinetto (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Collegare l'ups seriale su COM1 (/dev/ttyS0)


Installare il software di gestione

apt-get install apcupsd


Verificare la porta a cui si è collegato l'UPS

L'elenco delle porte seriali lo si può ottenere con:

dmesg | grep ttyS

Si ricorda che:

COM1=ttyS0
COM2=ttyS1

Nel caso si correga nel file /etc/apcupsd/apcupsd.conf:

DEVICE /dev/ttyS0

Testare la comunicazione con l'ups:

apctest

Attendere anche sino ad 1 minuto:


2005-05-23 15:08:38 apctest 3.10.16 (04 November 2004) debian
Checking configuration ...
Attached to driver: apcsmart
sharenet.type = DISABLE
cable.type = CUSTOM_SMART

You are using a SMART cable type, so I'm entering SMART test mode
mode.type = SMART
Setting up the port ...
Creating the device lock file ...
Hello, this is the apcupsd Cable Test program.
This part of apctest is for testing Smart UPSes.
Please select the function you want to perform.

1) Query the UPS for all known values
2) Perform a Battery Runtime Calibration
3) Abort Battery Calibration
4) Monitor Battery Calibration progress
5) Program EEPROM
6) Enter TTY mode communicating with UPS
7) Quit

Select function number: 1

Inserire 1

I am going to run through the series of queries of the UPS
that are used in initializing apcupsd.

Simulating UPSlinkCheck ...
Wrote: Y Got: SM
Attempting to use smart_poll() ...
Sent: Y Got: SM  Good -- smart_poll() works!.

Going to ask for valid commands...
Protocol version is: 3
Alert characters are: !$%+?=#|
Command characters are: ^A^N^Z')+-89>@ABCDEFGKLMNOPQRSUVWXYZabcefgjklmnopqrsuxyz^M

Now running through apcupsd get_UPS capabilities().
NA  indicates that the feature is Not Available

UPS Status: 08
Line quality: FF
Reason for last transfer to batteries: T
Self-Test Status: NO
Line Voltage: 223.2
Line Voltage Max: 224.6
Line Voltage Min: 223.2
Output Voltage: 223.2
Batt level percent: 100.0
Batt voltage: 27.54
UPS Load: 012.3
Line freq: 50.00
Runtime left: 0104
UPS Internal temp: 029.2
Dip switch settings: NA
Register 1: 00
Register 2: 00
Register 3: 00
Sensitivity: H
Wakeup delay: 000
Sleep delay: 090
Low transfer voltage: 208
High transfer voltage: 253
Batt charge for return: 00
Alarm status: 0
Low battery shutdown level: 02
UPS Name: UPS_IDEN
UPS Self test interval: 336
UPS manufacture date: 02/02/05
UPS serial number: AS0506111930
Date battery replaced: 02/02/05
Output voltage when on batteries: 230
Nominal battery voltage: 024
Percent humidity: NA
Ambient temperature: NA
Firmware revision: 600.3.I
Number of external batteries installed: 000
Number of bad batteries installed: NA
UPS model as defined by UPS: FWI
UPS EPROM capabilities string: uD43127130133136uA43108110112114uI43253257261265uM43225229233237lD43106103100097lA43092090088086lI43208204200196lM43182178174170e47200153045607590oD13120oA13100oI33230240220oM13208s431HMLq4820205081114172023p483090180270360450540630000k4310TNr483000060120180240300360420E443336168ON OFF
The EPROM string is 286 characters long!
Hours since last self test: NA

That is all for now.

1) Query the UPS for all known values
2) Perform a Battery Runtime Calibration
3) Abort Battery Calibration
4) Monitor Battery Calibration progress
5) Program EEPROM
6) Enter TTY mode communicating with UPS
7) Quit

Select function number: 7

2005-05-23 15:14:32 End apctest.


Abilitazione del Demone

vi /etc/default/apcupsd

...
ISCONFIGURED=YES
...

Avviare il demone:

/etc/init.d/apcupsd start

Verifica del rilevamento caduta di tensione:

tail -f /var/log/apcupsd.events
Mon May 23 15:22:31 CEST 2005  apcupsd 3.10.16 (04 November 2004) debian startup succeeded
Mon May 23 15:23:09 CEST 2005  Power failure.
Mon May 23 15:23:11 CEST 2005  Running on UPS batteries.
Mon May 23 15:23:36 CEST 2005  Mains returned. No longer on UPS batteries.
Mon May 23 15:23:36 CEST 2005  Power is back. UPS running on mains.