Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / other / apc_status @ 2578e754

Historique | Voir | Annoter | Télécharger (974 octets)

1 2ebbea3b Andreas Kreisl
#!/bin/sh
2
#
3
# (c) Andreas Kreisl
4
#
5
# Link name will be used as title: apc_{$title}
6
#
7
# env.keys LOADPCT BCHARGE LINEV BATTV TIMELEFT
8
# env.unit % or Volt or Minutes
9
#
10
11
12
if [ -z "$keys" ]; then
13
        keys="TIMELEFT"
14
fi
15
16
if [ "$1" = "config" ]; then
17
        title=`basename $0 | sed 's/^apc_//g' | awk '{ sub(/^./,toupper(substr($0,1,1))); print; }'`
18
        echo "graph_title APC Status - $title"
19
        echo 'graph_args --base 1000 -l 0 '
20
        echo "graph_vlabel $unit"
21
        echo 'graph_category Hardware'
22
        title=`/sbin/apcaccess | egrep "^MODEL" | awk '{print $3" "$4" "$5" "$6" "$7" "$8" "$9;}'`
23
        echo "graph_info $title"
24
        for key in $keys; do
25
                echo "$key.label $key"
26
                echo "$key.info Value of $key."
27
                echo "$key.draw LINE2"
28
        done
29
        exit 0
30
fi
31
32
searchkey=`echo "$keys" | tr " " "\|"`
33
/sbin/apcaccess | egrep "$searchkey" | awk '{print $1".value "$3;}'