Blog Comments

  1. oldcpu's Avatar
    Out of curiousity, I plugged my monitor into my PC (together with low power speakers and the desktop PC itself), and then I removed the input power to the UPS. I did this to check the load. This is what "pwrstat -status" yields:


    and this is what "pwrstat -status" yields after power is restored to the UPS.

    The load only being ~90-watts surprised me, so I suspect that is inaccurate. Note the estimate of time in which power may be available, once on battery is down to ~31-minutes.
  2. oldcpu's Avatar
    After a couple of days with the UPS setup, I installed the rpm version of the CyberPower "powerpanel" software, which can be located on their website here.

    In addition for MS-Windows and MacOS installation downloads, they also have downloads for GNU/Linux, where it is packaged as a .deb, rpm, and .tar. I downloaded the 64-bit rpm "PPL_64bit (rpm)_v1.3.2.rpm" .

    Installation

    I simply used zypper to install (with root permissions):
    Code:
    zypper in PPL_64bit (rpm)_v1.3.2.rpm
    and I selected to ignore that the package was not signed.

    I received some errors as part of the install, suggesting to me the install was successful, but that the daemon did not start. These being:
    Code:
    //etc/init.d/pwrstatd,start=2,3,4,5 doesn't exist at /sbin/insserv line 246. 
    ...
    /sbin/insserv failed, exit code 1
    redirecting to systemctl start pwrstatd.service
    Failed to start pwrstatd.service: Unit pwrstatd.service not found.
    I checked the /etc directory and I noted the various scripts installed
    • hibernate.sh
    • pwrstadt-email.sh
    • pwrstadt-lowbatt.sh
    • pwrstadt-powerfail.sh
    • pwrstadt.conf
    • shutdown.sh


    Starting the daemon via the Service Manager

    I then checked under YaST > System > Services Manager, and I did not see "pwrstatd" listed as a service. That suggested it was not yet detected by the openSUSE LEAP-15.0 system after the rpm install (as suggested by the errors). I speculated that it might be detected after a restart of the services manager, so I rebooted, and again when into YaST > System > Services Manager. This time I noted the service present, but it was not running:



    Further not only was it "Inactive(Dead)" but it was on a Start=Manually. So I changed the Start=On Boot, and activated the service. This is what I see then:


    .


    Status of the UPS via Power Panel

    Nominally 'pwrstat' requires root permissions to run. With the service started, I then typed :
    Code:
     linux-p15v:/etc # pwrstat -config
    
    Daemon Configuration:
    
    Alarm .............................................. On
    Hibernate .......................................... Off
    
    Action for Power Failure:
    
            Delay time since Power failure ............. 60 sec.
            Run script command ......................... On
            Path of script command ..................... /etc/pwrstatd-powerfail.sh
            Duration of command running ................ 0 sec.
            Enable shutdown system ..................... On
    
    Action for Battery Low:
    
            Remaining runtime threshold ................ 300 sec.
            Battery capacity threshold ................. 35 %.
            Run script command ......................... On
            Path of command ............................ /etc/pwrstatd-lowbatt.sh
            Duration of command running ................ 0 sec.
            Enable shutdown system ..................... On
    I figured that a good sign, indicating it was now running as a daemon, using default emergency settings.

    Edit configuration files and restarting the pwrstatd service

    I then opened (with root permissions such that I could edit if desired) the file "/etc/pwrstadt.conf". I made a couple of changes, and saved the file. I noted the file stated to restart the daemon, to type:
    Code:
    /etc/init.d/pwrstatd restart
    but that yielded:
    Code:
    linux-p15v:/etc # /etc/init.d/pwrstatd restart
    redirecting to systemctl restart pwrstatd.service
    Simply typing:
    Code:
    systemctl restart pwrstatd.service
    worked fine.
    .

    Various Power Panel commands

    One can obtain the various command options from the pwrstat program by typing:
    Code:
    pwrstat -help
    and get status by typing:
    Code:
    pwrstat -status
    There is a good man page, which can be read by typing:
    Code:
    man pwrstat
    Its a pretty basic command line series of configuration files ... at least it is for myself, and reminds me of my early days in GNU/Linux over 20 years ago.
    .