LinuxForum.Fans
Тема

Powercom SMK-800A, NUT, и другие прелести

Автор: zenon 7 сообщений 7870 просмотров
20.11.2013 22:16 · отредактировано #350361

сам недавно купил батарейку в свой sven pro+700 (стоял на полке ещё с тех славных времён, когда я не знал, что аккумуляторы тоже умирают) и поставил его на «серверок»... тоже с nut'ом колупался... уж больно он мудрёный... правда пока не уверен, на сколько я правильно его настроил и сможет ли он отключаться/включаться, как ему полагается... а у тебя как, оно заработало?

"zenon" написал:
Обсудить материал можно тут.

а зачем доступ в локалку открывать? причём с таким паролем...

text
# upsdrvctl -t shutdown

после этого что должно быть? у меня на вид всё в порядке, на сколько я могу судить, но упсик сам не отключается...

20.11.2013 22:30 #350365
Fat-Zer написал:

а зачем доступ в локалку открывать? причём с таким паролем...

Так я как бы для примера и чтобы понятно было написал сей пароль, а локалка у меня домашняя. :_)
Еще у меня APC Back-UPS RS-800 валяется, по характеристикам вроде похож, но есть ограничение железно зашитое в прошивку, больше 45 минут гад не работает, ну и выход прямоугольный. Этот powercom обладает трансформатором раза в два больше чем у APC, - подтверждение того что может долго работать на батарейках, есть микропроцессор с AVR и чистый синус на выходе, с АPFC дружит отлично.

21.11.2013 00:28 #350379
"zenon" написал:
а локалка у меня домашняя

а как же прогрессирующая паранойя?

"zenon" написал:
с АPFC дружит отлично.

у меня всего в доме три со ступенчатой апроксимацией и один с меандром... АPFC, сволочи, от таких мрут... =(

эх... сервер при низком заряде, как положено, отключается, а упсик ни как не хочет... т.о. если свет надолго отключат, то серверочек обратно сам не поднимется...
оставлю здесь конфиг на всякий... может кто-чего подметит....

text

/etc/nut/upsd.users:[admin]
/etc/nut/upsd.users:    password = admin_salted_xxx_pass
/etc/nut/upsd.users:    actions = SET
/etc/nut/upsd.users:    instcmds = ALL
/etc/nut/upsd.users:[upsmon]
/etc/nut/upsd.users:    password = upsmon_salted_xxx_pass
/etc/nut/upsd.users:    upsmon master
/etc/nut/ups.conf:[sven]
/etc/nut/ups.conf:      driver = blazer_usb
/etc/nut/ups.conf:      port = auto
/etc/nut/ups.conf:      default.battery.voltage.high = 12.3
/etc/nut/ups.conf:      default.battery.voltage.low = 10.5
/etc/nut/ups.conf:      offdelay = 20
/etc/nut/ups.conf:      ondelay = 0
/etc/nut/upsmon.conf:MONITOR sven@localhost 1 upsmon upsmon_salted_xxx_pass master
/etc/nut/upsmon.conf:MINSUPPLIES 1
/etc/nut/upsmon.conf:SHUTDOWNCMD "/sbin/shutdown -h +0"
/etc/nut/upsmon.conf:POLLFREQ 5
/etc/nut/upsmon.conf:POLLFREQALERT 5
/etc/nut/upsmon.conf:HOSTSYNC 15
/etc/nut/upsmon.conf:DEADTIME 15
/etc/nut/upsmon.conf:POWERDOWNFLAG /etc/killpower
/etc/nut/upsmon.conf:RBWARNTIME 43200
/etc/nut/upsmon.conf:NOCOMMWARNTIME 300
/etc/nut/upsmon.conf:FINALDELAY 5
/etc/nut/nut.conf:MODE=standalone
/etc/nut/upsd.conf:ACL all 0.0.0.0/0
/etc/nut/upsd.conf:ACL localhost 127.0.0.1/32
/etc/nut/upsd.conf:ACCEPT localhost
/etc/nut/upsd.conf:REJECT all
/etc/nut/upssched.conf:CMDSCRIPT /bin/upssched-cmd
21.11.2013 01:15 #350385
"Fat-Zer" написал:
а как же прогрессирующая паранойя?

Не болею... :_)

"Fat-Zer" написал:
т.о. если свет надолго отключат, то серверочек обратно сам не поднимется...

Это надо разбираться почему так.
Последней командой (перед шатдауном) должна быть команда upsdrvctl shutdown, она как раз говорит ups выключиться в любом случае (подождав offdelay), даже если питание появится и включится снова (подождав ondelay), если она не работает можно состряпать свой скрипт шатдауна, с другой командой, которую ups понимает.
Список андестенда упса глянуть:

text
# upscmd -uadmin -ppass -l SMK@192.168.0.1
Instant commands supported on UPS [SMK]:

beeper.toggle - Toggle the UPS beeper load.off - Turn off the load immediately load.on - Turn on the load immediately shutdown.return - Turn off the load and return when power is back shutdown.stayoff - Turn off the load and remain off shutdown.stop - Stop a shutdown in progress test.battery.start - Start a battery test test.battery.start.deep - Start a deep battery test test.battery.start.quick - Start a quick battery test test.battery.stop - Stop the battery test

Fat-Zer, shutdown.return тоже не работает?
Да, и в gentoo упс не перезапустится без rc-update add nut.powerfail shutdown
ыы. Про shutdown -h now тоже недавно писал.

21.11.2013 12:03 · отредактировано #350431
"zenon" написал:
Последней командой (перед шатдауном) должна быть команда upsdrvctl shutdown
text
goblin-server alexander # upsdrvctl -t shutdown
Network UPS Tools - UPS driver controller 2.6.4
*** Testing mode: not calling exec/kill
   0.000000
