View Full Version : [Ubuntu] [APC Smart-UPS 1400] Errore "NISERR NIS network error"
LastStarDust
06-11-2010, 14:44
Ciao!
Ho postato una discussione simile sul forum di Ubuntu ma non ho avuto risposta ed ormai è quasi una settimana che aspetto. Non so se sia consentito riproporla in questa sede . . . se non lo fosse potete chiudere senza problemi. Detto ciò, questa era la questione . . .
Recentemente ho comprato un UPS APC modello Smart-UPS SU1400I di seconda mano (costato anche una bella somma)
http://www.apc.com/resource/include/techspec_index.cfm?base_sku=su1400i
Sto lavorando in Ubuntu 10.10 alternate in ambiente 64bit e come software uso gapcmon
http://gapcmon.sourceforge.net/
Provo a collegarlo tramite cavo seriale ma ricevo sempre la seguente schermata:
http://img210.imageshack.us/img210/7531/schermatas.png
Il cavo che utilizzo è un cavo specifico per il mio UPS e più precisamente è del modello 940-0024
Ho provato a seguire ogni guida trovata nel forum e con google (tutte dicono più o meno la stessa cosa) ma il problema persiste invariato.
Il mio file /etc/apcupsd/apcupsd.conf attualmente è così:
#
# ========= General configuration parameters ============
#
#UPSNAME
UPSCABLE smart
UPSTYPE apcsmart
DEVICE /dev/ttyS0
#POLLTIME 60
LOCKFILE /var/lock
SCRIPTDIR /etc/apcupsd
PWRFAILDIR /etc/apcupsd
NOLOGINDIR /etc
ONBATTERYDELAY 6
BATTERYLEVEL 5
MINUTES 3
TIMEOUT 0
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
KILLDELAY 0
#
# ==== Configuration statements for Network Information Server ====
#
NETSERVER on
NISIP 127.0.0.1
NISPORT 3551
EVENTSFILE /var/log/apcupsd.events
EVENTSFILEMAX 10
#
# ========== Configuration statements used if sharing =============
# a UPS with more than one machine
UPSCLASS standalone
UPSMODE disable
#
# ===== Configuration statements to control apcupsd system logging ========
#
STATTIME 0
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 0
Ho provato inoltre a modificare il file /etc/hosts.allow così:
apcupsd: 127.0.0.1
Vi posto anche l'output del comando sudo lshw -C serial
*-serial UNCLAIMED
description: SMBus
product: 5 Series/3400 Series Chipset SMBus Controller
vendor: Intel Corporation
physical id: 1f.3
bus info: pci@0000:00:1f.3
version: 05
width: 64 bits
clock: 33MHz
configuration: latency=0
resources: memory:fbffc000-fbffc0ff ioport:500(size=32)
Marinelli
07-11-2010, 11:15
Immagino che per forum di Ubuntu tu intenda quello ufficiale e non la sezione dedicata a Linux di Hwupgrade, visto che là non ho trovato niente.
Ti sposto proprio in tale sezione.
Ciao
LastStarDust
18-12-2010, 16:44
Up mensile!
Gimli[2BV!2B]
18-12-2010, 18:14
La configurazione mi sembra ineccepibile, considerando che non ha mai avuto a che fare con un UPS.
Uniche osservazioni che posso fare:
il device /dev/ttyS0 esiste, vero?
nel BIOS la porta seriale è attiva? Che impostazioni ha?
Potresti provare ad interrogare direttamente l'UPS via seriale, per esempio usando sjinn (http://sjinn.sourceforge.net/).
Un comando che dovrebbe fornire una risposta dovrebbe essere questo:sjinn -d /dev/ttyS0 -b2400 --send "B" -r6Descrizione del comando, basato sulla documentazione di APCUPSD (http://www.apcupsd.com/manual/manual.html#the-smart-protocol) ed il manuale di sjinn (http://sjinn.sourceforge.net/commands.html):
-d /dev/ttyS0: device ttyS0
-b2400: 2400 bps/8N1, se non si specifica nulla con l'opzione --comm
--send "B": invia il comando B, cioè interroga il voltaggio della batteria
-r6: leggi 6 caratteri della risposta
Se il comando va a buon fine dovresti vedere il valore riportato dall'UPS.
Se non ricevi nulla potrebbero esserci problemi con il comando, l'impostazione della porta COM nel BIOS, con l'impostazione del driver del kernel, con il cavo...
LastStarDust
18-12-2010, 19:43
Grazie della risposta!
il device /dev/ttyS0 esiste, vero?
Si ho appena controllato.
nel BIOS la porta seriale è attiva? Che impostazioni ha?
La porta seriale mi sembra attiva. Questo è quello che leggo nella sezione "Integrated Periphericals"
...
...
Onboard Serial Port 1
Disabled
3F8/IRQ4
3F8/IRQ3 *
3E8/IRQ4
3E8/IRQ3
Quindi la seriale dovrebbe essere abilitata con 3F8/IRQ3
Per quanto riguarda il comando
sjinn -d /dev/ttyS0 -b2400 --send "B" -r6
Questo è quello che ottengo:
error setting tcsetattr on /dev/ttyS0
Ora non ho tempo di cercare proverò magari martedì . . .
LastStarDust
29-11-2011, 12:09
Scusa se ci ho messo tanto tempo per rispondere ma vorrei risolvere la situazione una volta per tutte.
Il comando sjinn -d /dev/ttyS0 -b2400 --send "B" -r6
mi restituisce questo output:
sjinn -d /dev/ttyS0 -b2400 --send "B" -r6 --verbose
/dev/ttyS0 2400 8n1 +dtr -rts -cts +dsr
send B
wait 0.500000 seconds
read 6 characters
......
Le caratteristiche elencate nel primo posto sono le stesse. Tranne per il fatto che ora lavoro in ubuntu 11.10
Gimli[2BV!2B]
29-11-2011, 21:00
Beh, effettivamente hai provato martedì :)
Il risultato della lettura non è granché, mi sarei aspettato qualche cosa che potesse somigliare ad un numero, non 6 punti. Almeno hai ottenuto una risposta e non un erroraccio.
Ti propongo di provare a modificare una impostazione del file di configurazione che avevi riportato:UPSCABLE smart
UPSTYPE smartups
DEVICE /dev/ttyS0Stando a questa guida (http://perfab.wordpress.com/2011/10/25/ups-apc-integriamolo-con-ubuntu-11-10-oneiric-ocelot-usando-unity/) occorre anche assicurarsi che il file /etc/default/apcupsd comunichi ad apcupsd che lo abbiamo configurato e desideriamo utilizzarlo:# Apcupsd-devel internal configuration
APCACCESS=/sbin/apcaccess
ISCONFIGURED=yes
LastStarDust
30-11-2011, 16:34
Beh, effettivamente hai provato martedì
sono uomo di parola io . . . ;)
Avevo già letto la guida che mi hai linkato e avevo già editato il file /etc/default/apcupsd.
Ho provato a dare il comando apctestcon questi risultati:
apctest
2011-11-30 16:29:44 apctest 3.14.8 (16 January 2010) 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 ...
apctest FATAL ERROR in smartsetup.c at line 184
PANIC! Cannot communicate with UPS via serial port.
Please make sure the port specified on the DEVICE directive is correct,
and that your cable specification on the UPSCABLE directive is correct.
apctest error termination completed
Porta e cavi dovrebbero essere corretti, almeno stando alle specifiche dell'usp.
Gimli[2BV!2B]
30-11-2011, 20:59
Hai fatto un tentativo con UPSTYPE smartups?
Non l'hai specificato esplicitamente ad anche l'output di apctest dice apcsmart.
Se hai più di una porta seriale (fisica ed attiva) ai provato con tutte le combinazioni device/porta fisica?
Altre prove potrebbero essere:
UPSCABLE simple
UPSTYPE dumb
Network UPS Tools (http://www.networkupstools.org/)
LastStarDust
01-12-2011, 09:47
Hai fatto un tentativo con UPSTYPE smartups?
Non l'hai specificato esplicitamente ad anche l'output di apctest dice apcsmart.
Il tentativo l'avevo fatto ma in apctest se in UPSCABLE specifichi "smart" lui usa i driver apcsmart qualsiasi cosa metto in UPSTYPE.
Se hai più di una porta seriale (fisica ed attiva) ai provato con tutte le combinazioni device/porta fisica?
Certo. sjinn è molto utile perché in caso si specifica una porta diversa da /dev/ssy0 restituisce errore.
UPSCABLE simple
UPSTYPE dumb
Ho provato questi e l'output di apctest è questo:
2011-12-01 09:32:31 apctest 3.14.8 (16 January 2010) debian
Checking configuration ...
Attached to driver: dumb
sharenet.type = DISABLE
cable.type = CUSTOM_SIMPLE
Unknown mode.type: 1
Setting up the port ...
Doing prep_device() ...
Hello, this is the apcupsd Cable Test program.
We are beginning testing for dumb UPSes, which
use signaling rather than commands.
Most tests enter a loop polling every second for 10 seconds.
1) Test 1 - normal mode
2) Test 2 - no cable
3) Test 3 - no power
4) Test 4 - low battery (requires test 3 first)
5) Test 5 - battery exhausted
6) Test 6 - kill UPS power
7) Test 7 - run tests 1 through 5
8) Guess which is the appropriate cable
Q) Quit
Select test number: 1
For the first test, everything should be normal.
The UPS should be plugged in to the power, and the serial cable
should be connected to the computer.
Please enter any character when ready to continue:
2011-12-01 09:32:54 IOCTL GET: 4102 DTR DSR
2011-12-01 09:33:04 Test 1: normal condition, completed.
Anche se il test sembra passare il risultato del comando apcaccess status è sempre lo stesso:
***@***:~$ /etc/init.d/apcupsd start
Starting UPS power management: apcupsd.
***@***:~$ apcaccess status
Error contacting apcupsd @ localhost:3551: Connection refused
Gimli[2BV!2B]
01-12-2011, 19:59
Hai provato il test 8 di apctest? ("Guess which is the appropriate cable")
Durante lo start vedi comparire qualcosa nel file degli eventi /var/log/apcupsd.events ?
Apri un terminale e tienilo in osservazione mentre avvii il demone in un'altro:tail -f /var/log/apcupsd.eventsAnche /var/log/apcupsd.status potrebbe dire qualcosa.
Per finire si potrebbe controllare anche /var/log/messages
LastStarDust
02-12-2011, 11:22
A dire il vero avevo disinstallato apcupsd per installare nut.
L'ho configurato così:
/etc/nut/ups.conf
[APC_SU1400I]
driver = apcsmart
port = /dev/ttyS0
/etc/nut/upsd.conf
[APC_SU1400I]
LISTEN 127.0.0.1 3493
ACL all 0.0.0.0/0
ACL localhost 127.0.0.1/32
ACCEPT localhost
REJECT all
/etc/nut/upsd.users
[APC_SU1400I]
[admin]
password = miapassword
actions = SET
instcmds = ALL
/etc/nut/upsmon.conf
FINALDELAY 5
POWERDOWNFLAG /etc/killpower
MONITOR pw3105@localhost 1 nut miapassword master
SHUTDOWNCMD "/sbin/shutdown -h +0"
Ma quando provo a lanciare il comando upsdrvctl ottengo
***@***:~$ sudo upsdrvctl start
Network UPS Tools - UPS driver controller 2.6.1
Network UPS Tools - APC Smart protocol driver 2.1 (2.6.1)
APC command table version 2.2
Unable to detect an APC Smart protocol UPS on port /dev/ttyS0
Check the cabling, port name or model name and try again
Driver failed to start (exit status=1)
LastStarDust
02-12-2011, 11:24
Inizio a pensare che ci sia qualcosa che non vada a livello hardware . . .
LastStarDust
02-12-2011, 11:42
il file /var/log/apcupsd.events è pieno degli errori che ottenevo con apctest, cioè:
2011-12-01 09:29:14 +0100 apcupsd FATAL ERROR in smartsetup.c at line 184
PANIC! Cannot communicate with UPS via serial port.
Please make sure the port specified on the DEVICE directive is correct,
and that your cable specification on the UPSCABLE directive is correct.
I file /var/log/apcupsd.status e /var/log/messages rimangono invece vuoti.
Hai provato il test 8 di apctest? ("Guess which is the appropriate cable")
Ho provato. Mi dice che non riesce a determinare il modello del cavo.
Gimli[2BV!2B]
02-12-2011, 20:11
Mi dispiace ma devo arrendermi, non ho più idee né indizi che mi ispirino qualcosa...
LastStarDust
02-12-2011, 21:00
Ti ringrazio per l'aiuto. Ho apprezzato i tuoi sforzi.
LastStarDust
10-12-2011, 11:26
Alla fine ho venduto il gruppo. Si può chiudere.
vBulletin® v3.6.4, Copyright ©2000-2026, Jelsoft Enterprises Ltd.