mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Category Tree: Reduce number of categories
sphinx -> search unicorn -> webserver moved some plugins to other dirs to get better seconde level heading
This commit is contained in:
parent
444c7939de
commit
e08a6448ce
20 changed files with 11 additions and 11 deletions
70
plugins/battery/acpi-battery
Executable file
70
plugins/battery/acpi-battery
Executable file
|
@ -0,0 +1,70 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Plugin to graph battery capacity.
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# acpi - Override path to acpi program
|
||||
#
|
||||
#
|
||||
# $Log$
|
||||
# Revision 1.1 2007/03/14 19:52:10 anarcat
|
||||
# ACPI-Battery plugin, framework copied from acpi plugin
|
||||
#
|
||||
#
|
||||
# Expected content of /proc/acpi/battery/BAT0/info:
|
||||
# present: yes
|
||||
# design capacity: 47520 mWh
|
||||
# last full capacity: 37650 mWh
|
||||
# battery technology: rechargeable
|
||||
# design voltage: 10800 mV
|
||||
# design capacity warning: 2376 mWh
|
||||
# design capacity low: 475 mWh
|
||||
# capacity granularity 1: 1 mWh
|
||||
# capacity granularity 2: 1 mWh
|
||||
# model number: IBM-08K8039
|
||||
# serial number: 155
|
||||
# battery type: LION
|
||||
# OEM info: Panasonic
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
if grep -q 'present.*yes' /proc/acpi/battery/*/info > /dev/null 2>&1; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo "no (battery not detected)"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
cd /proc/acpi/battery
|
||||
if [ "$1" = "config" ]; then
|
||||
echo 'graph_title Battery power'
|
||||
echo 'graph_args --base 1000 -l 0'
|
||||
echo 'graph_vlabel power in' `awk '/remaining capacity:/ { print $NF }' /proc/acpi/battery/*/state`
|
||||
echo 'graph_category sensors'
|
||||
echo 'graph_info This graph shows battery power based on output from ACPI.'
|
||||
i=0
|
||||
for battery in *
|
||||
do
|
||||
echo $battery.label $battery
|
||||
echo $battery.info Battery $i
|
||||
i=$(($i+1))
|
||||
# design capacity warning: 2376 mWh
|
||||
# design capacity low: 475 mWh
|
||||
echo $battery.warning `awk '/design capacity warning:/ { print $4 }' $battery/info`
|
||||
echo $battery.critical `awk '/design capacity low:/ { print $4 }' $battery/info`
|
||||
|
||||
echo ${battery}_full.label $battery capacity
|
||||
echo ${battery}_full.info last full capacity \(design capacity: `awk '/design capacity:/ { print $3 " " $4 }' $battery/info`\)
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for battery in *
|
||||
do
|
||||
echo $battery.value `awk '/remaining capacity:/ { print $3 }' $battery/state`
|
||||
echo ${battery}_full.value `awk '/last full capacity:/ { print $4 }' $battery/info`
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue