Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 | case $1 in
|
---|
4 | config)
|
---|
5 | cat <<'EOM'
|
---|
6 | graph_title Container temperature
|
---|
7 | graph_vlabel temperature
|
---|
8 | graph_category environment
|
---|
9 | container_temp.label temperature
|
---|
10 | container_temp.warning 40
|
---|
11 | container_temp.critical 45
|
---|
12 | EOM
|
---|
13 | exit 0;;
|
---|
14 | esac
|
---|
15 |
|
---|
16 | . /etc/munin/plugins/ticktick.sh
|
---|
17 |
|
---|
18 | DATA=`curl -s "http://10.0.100.234/statusjsn.js?components=18179&_=1365876572736"`
|
---|
19 |
|
---|
20 | RC=$?
|
---|
21 |
|
---|
22 | if [ "$RC" != "0" ] ; then
|
---|
23 | echo Could not fetch container temperature: curl returned $RC >&2
|
---|
24 | exit -1
|
---|
25 | fi
|
---|
26 |
|
---|
27 |
|
---|
28 | tickParse "$DATA"
|
---|
29 |
|
---|
30 | VAL=``sensor_values[0].values[0][0].v``
|
---|
31 | MIN=``sensor_values[0].values[0][0].st[0]``
|
---|
32 | MAX=``sensor_values[0].values[0][0].st[1]``
|
---|
33 |
|
---|
34 | echo container_temp.value $VAL
|
---|
Note:
See
TracBrowser
for help on using the repository browser.