Richard Chapman
2009-May-20 10:11 UTC
[Nut-upsuser] upsmon shutdown based on Time since power fail.
For various reasons - I have been trying to get my Desktops and/or servers to shut-down a fixed time after a power fail - or better still a fixed time - or a low battery whichever comes first. I note in my upsc: *> upsc belkinusb* battery.charge: 100 battery.charge.low: 30 battery.charge.warning: 30 battery.runtime: 120 battery.type: PbAc battery.voltage: 27.3 battery.voltage.nominal: 24 driver.name: usbhid-ups driver.parameter.pollinterval: 2 driver.parameter.port: auto driver.version: 2.2.0- driver.version.data: Belkin HID 0.1 driver.version.internal: 0.30 input.frequency: 50.0 input.frequency.nominal: 50 input.sensitivity: normal input.transfer.high: 264 input.transfer.high.max: 269 input.transfer.high.min: 259 input.transfer.low: 187 input.transfer.low.max: 192 input.transfer.low.min: 182 input.voltage: 247.4 input.voltage.nominal: 230 output.frequency: 50.0 output.voltage: 248.4 ups.beeper.status: enabled ups.delay.restart: 0 ups.delay.shutdown: 0 ups.firmware: 2 ups.load: 52 ups.load.high: 100 ups.mfr: Belkin ups.model: UPS ups.power.nominal: 1200 ups.productid: 0912 ups.serial: 01 ups.status: OL CHRG ups.test.result: Done and passed ups.type: offline ups.vendorid: 050d the battery runtime is set to 120 - though the UPS runs much longer than 120 seconds on battery. I am therefore not sure what this parameter means. Moreover upsrw shows: *> upsrw belkinusb* [input.sensitivity] Input power sensitivity Type: STRING Value: normal [input.transfer.high] High voltage transfer point Type: STRING Value: 264 [input.transfer.low] Low voltage transfer point Type: STRING Value: 187 [ups.beeper.status] UPS beeper status Type: STRING Value: enabled Which I think means these are the only parameters I can change in the UPS. Is there another parameter somewhere - probably in upsmon - which would allow me to specify a shut-down after (say) 3 minutes running on battery regardless of battery status? One of the reasons for this request is that I have a desktop and a server running from the same UPS - and would like to ensure the desktop shuts down (or better still hibernates) before the server shuts down. If there is some documentation somewhere covering this question - please feel free to point me to the documentation. Regards Richard.
Jon Bendtsen
2009-May-20 10:55 UTC
[Nut-upsuser] upsmon shutdown based on Time since power fail.
On 20/05/2009, at 12.11, Richard Chapman wrote:> For various reasons - I have been trying to get my Desktops and/or > servers to shut-down a fixed time after a power fail - or better > still a fixed time - or a low battery whichever comes first.[cuuuuut]> Is there another parameter somewhere - probably in upsmon - which > would allow me to specify a shut-down after (say) 3 minutes running > on battery regardless of battery status?In the upsmon.conf file you use NOTIFYCMD and ONBATT to execute a shutdown $time Then you use a ONLINE to execute a -c to cancel a shutdown if the power returns. JonB
Arjen de Korte
2009-May-25 20:23 UTC
[Nut-upsuser] upsmon shutdown based on Time since power fail.
Citeren Richard Chapman <rchapman op aardvark.com.au>:> This sounds like one way to do it. If I do it this way - do you know > whether the file: > > /etc/killpower > > will be created before the shut-down is issued (as it would if the > battery low event occurs). If not - the UPS may not be shut down - > and therefore the system may not start up again if the power returns > before the battery is completely flat. > > I guess if the flag file isn't created - then we could run a short > script to create it - then issue the shut-down.... Does that sound > right to you? Indeed - if we do write a short script - we could do > the delay in the script - somehow test whether we are still on > battery - and if so - issue the shut-down immediately.Don't do this. As written in the FAQ, in some cases you may wish/need to use 'upssched' to start shutting down your systems before the UPS indicates the battery is low. In that case, you probably want to call 'upsmon -c fsd' instead, which will initiate a shutdown on the upsmon master (in your case, your server). This means that you will have to configure the upsmon on the server (FINALDELAY) to allow for enough time for your clients to shutdown. This will put your master at risk in case of repeated power failures however, so don't overdo this. Best regards, Arjen -- Please keep list traffic on the list
Seemingly Similar Threads
- Belkin USB UPS Not Turning Off
- Another New User Question - Notify Script Not Running
- upsmon keeps broadcasting on battery / on power (driver is newhidups)
- upsmon keeps broadcasting on battery / on power (driver is newhidups)
- New User Questions - With Belkin USB