PWRSTAT(8)

NAME
pwrstat - The UPS power state command tool

SYNOPSIS
 pwrstat [-help]|[-version]|[-reset]|
 pwrstat [-status]|[-config]|[-alarm on|off]|[-mute]|[-test]|[-hibernate on|off]|
 pwrstat [-pwrfail [-active on|off][-delay sec][-duration sec][-cmd name][-shutdown on|off]]
 pwrstat [-lowbatt [-active on|off][-runtime sec][-capacity %][-duration sec][-cmd name][-shutdown on|off]]

DESCRIPTION
The pwrstat program will help user to get status of the UPS and settings of the UPS and pwrstatd daemon. It also allow user to configure UPS and pwrstatd daemon.

OPTIONS
No arguments    Display help content.(Same as "-help")

-status
    Display current status of ups.

-config
    Display all daemon configurations.

-reset
    Reset all daemon configurations to default.

-help
    Display help content.

-version
    Display the version of program.

-alarm
    Setup alarm action of ups.

-mute
    Setup temporally mute alarm when alarm is on enable state.

-test
    To verify the UPS will work well in battery power.

-hibernate
    Setup hibernate to instead of system shutdown when power event occurred.

-pwrfail
    Setup the settings of command-execution for power failure.
     (This must be the first argument.)

-lowbatt
    Setup the settings of command-execution for low battery.
     (This must be the first argument.)

-delay*
    Setup delay seconds when event occured.

-runtime*
    Setup remaining runtime threshold to identify low battery event.

-capacity*
    Setup low battery capacity threshold to identify low battery event.

-active*
    Setup command-execution or not when event occured.

-cmd*
    Assign command file when event occured.

-duration*
    Setup duration seconds of command-execution when event occured.

-shutdown*
    Setup shutdown OS or not when event occured.

Note:
    Arguments with "*" must follow "-pwrfail" or "-lowbatt".

EXAMPLE
Setup action for power failure as example
 pwrstat -pwrfail -delay 60 -active on -cmd /etc/pwrstatd-powerfail.sh -duration 1 -shutdown on

 As above setting, it will take 1 second to run a shell script /etc/pwrstatd-powerfail.sh and
 shutdown system since utility power has failure for 1 minute.

Setup action for low battery as example
 pwrstat -lowbatt -runtime 300 -capacity 35 -active on -cmd /etc/pwrstatd-lowbatt.sh -duration 1 -shutdown on

 As above setting, it will take 1 second to run a shell script /etc/pwrstatd-lowbatt.sh and
 shutdown system since UPS's remaining runtime has low than 300 seconds or battery capacity has low than 35 %.

Note.

1.  The battery capacity Threshold can be chnaged in file /etc/pwrstatd.conf.

2.  The parameter -pwrfail and -lowbatt are exclusively.

3.  The unit of options -delay is second.

4.  Both shell script /etc/pwrstatd-powerfail.sh and /etc/pwrstatd-lowbatt.sh were copied in installation procedure.

5.  The parameter -pwrfail least one of parameter -delay, -active, -cmd, -duration or -shutdown is necessary.

6.  The parameter -lowbatt least one of parameter -runtime, -capacity, -active, -cmd, -duration or -shutdown is necessary.

7.  The options of -cmd can be any shell script in system, but it will be run by root authority.

8.  The default action setting for both of -pwrfail and -lowbatt are same as above setting of example.

Setup UPS alarm
 pwrstat -alarm on
 pwrstat -alarm off

 To turn UPS's alarm On or Off.

Setup UPS mute temporary
 pwrstat -mute

To mute UPS's alarm for this power event until next one.

Setup UPS to do a battery test
 pwrstat -test

To verify the UPS will work well in battery power.

Setup hibernation
 pwrstat -hibernate

Using hibernate to instead of system shutdown when power event occurred.

SEE ALSO
pwrstatd(8)

COPYRIGHT
Copyright(c) 2015. All rights reserved.