Apcupsd unofficial addon…



  • I use apcupsd all over my network and I really wanted my firewall to be included as well. Here is a small guide on how I got it running. I use a remote apcupsd server running as master, so my pfsense (v1.2.3-RELEASE) box  is a network slave.

    #Install the packages:
    pkg_add -r apcupsd

    #Set up apcupsd to run at startup:
    mv /usr/local/etc/rc.d/apcupsd /usr/local/etc/rc.d/apcupsd.sh
    mv /usr/local/etc/apcupsd/apcupsd.conf.sample /usr/local/etc/apcupsd/apcupsd.conf

    #Modify the config file, see below for my full config.

    vi /usr/local/etc/apcupsd/apcupsd.conf

    #Edit the following file to enable startup at boot time:
    vi /etc/defaults/rc.conf

    #Add the following line in the Miscellaneous administrative options section:
    apcupsd_enable="YES"    # Run apcupsd

    #Finally start her up:
    /usr/local/etc/rc.d/apcupsd.sh start

    #apcupsd should now be running:

    ps -aux | grep apc
    root   21209  0.0  0.2  6488  2120  ??  Ss   12:28PM   0:00.02 /usr/local/sbin/apcupsd –kill-on-powerfail

    #Run apcaccess to see all is well.

    Here is my full apcupsd.conf file:

    cat apcupsd.conf | grep -v # | grep -v ^$

    UPSNAME UPSSERVER
    UPSCABLE ether
    UPSTYPE net
    DEVICE 192.168.1.1:3551
    POLLTIME 10
    LOCKFILE /var/spool/lock
    SCRIPTDIR /usr/local/etc/apcupsd
    PWRFAILDIR /var/run
    NOLOGINDIR /var/run
    ONBATTERYDELAY 6
    BATTERYLEVEL 5
    MINUTES 3
    TIMEOUT 0
    ANNOY 300
    ANNOYDELAY 60
    NOLOGON disable
    KILLDELAY 0
    NETSERVER on
    NISIP 127.0.0.1
    NISPORT 3551
    EVENTSFILE /var/log/apcupsd.events
    EVENTSFILEMAX 10
    UPSCLASS standalone
    UPSMODE disable
    STATTIME 0
    STATFILE /var/log/apcupsd.status
    LOGSTATS off
    DATATIME 0

    Hope this helps some of you out there.

    • LiGHT

    EDIT:  I updated this guide for the latest version - 4/10/10



  • thanks!  i am running apcsupsd on 3 linux boxes, and my (about to be installed) pfsense gateway could use it too…


Log in to reply