Re: [Nut-upsuser] Cannot access Patriot Pro II from new system

2015-12-02 Thread Olav Seyfarth
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@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@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.

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.



signature.asc
Description: OpenPGP digital signature
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] Cannot access Patriot Pro II from new system

2015-12-02 Thread Roger Price

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@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


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] Cannot access Patriot Pro II from new system

2015-11-26 Thread Olav Seyfarth
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 RxD
I 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
// 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 <

signature.asc
Description: OpenPGP digital signature
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] Cannot access Patriot Pro II from new system

2015-11-23 Thread Charles Lepple
On Nov 23, 2015, at 10:21 AM, Olav Seyfarth  wrote:
> 
> I've noticed this tread:
> http://lists.alioth.debian.org/pipermail/nut-upsdev/2014-November/006801.html
> But unless I misunderstood something, the driver bestups should still
> work in jessie, right?

It should still work.

> Might this be a clable issue?
> 
> The cable is the original cable that used to work with Best software (on
> Windows XP) and NUT (unsure which version, default repos). I checked
> it's wiring, it's as described in
> http://www.networkupstools.org/cables.html#_phoenixtec_best_power except
> that PC Pins 1,8 and 9 are connected to ground/shield.
> 
> Or a serial setup failure?
> 
> stty tells me that the driver sets speed to 2400baud, but does that mean
> that the driver can establish a connection to the device?
> How to tell?

There is no hardware handshaking, so the only way to tell is to send commands 
to the UPS.
> 
> If I interpreted other posts correctly, I should be able to use a
> terminal program to access the UPS device. So I started minicom  -D
> /dev/ttyS0 (without and with " -b 2400" or " -b 9600") and tried to
> enter "Q1 \r" but I don't even get a local echo.

I think minicom defaults to enabling hardware handshaking, so try turning that 
off (^A, O, "Serial port setup", F).

> So what does that mean and what else can I try?
> 
> Thank you for your ideas and hints!
> Olav
> 
> P.S.: Once it works, should I contribute my values to
> https://github.com/networkupstools/nut-ddl/tree/master/Best_Power ? How?

You can open an issue on the DDL repository, and include the output of "upsc", 
"upsrw", and "upscmd -l". I think the latter two will be mostly empty-- I'd 
check, but I am actually running the newer nutdrv_qx, which wasn't released 
until NUT 2.7.3.

> My new machine is ASUS H7-Plus; it has an internal serial connector
> (with tappet(?) so that I can only plug the internal cable in one way)
> but I bought a 3rd pary shield.

If you have a jumper wire handy, you can connect the PC's TxD to RxD, and check 
that characters are echoed in minicom. Then check the continuity to the serial 
port.
> 
> # setserial -gav /dev/ttyS0
> /dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4
>Baud_base: 115200, close_delay: 50, divisor: 0
>closing_wait: 3000
>Flags: spd_normal skip_test

Curious about the "skip_test" option...

> ___
> Nut-upsuser mailing list
> Nut-upsuser@lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

-- 
Charles Lepple
clepple@gmail




___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser