28 ??????? 2016??. 4:18:06 CEST, Raymond Day <raymondday at hotmail.com> ?????:>I forgot how I ask this. But I just found out. It's a list here: > >http://lists.alioth.debian.org/pipermail/nut-upsdev/2016-October/007229.html > >Thanks again. Seems like it's working real good. > >Is there a way to test if it will turn off my server when the battery >power goes to low? > >-Raymond Day > > >On 10/27/2016 8:37 AM, Charles Lepple wrote: >>> On Oct 27, 2016, at 6:43 AM, Raymond Day <raymondday at hotmail.com> >wrote: >>> >>> So looks like it's working Thank you. Were is the page I ask for >this >>> help? This e-mail don't have the link looks like. >> You're welcome. The links don't get sent if you're on the "To:" or >"CC:" list, but here they are: >> >> _______________________________________________ >> Nut-upsdev mailing list >> Nut-upsdev at lists.alioth.debian.org >> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev > > >_______________________________________________ >Nut-upsdev mailing list >Nut-upsdev at lists.alioth.debian.org >http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdevA short answer might be to set up upsmon with a custom SHUTDOWNCMD that would report (log) that/when it is going to shutdown. Except for the test it will not actually shut down, just report. For a larger integration test, involving actual shutdowns (and how long they take - so you know how much runtime + headspace your ups must have remaining to trigger the event) and perhaps poweroff of the UPS and whether it comes back up when wallpower comes back, you might stage a real production shutdown. Also, to test just the UPS part you do not have to powercycle the server - you can run the upscmd's involved in the shutdown routine against the UPS which is not actually powering your system at the moment. Note that some UPSes do require non-trivial load to operate - then perhaps a display might suffice, or one of redundant server PSUs. Hope this helps, Jim Klimov -- Typos courtesy of K-9 Mail on my Samsung Android
Wow thanks for all your help. I unplug the power to the UPS and did the command "upsc serverups" to see if the "battery.charge: 100" would go down. I watched some videos so it's hard drive would spin up to use more power. After about a hour it did go down to "battery.charge: 90" So it is working. Not sure if it will turn off at 20% of battery that's what it looks like it says. This Odroid-u2 uses very little power and I have two WD green 3TB drives on it though USB. I guess it could stay up about 8 hours from only going down 90% in about a hour. Even more if the hard drives are in sleep mode. I know with time that battery will degrade and it will not last as long then. Looks like this is working good. Thank you for the code to get it working. As I typed this it went down to 84%. It was 90% about 5 min. ago so I guess it will not last 8 hours. Looks like it goes down faster as time goes by. root at odroid-u2:~# upsc serverups battery.charge: 84 battery.charge.low: 10 battery.charge.warning: 20 battery.mfr.date: CPS battery.runtime: 5355 battery.runtime.low: 300 battery.type: PbAcid battery.voltage: 8.7 battery.voltage.nominal: 12 device.mfr: CPS device.model: SX650G device.type: ups driver.name: usbhid-ups driver.parameter.pollfreq: 30 driver.parameter.pollinterval: 2 driver.parameter.port: auto driver.version: 2.6.4 driver.version.data: CyberPower HID 0.3 driver.version.internal: 0.37 input.transfer.high: 0 input.transfer.low: 0 input.voltage: 0.0 input.voltage.nominal: 120 output.voltage: 120.0 ups.beeper.status: enabled ups.delay.shutdown: 20 ups.delay.start: 30 ups.load: 0 ups.mfr: CPS ups.model: SX650G ups.productid: 0501 ups.realpower.nominal: 375 ups.status: OB DISCHRG ups.test.result: No test initiated ups.timer.shutdown: -60 ups.timer.start: 0 ups.vendorid: 0764 root at odroid-u2:~# Going to plug the power back in now. It does work because plugging the power back in this part changed: ups.status: OB DISCHRG to: ups.status: OL CHRG Is there any way to get some of this info to show up in phpsysinfo ? -Raymond Day
I got it working in phpsysinfo. Just had to edit a line in /usr/share/phpsysinfo/config.php Looked for UPS in that file. It said this: /** * Define the ups monitoring program (!!!names are case-sensitive!!!) * We support the following programs so far * - 1. Apcupsd http://www.apcupsd.com/ * - 2. Nut http://www.networkupstools.org/ * Example: If you want to use Apcupsd : define('PSI_UPS_PROGRAM', 'Apcupsd'); */ So I replace there line like this: define('PSI_UPS_PROGRAM', 'Nut'); It's at the end of the config.php file. I got this screen shot of how it looks now. Neat that is shows the UPS info in the bottom right corner. https://goo.gl/photos/37N7QPimdeQMWXUC7 -Raymond Day
I went to the link to test the power off if the battery gets to low. Here is what I got on the command line. root at odroid-u2:/etc/nut# /usr/local/ups/bin/upsdrvctl -t shutdown -bash: /usr/local/ups/bin/upsdrvctl: No such file or directory root at odroid-u2:/etc/nut# find / -name upsdrvctl /sbin/upsdrvctl ^C root at odroid-u2:/etc/nut# /sbin/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.007145 Shutdown UPS: serverups 0.007618 exec: /lib/nut/usbhid-ups -a serverups -k root at odroid-u2:/etc/nut# So I guess it's saying it will not work but to copy and paste some place the line at the end. It that right? If so what file do I copy and paste it in? -Raymond Day -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20161030/dd09b4a6/attachment.html>