License

Copyright (C) 2008-2021 Oliver Bohlen.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.

A copy of the license is included in the section entitled "GNU Free Documentation License".

Introduction

This documentation comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.

Howto: APC UPS for Gentoo Linux

Changes in /etc/apcupsd/apccontrol

File permissions:
Owner: root
Group: root
Permissions: -rwxr--r--

Click here for a download of the complete file: /etc/apcupsd/apccontrol

Changed on 16.05.18
Issued by olli
Beginning line 28

eMail notificvation


Before change
export SYSADMIN=root
After change
export SYSADMIN=root,user1

Changes in /etc/apcupsd/apcupsd.conf

File permissions:
Owner: root
Group: root
Permissions: -rw-r--r--

Click here for a download of the complete file: /etc/apcupsd/apcupsd.conf

Changed on 16.05.18
Issued by olli
Beginning line 15

Optional UPS name


Before change
#UPSNAME
After change
UPSNAME usvxgabo

Changed on 16.05.18
Issued by olli
Beginning line 139

System shutdown below battery level


Before change
BATTERYLEVEL 0
After change
BATTERYLEVEL 5

Changed on 16.05.18
Issued by olli
Beginning line 148

System shutdown below remaining runtime on battery


Before change
MINUTES 0
After change
MINUTES 5

Changes in /etc/apcupsd/changeme

File permissions:
Owner: root
Group: root
Permissions: -rwxr--r--

Click here for a download of the complete file: /etc/apcupsd/changeme

Changed on 16.05.18
Issued by olli
Beginning line 20

Battery Change Notification

(
   /sbin/apcaccess status
   echo " "
   echo "$MSG"
) | /usr/local/sbin/xmppsend mail@example.com

Changes in /etc/apcupsd/commfailure

File permissions:
Owner: root
Group: root
Permissions: -rwxr--r--

Click here for a download of the complete file: /etc/apcupsd/commfailure

Changed on 16.05.18
Issued by olli
Beginning line 20

Communication failure Notification

(
   /sbin/apcaccess status
   echo " "
   echo "$MSG"
) | /usr/local/sbin/xmppsend mail@example.com

Changes in /etc/apcupsd/commok

File permissions:
Owner: root
Group: root
Permissions: -rwxr--r--

Click here for a download of the complete file: /etc/apcupsd/commok

Changed on 16.05.18
Issued by olli
Beginning line 20

Communication OK Notification

(
   /sbin/apcaccess status
   echo " "
   echo "$MSG"
) | /usr/local/sbin/xmppsend mail@example.com

Changes in /etc/apcupsd/offbattery

File permissions:
Owner: root
Group: root
Permissions: -rwxr--r--

Click here for a download of the complete file: /etc/apcupsd/offbattery

Changed on 16.05.18
Issued by olli
Beginning line 20

Power returned

(
   /sbin/apcaccess status
   echo " "
   echo "$MSG"
) | /usr/local/sbin/xmppsend mail@example.com

Changes in /etc/apcupsd/onbattery

File permissions:
Owner: root
Group: root
Permissions: -rwxr--r--

Click here for a download of the complete file: /etc/apcupsd/onbattery

Changed on 16.05.18
Issued by olli
Beginning line 20

Power loss

(
   /sbin/apcaccess status
   echo " "
   echo "$MSG"
) | /usr/local/sbin/xmppsend mail@example.com

Changes in /usr/local/sbin/powerconsumption.sh

File permissions:
Owner: root
Group: root
Permissions: -rwx------

Click here for a download of the complete file: /usr/local/sbin/powerconsumption.sh

Changed on 16.05.18
Issued by olli
Beginning line 2

Powerconsumtion Statistics

#!/bin/bash
usvpower=20 # 20 Watt selfconsumtion
maxpower=`apcaccess status | perl -pe 's/ +/ /g;' | grep NOMPOWER | cut -d" " -f 3`
while true
do
 loadpct=`apcaccess status | perl -pe 's/ +/ /g;' | grep LOADPCT | cut -d" " -f 3`
 wattsconsumtion=`echo "scale=2; $loadpct/100*$maxpower+$usvpower" | bc -l | cut -d'.' -f1`
 echo "`date "+%Y-%m-%d %T"` $wattsconsumtion Watt" >>/var/log/powerconsumption-`date +%Y`
 sleep 60
done

Please send a feedback to: doc<at>gabosh.net

Howto listing
File Index

Here you can find the official Gentoo Linux Forums where you can find a lot of answers.

Here a link to the official Gentoo Linux Homepage.

Edit Howto

About / Impressum

Click here for About / Impressum

Wishlist

If you want to support my work you can find my Amazon whishlist here