Olav Seyfarth
2015-Nov-26 23:56 UTC
[Nut-upsuser] Cannot access Patriot Pro II from new system
Hi Charles, thank you VERY MUCH for all your hints.> If you have a jumper wire handy, you can connect the PC's TxD to RxDI should have tried to connect from another computer in the first place. Or access another device known to work from this computer. It turned out that the shield I used to connect the mainboard connector to the PC case expected another mainboard pin layout. So all I had to do is to re-arrange the wires... See attached log.> open an issue on the DDL repository, and include the output of "upsc", > "upsrw", and "upscmd -l"Done: https://github.com/networkupstools/nut-ddl/issues/4 Please email me if I should provide/add anything else. Olav -------------- next part -------------- // I could not get nut on my new server running dibian jessie to connect to my UPS Best Power Patriot Pro 750. // THIS is is a trail of my tests on a SECOND computer - so this shows what you see if all DOES work well. // added user to dialout group and logged out and back in $ setserial -g /dev/ttyS0 /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 $ stty -F /dev/ttyS0 speed 9600 baud; line = 0; -brkint -imaxbel $ sudo apt-get install nut Paketlisten werden gelesen... Fertig Abh?ngigkeitsbaum wird aufgebaut. Statusinformationen werden eingelesen.... Fertig Die folgenden zus?tzlichen Pakete werden installiert: libupsclient3 nut-client nut-server Vorgeschlagene Pakete: nut-monitor nut-cgi nut-snmp nut-ipmi nut-xml Die folgenden NEUEN Pakete werden installiert: libupsclient3 nut nut-client nut-server 0 aktualisiert, 4 neu installiert, 0 zu entfernen und 0 nicht aktualisiert. Es m?ssen 876 kB an Archiven heruntergeladen werden. Nach dieser Operation werden 5.345 kB Plattenplatz zus?tzlich benutzt. M?chten Sie fortfahren? [J/n] Holen: 1 http://archive.ubuntu.com/ubuntu/ trusty/main libupsclient3 amd64 2.7.1-1ubuntu1 [60,0 kB] Holen: 2 http://archive.ubuntu.com/ubuntu/ trusty/main nut-client amd64 2.7.1-1ubuntu1 [87,2 kB] Holen: 3 http://archive.ubuntu.com/ubuntu/ trusty/main nut-server amd64 2.7.1-1ubuntu1 [609 kB] Holen: 4 http://archive.ubuntu.com/ubuntu/ trusty/main nut all 2.7.1-1ubuntu1 [120 kB] Es wurden 876 kB in 2 s geholt (416 kB/s). [...] $ sudo cat >>/etc/nut/ups.conf <<EOF [Best_Power_Patriot_Pro_750] driver = bestups port = /dev/ttyS0 EOF // added user to nut group and logged out and back in // all that's necessary for a DRIVER test should be there now // UPS device is OFF (neither plugged in nor switched on, but serial cable plugged in) $ /lib/nut/bestups -a Best_Power_Patriot_Pro_750 -DDDDD Network UPS Tools - Best UPS driver 1.06 (2.7.1) 0.000000 debug level is '5' 0.000881 send_to_all: SETINFO device.type "ups" 0.000931 send_to_all: SETINFO driver.version "2.7.1" 0.000959 send_to_all: SETINFO driver.version.internal "1.06" 0.000986 send_to_all: SETINFO driver.name "bestups" 17.267267 Unable to detect a Best/SOLA or Phoenix protocol UPS $ stty -F /dev/ttyS0 speed 2400 baud; line = 0; min = 1; time = 0; -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke $ setserial -g /dev/ttyS0 /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 // note that the port has been reconfigured // UPS is plugged, on and connected $ /lib/nut/bestups -a Best_Power_Patriot_Pro_750 -DDDDD Network UPS Tools - Best UPS driver 1.06 (2.7.1) 0.000000 debug level is '5' 0.000809 send_to_all: SETINFO device.type "ups" 0.000861 send_to_all: SETINFO driver.version "2.7.1" 0.000890 send_to_all: SETINFO driver.version.internal "1.06" 0.000918 send_to_all: SETINFO driver.name "bestups" 0.648605 get_ident: got [PRO,750,230,230,20.0,27.3] 0.648678 send_to_all: SETINFO input.voltage.nominal "230" 0.648715 send_to_all: SETINFO output.voltage.nominal "230" 0.648749 send_to_all: SETINFO ups.mfr "Best Power" 0.648766 send_to_all: SETINFO ups.model "Patriot Pro 750" 0.648783 send_to_all: SETINFO battery.voltage.nominal "24" Detected Best Power Patriot Pro 750 on /dev/ttyS0 0.749072 send_to_all: ADDCMD test.battery.start 0.749128 send_to_all: ADDCMD test.battery.stop 1.149812 send_to_all: SETINFO battery.voltage "27.5" 1.149863 send_to_all: SETINFO input.voltage "233.0" 1.149895 send_to_all: SETINFO output.voltage "233.0" 1.149919 send_to_all: SETINFO ups.load "000" 1.149940 send_to_all: SETINFO input.frequency "50.0" 1.149965 send_to_all: SETINFO battery.charge "100.0" 1.149990 send_to_all: SETINFO ups.status "OL" 1.150011 send_to_all: DATAOK 1.150112 dstate_init: sock /var/run/nut/bestups-Best_Power_Patriot_Pro_750 open on fd 5 1.150155 send_to_all: SETINFO driver.parameter.pollinterval "2" 1.150193 send_to_all: SETINFO device.mfr "Best Power" 1.150230 send_to_all: SETINFO device.model "Patriot Pro 750" ^C -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 665 bytes Desc: OpenPGP digital signature URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20151127/62acc0dd/attachment.sig>
Olav Seyfarth
2015-Dec-02 17:59 UTC
[Nut-upsuser] Cannot access Patriot Pro II from new system
Dear list members, I'd like to setup my UPS in a way that it only shuts the server (including 5 VMs down if really necessary). We do have a rather stable power supply here, but there are multiple 200ms outages within a year and there also have been some that lasted more than half an hour. So: since the shudown is rather quick, I'd ideally set it to "shut down when only 20% battery left" (which should give at least five minutes power left, shutdown takes far less than one minute). BUT: I'm not sure if what I did should suffice. I followed the manual [http://www.networkupstools.org/docs/user-manual.chunked/ar01s06.html#UPS_shutdown]. But I may not have understand it properly. If I interpret it correctly, the following upsmon.conf would be sufficient to monitor and to initiate a system shutdown. Or is it *necessary* to setup the NOTIFYMSG and NOTIFYFLAG lines? RUN_AS_USER nut MONITOR Best_Power_Patriot_Pro_750 at localhost 1 upsmon SOMESECRET master MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown -h +0" POLLFREQ 5 POLLFREQALERT 5 HOSTSYNC 15 DEADTIME 15 POWERDOWNFLAG /etc/killpower RBWARNTIME 43200 NOCOMMWARNTIME 300 FINALDELAY 5 I am unsure since I found that another UPS [http://bernaerts.dyndns.org/linux/75-debian/335-debian-wheezy-install-monitor-eaton-ups] seems to feature a power threshold ...> # upsc eaton at localhost > battery.charge: 89 > *battery.charge.low: 20* > ...... but mine does not:> # upsc Best_Power_Patriot_Pro_750 > Init SSL without certificate database > battery.charge: 100.0 > battery.voltage: 27.5 > battery.voltage.nominal: 24 > device.mfr: Best Power > device.model: Patriot Pro 750 > device.type: ups > driver.name: bestups > driver.parameter.pollinterval: 2 > driver.parameter.port: /dev/ttyS0 > driver.version: 2.7.2 > driver.version.internal: 1.06 > input.frequency: 50.0 > input.voltage: 231.1 > input.voltage.nominal: 230 > output.voltage: 231.1 > output.voltage.nominal: 230 > ups.load: 000 > ups.mfr: Best Power > ups.model: Patriot Pro 750 > ups.status: OLSo I wonder whether it triggers (at which point? when totally depleted?) IN TIME to enable a clean shutdown. Could someone please point me to where (or what for) to look to configure that? Or is it not necessary? Or is my UPS not capable of triggering based on power left and I must use a time based setup (sleep in notifycmd) shown in this [https://srackham.wordpress.com/2013/02/27/configuring-nut-for-the-eaton-3s-ups-on-ubuntu-linux/] article? Or should I really have a script as complicated as in this [http://rogerprice.org/NUT.html] article? I really wan to keep things as simple as possible... The next thing is, that it seems to be necessary to tweak shutdown procedures. I'm on jessie, does anyone know where the debian maintainer EXPECTS me to do so? (Or don't I have to?) I really would like to understand things that are necessary for a MINIMAL solution using my hardware. Any links, hints or help appreciated! Thanks, Olav P.S.: Yes, ups load is correct, it's still connected via serial cable ONLY. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 665 bytes Desc: OpenPGP digital signature URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20151202/83b3990a/attachment.sig>
Roger Price
2015-Dec-02 18:49 UTC
[Nut-upsuser] Cannot access Patriot Pro II from new system
On Wed, 2 Dec 2015, Olav Seyfarth wrote:> I'd ideally set it to "shut down when only 20% battery left" (which > should give at least five minutes power left, shutdown takes far less > than one minute). BUT:>> # upsc eaton at localhost >> battery.charge: 89 >> *battery.charge.low: 20* >> ... > ... but mine does not:> Could someone please point me to where (or what for) to look to > configure that? Or is it not necessary? Or is my UPS not capable of > triggering based on power left and I must use a time based setup (sleep > in notifycmd) shown in this > [https://srackham.wordpress.com/2013/02/27/configuring-nut-for-the-eaton-3s-ups-on-ubuntu-linux/] > article? Or should I really have a script as complicated as in this > [http://rogerprice.org/NUT.html] article? I really wan to keep things as > simple as possible...Hi, The UPS doesn't report its battery charge, but since the DB-9 pinouts described in the User Guide, page 11 include a "Low Battery Alarm" you may be able to get enough from this to avoid a timer-based shutdown. You will probably need to do some experiments (without risking your server) to see what signals are received from the battery as it runs down to empty. For that you will need a suitable upsmon.conf with at least a NOTIFYFLAG LOWBATT SYSLOG+WALL NOTIFYFLAG ONBATT SYSLOG+WALL NOTIFYFLAG ONLINE SYSLOG+WALL Roger
Charles Lepple
2015-Dec-03 04:19 UTC
[Nut-upsuser] Cannot access Patriot Pro II from new system
On Dec 2, 2015, at 12:59 PM, Olav Seyfarth <olav at seyfarth.de> wrote:> > Dear list members, > > I'd like to setup my UPS in a way that it only shuts the server > (including 5 VMs down if really necessary). We do have a rather stable > power supply here, but there are multiple 200ms outages within a year > and there also have been some that lasted more than half an hour. So: > since the shudown is rather quick, I'd ideally set it to "shut down when > only 20% battery left" (which should give at least five minutes power > left, shutdown takes far less than one minute). BUT: > > I'm not sure if what I did should suffice. I followed the manual > [http://www.networkupstools.org/docs/user-manual.chunked/ar01s06.html#UPS_shutdown]. > But I may not have understand it properly. If I interpret it correctly, > the following upsmon.conf would be sufficient to monitor and to initiate > a system shutdown. Or is it *necessary* to setup the NOTIFYMSG and > NOTIFYFLAG lines?NOTIFYMSG and NOTIFYFLAG are not necessary to make the SHUTDOWNCMD work. However, if you want to use `upssched` and its timers, then NOTIFYCMD and `NOTIFYFLAG ... EXEC` are needed.> RUN_AS_USER nut > MONITOR Best_Power_Patriot_Pro_750 at localhost 1 upsmon SOMESECRET master > MINSUPPLIES 1 > SHUTDOWNCMD "/sbin/shutdown -h +0" > POLLFREQ 5 > POLLFREQALERT 5 > HOSTSYNC 15 > DEADTIME 15 > POWERDOWNFLAG /etc/killpower > RBWARNTIME 43200 > NOCOMMWARNTIME 300 > FINALDELAY 5This should be sufficient. (Many of those are default values, too, if you want to simplify that file.)> > I am unsure since I found that another UPS > [http://bernaerts.dyndns.org/linux/75-debian/335-debian-wheezy-install-monitor-eaton-ups] > seems to feature a power threshold ... > >> # upsc eaton at localhost >> battery.charge: 89 >> *battery.charge.low: 20* >> ... > > ... but mine does not: > >> # upsc Best_Power_Patriot_Pro_750 >> Init SSL without certificate database >> battery.charge: 100.0 >> battery.voltage: 27.5 >> battery.voltage.nominal: 24 >> device.mfr: Best Power >> device.model: Patriot Pro 750 >> device.type: ups >> driver.name: bestups >> driver.parameter.pollinterval: 2 >> driver.parameter.port: /dev/ttyS0 >> driver.version: 2.7.2 >> driver.version.internal: 1.06 >> input.frequency: 50.0 >> input.voltage: 231.1 >> input.voltage.nominal: 230 >> output.voltage: 231.1 >> output.voltage.nominal: 230 >> ups.load: 000 >> ups.mfr: Best Power >> ups.model: Patriot Pro 750 >> ups.status: OL > > So I wonder whether it triggers (at which point? when totally depleted?) > IN TIME to enable a clean shutdown.It is unclear what threshold the UPS uses to determine when to send the LB signal - it is not in any of the manuals I have seen. I thought I had some battery.charge logs from a Patriot Pro II, but I don't really remember doing deep discharge tests. For future reference, the latest code (post-2.7.3) in nutdrv_qx can send the "TL" command ("test.battery.start.deep"), which tests the battery until the UPS considers it low. You might be able to get away with sending that command to the UPS manually (using "echo"), or by temporarily stopping the driver, and running minicom or another terminal emulator. Then, you can log the battery.charge values over time. I would recommend plugging in a dummy load (such as a lamp) to speed up the discharge process.> Could someone please point me to where (or what for) to look to > configure that? Or is it not necessary? Or is my UPS not capable of > triggering based on power left and I must use a time based setup (sleep > in notifycmd) shown in this > [https://srackham.wordpress.com/2013/02/27/configuring-nut-for-the-eaton-3s-ups-on-ubuntu-linux/] > article? Or should I really have a script as complicated as in this > [http://rogerprice.org/NUT.html] article? I really wan to keep things as > simple as possible...Although we generally recommend this for an UPS that provides either battery.charge or battery.runtime (for yours, battery.charge is estimated by the driver), there is an "ignorelb" flag that would allow you to shut down at an arbitrary battery.charge level (once the power goes out, of course). Then you don't need to worry about timers. http://www.networkupstools.org/docs/man/ups.conf.html#_global_directives> The next thing is, that it seems to be necessary to tweak shutdown > procedures. I'm on jessie, does anyone know where the debian maintainer > EXPECTS me to do so? (Or don't I have to?)Theoretically, the Debian shutdown scripts should have been modified already. I don't speak systemd natively, so I'm not sure what to look for there, but it used to work with sysvinit. -- Charles Lepple clepple at gmail
Charles Lepple
2015-Dec-03 04:21 UTC
[Nut-upsuser] Cannot access Patriot Pro II from new system
On Dec 2, 2015, at 12:59 PM, Olav Seyfarth <olav at seyfarth.de> wrote:> > [https://srackham.wordpress.com/2013/02/27/configuring-nut-for-the-eaton-3s-ups-on-ubuntu-linux/]Also, this blog has moved, and in the process, Stuart updated the post for Ubuntu 14.04: http://blog.srackham.com/posts/configuring-nut-for-the-eaton-3s-ups-on-ubuntu-linux/ -- Charles Lepple clepple at gmail