Després de molt temps d'estar valorant si adquirir un SAI vaig fer el pas i vaig comprar un Salicru SPS One. La tasca per configurar el SAI no va ser senzill, de manera que tot seguit adjunto els passos.
Nota: Com que aquest semi "how-to" està fet molt més temps d'ençà que vaig configurar el SAI, pot ser que alguna dada/pas no sigui 100% fidedigne a com ho vaig fer aleshores.
1. Instal·lar els paquets necessaris:
root@debian:~# apt-get install nut nut-client nut-server nut-cgi
2. Configurar els paràmetres següents
Afegir a /etc/nut/ups.conf
[salicru]
driver = blazer_usb
port = auto
desc = "Sai Salicru 900"
Afegir a /etc/nut/hosts.conf
MONITOR salicru@localhost "Salicru SPS One"
Setejar /etc/nut/nut.conf de la següent manera:
#MODE=none
MODE=standalone
Setejar /etc/nut/upsd.conf de la següent manera:
LISTEN 127.0.0.1 3493
LISTEN ::1 3493
Setejar /etc/nut/upsset.conf de la següent manera:
<Files upsset.cgi>
deny from all
allow from 192.168.0.0
</Files>
Afegir a /etc/nut/upsd.users
[upsmaster]
password = elpasswordquevulguem
allowfrom = localhost
upsmon master
Deixar l'arxiu /etc/nut/upsmon.conf de la següent manera (almenys es com jo ho tinc, ull al posar el password, ha de coincidir amb el que hem posat abans a upsd.users):
MONITOR salicru@localhost 1 upsmaster elpasswordquevulguem master
MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h +0"
NOTIFYCMD /bin/ups_notifier
POLLFREQ 5
POLLFREQALERT 5
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG /etc/killpower
NOTIFYMSG ONBATT "THe UPS is working in battery mode."
NOTIFYMSG LOWBATT "The battery of the UPS is very low."
NOTIFYMSG SHUTDOWN "The server will shutdown now."
NOTIFYMSG ONLINE "The UPS is working with external AC power."
NOTIFYFLAG ONBATT WALL+EXEC
NOTIFYFLAG LOWBATT WALL+EXEC
NOTIFYFLAG SHUTDOWN WALL+EXEC
NOTIFYFLAG ONLINE WALL+EXEC
RBWARNTIME 43200
NOCOMMWARNTIME 300
FINALDELAY 5
Per enviar les notificacions d'entrada en mode bateria / sortida del mode bateria per correu creem el següent arxiu executable amb els corresponents permisos a a la ruta /bin/ups_notifier (ha de coincidir amb el paràmetre NOTIFYCMD de l'arxiu upsmon.conf):
#!/bin/bash
/bin/echo "$*" | /usr/bin/gammu –sendsms TEXT num_de_telf
echo "$*" | mail -s "UPS Notify" el_nostre_mail
Nota: L'enviament de SMS no em funciona simplement deixo la línia per tenir-la de referència.
3. Iniciar el driver:
root@debian:~# sudo upsdrvctl -u root start
Network UPS Tools - UPS driver controller 2.7.2
Network UPS Tools - Megatec/Q1 protocol USB driver 0.11 (2.7.2)
Supported UPS detected with mustek protocol
Vendor information unavailable
No values provided for battery high/low voltages in ups.conf
Using 'guestimation' (low: 10.400000, high: 13.000000)!
Battery runtime will not be calculated (runtimecal not set)
Per consultar l'informació del SAI anirem a:
http://localhost/cgi-bin/nut/upsstats.cgi
Enllaços d'interès
http://www.networkupstools.org/docs/user-manual.chunked/ar01s06.html
http://blog.lebrijo.com/web-monitoring-of-an-ups-with-nut/
http://perlmaven.com/perl-cgi-script-with-apache2
http://rogerprice.org/NUT.html
http://blog.osusnet.com/2010/05/
http://jacs.guru/?p=41
http://blog.lebrijo.com/web-monitoring-of-an-ups-with-nut/
http://perlmaven.com/perl-cgi-script-with-apache2
http://rogerprice.org/NUT.html
http://blog.osusnet.com/2010/05/
http://jacs.guru/?p=41
No hay comentarios:
Publicar un comentario