root / plugins / snmp / snmp__ups_temp @ e5ce7492
Historique | Voir | Annoter | Télécharger (1,08 ko)
| 1 | 98510ddd | Radar | #!/bin/sh |
|---|---|---|---|
| 2 | # |
||
| 3 | # Plugin to monitor temperature from UPS APC 9619 |
||
| 4 | # 2009/04/10 12:27:02 radar AT aol DOT pl |
||
| 5 | # |
||
| 6 | # ln -s /usr/share/munin/plugins/snmp__ups_temp /etc/munin/plugins/snmp_UPS.IP_ups_temp |
||
| 7 | # |
||
| 8 | # Magic markers (optional - only used by munin-config and some installation scripts): |
||
| 9 | #%# family=contrib |
||
| 10 | |||
| 11 | UPSHOST=$(basename $0 | awk -F'_|_' '{print $2}')
|
||
| 12 | |||
| 13 | if [ "$1" = "config" ]; then |
||
| 14 | UPSMODEL=$(snmpwalk -v 2c -c public $UPSHOST .1.3.6.1.4.1.318.1.1.1.1.1.1.0 | awk -F'"|"' '{print $2}')
|
||
| 15 | echo "graph_title $UPSMODEL- Temperature" |
||
| 16 | echo "graph_args --base 1000 -l 0 " |
||
| 17 | echo "graph_vlabel degrees C" |
||
| 18 | echo "graph_category sensors" |
||
| 19 | echo "graph_info This graph shows the temperature read from $UPSMODEL" |
||
| 20 | echo "temperature.label sensor UPS" |
||
| 21 | echo "temperature.type GAUGE" |
||
| 22 | echo "temperature.info Temperature from sensor UPS." |
||
| 23 | echo "temperature.warning 25" |
||
| 24 | echo "temperature.critical 30" |
||
| 25 | exit 0 |
||
| 26 | fi |
||
| 27 | |||
| 28 | echo -n "temperature.value " |
||
| 29 | snmpwalk -v 2c -c public $UPSHOST .1.3.6.1.4.1.318.1.1.10.2.3.2.1.4.1 | awk '{print $NF}' |