If you're not a NUT core developer, chances are that you're told to enable debugging
to see why a driver isn't working for you. We're sorry for the confusion, but this is
the 'upsdrvctl' wrapper, not the driver you're interested in.

Below you'll find one or more lines starting with 'exec:' followed by an absolute path to the driver binary and some command line option. This is what the driver starts and you need to copy and paste that line and append the debug flags to that line (less the 'exec:' prefix).

0.000328 Shutdown UPS: sven 0.000348 exec: /lib/nut/blazer_usb -a sven -k goblin-server alexander # upsdrvctl shutdown Network UPS Tools - UPS driver controller 2.6.4 Network UPS Tools - Megatec/Q1 protocol USB driver 0.08 (2.6.4) Initiating UPS shutdown instcmd: command [shutdown.stop] handled instcmd: command [shutdown.return] handled Shutting down in 6 seconds goblin-server alexander #

после этого upsmon отваливается, но питание продолжает работать:

text

Broadcast Message from nut@gobl
        (somewhere) at 11:45 ...

Communications with UPS sven@localhost lost

снова соединение с ним поднимается только после upsdrvctl start

upscmd -u admin -p admin_salted_xxx_pass sven shutdown.return — пишет OK, но ничего не происходит
shutdown.stayoff и shutdown.stop — та же история...

"zenon" написал:
если она не работает можно состряпать свой скрипт шатдауна, с другой командой, которую ups понимает.

знать бы какую команду она ещё понимает...
У меня зреет нехорошее подозрение, что фины не так точно реализовали протокол, как того хотелось бы...

и ещё немного инфы:

upscmd -u admin -p admin_salted_xxx_pass -l sven
text
Instant commands supported on UPS [sven]:

beeper.toggle - Toggle the UPS beeper load.off - Turn off the load immediately load.on - Turn on the load immediately shutdown.return - Turn off the load and return when power is back shutdown.stayoff - Turn off the load and remain off shutdown.stop - Stop a shutdown in progress test.battery.start - Start a battery test test.battery.start.deep - Start a deep battery test test.battery.start.quick - Start a quick battery test test.battery.stop - Stop the battery test

upsc sven
text
battery.charge: 100
battery.voltage: 12.70
battery.voltage.high: 12.3
battery.voltage.low: 10.5
battery.voltage.nominal: 12.0
device.type: ups
driver.name: blazer_usb
driver.parameter.offdelay: 6
driver.parameter.ondelay: 0
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.4
driver.version.internal: 0.08
input.current.nominal: 4.0
input.frequency: 49.0
input.frequency.nominal: 50
input.voltage: 230.0
input.voltage.fault: 230.0
input.voltage.nominal: 220
output.voltage: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 6
ups.delay.start: 0
ups.load: 5
ups.productid: 0000
ups.status: OL
ups.temperature: 27.0
ups.type: offline / line interactive
ups.vendorid: 05b8

21.11.2013 12:59 #350443
text
# upsdrvctl -t shutdown
Network UPS Tools - UPS driver controller 2.6.5-Unversioned directory
*** Testing mode: not calling exec/kill
   0.000000    
If you're not a NUT core developer, chances are that you're told to enable debugging
to see why a driver isn't working for you. We're sorry for the confusion, but this is
the 'upsdrvctl' wrapper, not the driver you're interested in.

Below you'll find one or more lines starting with 'exec:' followed by an absolute path to the driver binary and some command line option. This is what the driver starts and you need to copy and paste that line and append the debug flags to that line (less the 'exec:' prefix).

0.005590 Shutdown UPS: SMK 0.005707 exec: /lib64/nut/blazer_ser -a SMK -k

Соединение не отваливается.

text
# /lib64/nut/blazer_ser -h
Network UPS Tools - Megatec/Q1 protocol serial driver 1.55 (2.6.5-Unversioned directory)

usage: blazer_ser -a <id> [OPTIONS] -a <id> - autoconfig using ups.conf section <id> - note: -x after -a overrides ups.conf settings

-V - print version, then exit -L - print parseable list of driver variables -D - raise debugging level -q - raise log level threshold -h - display this help -k - force shutdown -i <int> - poll interval -r <dir> - chroot to <dir> -u <user> - switch to <user> (if started as root) -x <var>=<val> - set driver variable <var> to <val> - example: -x cable=940-0095B

Acceptable values for -x or ups.conf in this driver:

Set cable power for serial interface : -x cablepower=<value> Delay before UPS startup (minutes) : -x ondelay=<value> Delay before UPS shutdown (seconds) : -x offdelay=<value> Parameters used for runtime calculation : -x runtimecal=<value> Nominal charge time for UPS battery : -x chargetime=<value> Minimum load to be used for runtime calculation : -x idleload=<value> Skip reading rating information from UPS : -x norating Skip reading vendor information from UPS : -x novendor Preselect communication protocol (skip autodetection) : -x protocol Read The Fine Manual ('man 8 blazer')

Включить debug и посмотреть что там:

text
# /lib64/nut/blazer_ser -DDDDD -a SMK -k

Перед этим всё же посмотреть на выхлоп (может будет что интересное) /lib/nut/blazer_ser -DDDDD -a SMK, то есть:

text
# /etc/init.d/upsdrv zap 
# killall blazer_ser
# /lib/nut/blazer_ser -DDDDD -a SMK
"Fat-Zer" написал:
У меня зреет нехорошее подозрение, что фины не так точно реализовали протокол, как того хотелось бы...

Честно говоря к SVEN у меня двоякое отношение, вроде и ничего так железки (комплектуха вполне приличная), с другой стороны стремление удешевить продукцию приводит к непредсказуемым последствиям.

Войдите или зарегистрируйтесь, чтобы ответить.