View RSS Feed

James' openSUSE Bash Scripting (and other things) Blog - Your Comments are Welcome!

APC UPS Monitor applications apcupsd & apcupsd-gui (gapcmon) installation and the new openSUSE 12.3

Rate this Entry
by , 12-Mar-2013 at 19:30 (1141 Views)
The two YaST Software Applications apcupsd & apcupsd-gui are used to monitor your APC branded UPS in Linux and can, among other things, do an orderly shut down of your PC on an extended power failure. apcupd/apcupsd-gui application versions 3.14.10 or higher should be used to get this program working properly. The apcupsd application gapcmon has been fully converted to work with systemd in openSUSE 12.3. You no longer use the YaST Run Level editor to set the service to operate.

The proper sequence of events to get this APC UPS application working properly are as follows:

1. Connect your APC branded and supported UPS to your Linux PC, preferably by USB, but serial is also supported.
2. Using YaST / Software / Software Management, search for apcupsd & apcupsd-gui and install them from YaST as normal.
3. Edit the /etc/apcupsd/apcupsd.conf file as root. You can use an application such as my SYSEdit bash script to make these changes for a usb connection:

Code:
UPSCABLE usb

UPSTYPE usb
DEVICE
SYSEdit - System File Editor - Version 1.50: https://forums.opensuse.org/blogs/jd...rsion-1-00-60/

4. Open up a terminal session and type in the following command:

Code:
sudo /bin/systemctl enable /usr/lib/systemd/system/apcupsd.service

sudo /bin/systemctl start apcupsd.service
5. To Autostart in KDE, I normally goto menu / Configure Desktop / Startup & Shutdown / Autostart / Add Program / Search to / System / Monitor / APCUPSD Monitor and Press OK.

6. Start the APCUPSD Monitor manually and on the Preference Tab / Click Add and check Enabled and Use Icon Tray.

7. Restart Your PC and you should be set.

Once apcupsd is working, you should see the following icons in your (KDE) System Tray. You get a plug icon per UPS monitored when this is more than one UPS and only one UPS labeled icon :



When you hover your mouse pointer over the plug, you get this:



The Plug when selected offers up this screen:



The UPS icon is used to configure your UPS monitor after it gets installed:



And as you can see, there are even more options and selections to see.

Online Resources: http://www.apcupsd.com/ & http://gapcmon.sourceforge.net/

Thank You for using openSUSE,

Submit "APC UPS Monitor applications apcupsd & apcupsd-gui (gapcmon) installation and the new openSUSE 12.3" to Digg Submit "APC UPS Monitor applications apcupsd & apcupsd-gui (gapcmon) installation and the new openSUSE 12.3" to del.icio.us Submit "APC UPS Monitor applications apcupsd & apcupsd-gui (gapcmon) installation and the new openSUSE 12.3" to StumbleUpon Submit "APC UPS Monitor applications apcupsd & apcupsd-gui (gapcmon) installation and the new openSUSE 12.3" to Google Submit "APC UPS Monitor applications apcupsd & apcupsd-gui (gapcmon) installation and the new openSUSE 12.3" to Facebook Submit "APC UPS Monitor applications apcupsd & apcupsd-gui (gapcmon) installation and the new openSUSE 12.3" to Twitter

