root / plugins / harddisks / powered_up_ @ 8af08143
Historique | Voir | Annoter | Télécharger (617 octets)
| 1 | b4660677 | Tom Denham | #!/bin/sh |
|---|---|---|---|
| 2 | #%# family=auto |
||
| 3 | #%# capabilities=autoconf suggest |
||
| 4 | |||
| 5 | 9534ff7d | lr1980 | device=`basename $0 | sed 's/^powered_up_//g'` |
| 6 | if [ ! -e /dev/$device ]; then |
||
| 7 | device="disk/by-id/$device" |
||
| 8 | fi |
||
| 9 | b4660677 | Tom Denham | |
| 10 | case $1 in |
||
| 11 | config) |
||
| 12 | cat <<EOM |
||
| 13 | graph_title Power State (/dev/$device) |
||
| 14 | graph_vlabel Power State |
||
| 15 | power.label power |
||
| 16 | graph_info The power state of drives on the system. |
||
| 17 | power.info The power state of the drive (1 is on, 0 is off) |
||
| 18 | EOM |
||
| 19 | exit 0;; |
||
| 20 | suggest) |
||
| 21 | ls -1 /dev/sd? |cut -d / -f 3 |
||
| 22 | exit 0;; |
||
| 23 | autoconf) |
||
| 24 | echo yes |
||
| 25 | exit 0;; |
||
| 26 | esac |
||
| 27 | |||
| 28 | printf "power.value " |
||
| 29 | hdparm -C /dev/$device |grep -c active |
