Configurazione di un UPS: Difference between revisions
| (One intermediate revision by the same user not shown) | |||
| Line 193: | Line 193: | ||
* Per Etch | * Per Etch | ||
sudo ls -al /dev/.static/dev/usb/ | grep hid | sudo ls -al /dev/.static/dev/usb/ | grep hid | ||
: Oppure in alternativa anche: | |||
<pre> | |||
ls -l /sys/bus/usb/drivers/ | |||
total 0 | |||
drwxr-xr-x 7 root root 0 Dec 22 15:58 . | |||
drwxr-xr-x 4 root root 0 Dec 19 13:48 .. | |||
drwxr-xr-x 2 root root 0 Dec 22 15:58 hiddev | |||
drwxr-xr-x 2 root root 0 Dec 19 13:48 hub | |||
drwxr-xr-x 2 root root 0 Dec 19 13:48 usb | |||
drwxr-xr-x 2 root root 0 Dec 19 13:48 usbfs | |||
drwxr-xr-x 2 root root 0 Dec 22 15:58 usbhid | |||
</pre> | |||
=== Configurazione === | === Configurazione === | ||
| Line 212: | Line 225: | ||
* Per Etch | * Per Etch | ||
DEVICE /dev/static/dev/usb/hiddev[0-15] | DEVICE /dev/.static/dev/usb/hiddev[0-15] | ||
=== Testing === | === Testing === | ||
| Line 266: | Line 279: | ||
Almeno si parla.... | Almeno si parla.... | ||
== Abilitazione del Demone == | == Abilitazione del Demone == | ||
Latest revision as of 15:02, 22 December 2008
Questa howto parla di come configurare un Gruppo di Continuità APC in Debian Sarge.
Installare il software di gestione
sudo apt-get install apcupsd
Configurazione di un UPS Seriale
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
Lanciare
sudo 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.
Configfurazione di un BACKUP-CS USB
Controllo USB
Verificare che il sistema veda correttamente l'ups dopo averlo collegato:
Se è un gruppo APC
sudo cat /proc/bus/usb/devices | grep 'S:\|I:' | grep 'American Power' -A3 S: Manufacturer=American Power Conversion S: Product=Back-UPS CS 500 FW:808.q8.I USB FW:q8 S: SerialNumber=8B0703R14874 I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid
Se è un gruppo generico:
sudo cat /proc/bus/usb/devices | grep 'S:\|I:' ... S: Manufacturer=American Power Conversion S: Product=Back-UPS CS 500 FW:808.q7.I USB FW:q7 S: SerialNumber=BB0603011598 I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid ...
Verificare che l'UPS sia visto, e che nella riga con I: ci sia Driver=usbhid
Se così non fosse, far riferimento al manuale di apcupsd, sezione Verifying Device Detection and Driver: Verifying Device Detection and Driver
Verificare che esistano i nodi hiddev:
- Per Sarge:
ls /dev/usb/hiddev* crw-rw---- 1 root root 180, 96 2005-02-26 07:43 /dev/usb/hiddev0 crw-rw---- 1 root root 180, 97 2005-02-26 07:43 /dev/usb/hiddev1 crw-rw---- 1 root root 180, 106 2005-02-26 07:43 /dev/usb/hiddev10 crw-rw---- 1 root root 180, 107 2005-02-26 07:43 /dev/usb/hiddev11 crw-rw---- 1 root root 180, 108 2005-02-26 07:43 /dev/usb/hiddev12 crw-rw---- 1 root root 180, 109 2005-02-26 07:43 /dev/usb/hiddev13 crw-rw---- 1 root root 180, 110 2005-02-26 07:43 /dev/usb/hiddev14 crw-rw---- 1 root root 180, 111 2005-02-26 07:43 /dev/usb/hiddev15 crw-rw---- 1 root root 180, 98 2005-02-26 07:43 /dev/usb/hiddev2 crw-rw---- 1 root root 180, 99 2005-02-26 07:43 /dev/usb/hiddev3 crw-rw---- 1 root root 180, 100 2005-02-26 07:43 /dev/usb/hiddev4 crw-rw---- 1 root root 180, 101 2005-02-26 07:43 /dev/usb/hiddev5 crw-rw---- 1 root root 180, 102 2005-02-26 07:43 /dev/usb/hiddev6 crw-rw---- 1 root root 180, 103 2005-02-26 07:43 /dev/usb/hiddev7 crw-rw---- 1 root root 180, 104 2005-02-26 07:43 /dev/usb/hiddev8 crw-rw---- 1 root root 180, 105 2005-02-26 07:43 /dev/usb/hiddev9
- Per Etch
sudo ls -al /dev/.static/dev/usb/ | grep hid
- Oppure in alternativa anche:
ls -l /sys/bus/usb/drivers/ total 0 drwxr-xr-x 7 root root 0 Dec 22 15:58 . drwxr-xr-x 4 root root 0 Dec 19 13:48 .. drwxr-xr-x 2 root root 0 Dec 22 15:58 hiddev drwxr-xr-x 2 root root 0 Dec 19 13:48 hub drwxr-xr-x 2 root root 0 Dec 19 13:48 usb drwxr-xr-x 2 root root 0 Dec 19 13:48 usbfs drwxr-xr-x 2 root root 0 Dec 22 15:58 usbhid
Configurazione
Editare il file di configurazione:
sudoedit /etc/apcupsd/apcupsd.conf ... UPSCABLE usb ... UPSTYPE usb
- Per Sarge
DEVICE /dev/usb/hiddev[0-15]
- Per Etch
DEVICE /dev/.static/dev/usb/hiddev[0-15]
Testing
Lanciare il diagnostico:
sudo apctest 2006-04-04 10:41:11 apctest 3.10.17 (18 March 2005) debian Checking configuration ... Attached to driver: usb sharenet.type = DISABLE cable.type = USB_CABLE You are using a USB cable type, so I'm entering USB test mode mode.type = USB_UPS Setting up the port ... Creating the device lock file ... Hello, this is the apcupsd Cable Test program. This part of apctest is for testing USB UPSes. Getting UPS capabilities...SUCCESS Please select the function you want to perform. 1) Test kill UPS power 2) Perform self-test 3) Read last self-test result 4) Change battery date 5) View battery date 6) View manufacturing date 7) Quit Select function number: 5 Current battery date: 01/10/2006 ... Select function number: 2 This test instructs the UPS to perform a self-test operation and reports the result when the test completes. Clearing previous self test result...CLEARED Initiating self test...INITIATED Waiting for test to complete...TEST DID NOT COMPLETE Select function number: 7 2006-04-04 10:43:44 End apctest.
Almeno si parla....
Abilitazione del Demone
sudoedit /etc/default/apcupsd ... ISCONFIGURED=YES ...
Avviare il demone:
sudo /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.
Verifica funzionalità Demone
Con il comando:
apcaccess
Si possono verificare i parametri letti direttamente dall'UPS.
APC : 001,052,1278 DATE : Mon May 23 15:38:01 CEST 2005 HOSTNAME : lemserver RELEASE : 3.10.16 VERSION : 3.10.16 (04 November 2004) debian UPSNAME : UPS_IDEN CABLE : Custom Cable Smart MODEL : Smart-UPS 1000 UPSMODE : Stand Alone STARTTIME: Mon May 23 15:21:43 CEST 2005 STATUS : ONLINE LINEV : 221.7 Volts LOADPCT : 12.3 Percent Load Capacity BCHARGE : 100.0 Percent TIMELEFT : 104.0 Minutes MBATTCHG : 5 Percent MINTIMEL : 3 Minutes MAXTIME : 0 Seconds MAXLINEV : 224.6 Volts MINLINEV : 221.7 Volts OUTPUTV : 221.7 Volts SENSE : High DWAKE : 000 Seconds DSHUTD : 090 Seconds DLOWBATT : 02 Minutes LOTRANS : 208.0 Volts HITRANS : 253.0 Volts RETPCT : 000.0 Percent ITEMP : 29.7 C Internal ALARMDEL : 5 seconds BATTV : 27.5 Volts LINEFREQ : 50.0 Hz LASTXFER : Line voltage notch or spike NUMXFERS : 1 XONBATT : Mon May 23 15:23:03 CEST 2005 TONBATT : 0 seconds CUMONBATT: 33 seconds XOFFBATT : Mon May 23 15:23:36 CEST 2005 SELFTEST : NO STESTI : 336 STATFLAG : 0x02000008 Status Flag REG1 : 0x00 Register 1 REG2 : 0x00 Register 2 REG3 : 0x00 Register 3 MANDATE : 02/02/05 SERIALNO : AS0506111930 BATTDATE : 02/02/05 NOMOUTV : 230 NOMBATTV : 24.0 EXTBATTS : 0 FIRMWARE : 600.3.I APCMODEL : FWI END APC : Mon May 23 15:38:30 CEST 2005