Comments

  1. nrickert's Avatar
    This problem has been reported as bug 801312.

    It is easier to add a symbolic link

    /sbin/apcupsd --> /usr/sbin/apcupsd
  2. jdmcdaniel3's Avatar
    Quote Originally Posted by nrickert
    This problem has been reported as bug 801312.

    It is easier to add a symbolic link

    /sbin/apcupsd --> /usr/sbin/apcupsd
    Let me say it is best that the service file be fixed in the repository file so no kludges are required. Hopefully it will be fixed soon.

    Thank You,
  3. jdmcdaniel3's Avatar
    apcupsd & apcupsd-gui 3.14.10 has fixed the problem and so I have converted this blog to a short tutorial on installing apcupsd.

    Thank You,
  4. FlameBait's Avatar
    jdmcdaniel3

    I tried setting up apcmon via your instructions
    but I got the following dialog. I can't connect to the UPS
    from APCUPSD monitor so I assume it's not started.
    How to proceed?


    "flamebait@fuuyuu:~> sudo /bin/systemctl enable /usr/lib/systemd/system/apcupsd.service

    We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

    root's password:
    ln -s '/usr/lib/systemd/system/apcupsd.service' '/etc/systemd/system/multi-user.target.wants/apcupsd.service'
    flamebait@fuuyuu:~> sudo /bin/systemctl start apcupsd.service"
  5. jdmcdaniel3's Avatar
    Quote Originally Posted by FlameBait
    jdmcdaniel3

    I tried setting up apcmon via your instructions
    but I got the following dialog. I can't connect to the UPS
    from APCUPSD monitor so I assume it's not started.
    How to proceed?


    "flamebait@fuuyuu:~> sudo /bin/systemctl enable /usr/lib/systemd/system/apcupsd.service

    We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

    root's password:
    ln -s '/usr/lib/systemd/system/apcupsd.service' '/etc/systemd/system/multi-user.target.wants/apcupsd.service'
    flamebait@fuuyuu:~> sudo /bin/systemctl start apcupsd.service"
    I would open up terminal and try these two commands to see what you get:

    Code:
    cat /usr/lib/systemd/system/apcupsd.service
    
    [Unit]
    Description=APC UPS Power Control Daemon for Linux
    After=syslog.target
    After=network.target
    
    [Service]
    ExecStartPre=-/bin/rm -f /etc/apcupsd/powerfail
    ExecStart=/usr/sbin/apcupsd -b -f /etc/apcupsd/apcupsd.conf
    
    [Install]
    WantedBy=multi-user.target
    <AND>

    Code:
    /bin/systemctl status apcupsd.service
    
    apcupsd.service - APC UPS Power Control Daemon for Linux
              Loaded: loaded (/usr/lib/systemd/system/apcupsd.service; enabled)
              Active: active (running) since Wed, 2013-05-08 20:26:10 CDT; 1 day and 20h ago
             Process: 1319 ExecStartPre=/bin/rm -f /etc/apcupsd/powerfail (code=exited, status=0/SUCCESS)
            Main PID: 1325 (apcupsd)
              CGroup: name=systemd:/system/apcupsd.service
                      └ 1325 /usr/sbin/apcupsd -b -f /etc/apcupsd/apcupsd.conf
    Post your results here if either is different.

    Thank You,
  6. FlameBait's Avatar
    I must have my configuration in apcupsd.conf wrong.
    Not sure about the code tags I hope they work

    [CODE]
    flamebait@fuuyuu:~> cat /usr/lib/systemd/system/apcupsd.service
    [Unit]
    Description=APC UPS Power Control Daemon for Linux
    After=syslog.target
    After=network.target

    [Service]
    ExecStartPre=-/bin/rm -f /etc/apcupsd/powerfail
    ExecStart=/usr/sbin/apcupsd -b -f /etc/apcupsd/apcupsd.conf

    [Install]
    WantedBy=multi-user.target
    flamebait@fuuyuu:~> /bin/systemctl status apcupsd.service
    apcupsd.service - APC UPS Power Control Daemon for Linux
    Loaded: loaded (/usr/lib/systemd/system/apcupsd.service; enabled)
    Active: failed (Result: exit-code) since Fri, 2013-05-10 12:37:59 PDT; 18h ago
    Process: 1172 ExecStart=/usr/sbin/apcupsd -b -f /etc/apcupsd/apcupsd.conf (code=exited, status=1/FAILURE)
    Process: 1141 ExecStartPre=/bin/rm -f /etc/apcupsd/powerfail (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/apcupsd.service
    [/CODE]
  7. FlameBait's Avatar
    I got it playing. By changing the DEVICE setting to blank.

    DEVICE <BLANK>

    It's working on a clean install of 12.3 now.
  8. jdmcdaniel3's Avatar
    Quote Originally Posted by FlameBait
    I got it playing. By changing the DEVICE setting to blank.

    DEVICE <BLANK>

    It's working on a clean install of 12.3 now.
    Yes, when editing the /etc/apcupsd/apcupsd.conf file, for USB to work you must set the following values:

    Code:
    UPSCABLE usb  
    
    UPSTYPE usb 
    DEVICE
    I did show this in the first code # in the blog post.

    Thank You,

Search Engine Friendly URLs by vBSEO 3.5.2 PL2