Projet

Général

Profil

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

root / plugins / sensors / cleware @ c3660c2a

Historique | Voir | Annoter | Télécharger (1,33 ko)

1 52a6d10b lars falk-petersen
#!/bin/bash
2
3 b0f2565a Lars Falk-Petersen
# Written by Lars Falk-Petersen <cleware@falk-petersen.no>
4
# Version 0.4. See https://github.com/ways
5
# To be used with http://www.vanheusden.com/clewarecontrol/
6 e72c363b lars falk-petersen
# Clewarecontrol device serial must be set in config file:
7
8
#  #Put the following lines in /etc/munin/plugin-conf.d/cleware
9 b0f2565a Lars Falk-Petersen
#   [cleware*]
10
#   #device serial. find it by running: clewarecontrol -l
11
#   env.serial 7778
12
#   #path of clewarecontrol
13
#   env.bin /usr/bin/clewarecontrol
14
#
15
#  Munin must be able to read and write to the device.
16
#  Run the following as root:
17
#  # chgrp munin /dev/usb/hiddev0
18
#  # chmod g+rw /dev/usb/hiddev0
19
#
20
#  If that works, you have to make it permanent. On Ubuntu:
21
#  Create this file: /etc/udev/rules.d/99-hidraw-permissions.rules
22
#   #Allow munin to read hidraws from Cleware
23
#   SUBSYSTEM=="usb", KERNEL=="hiddev*", GROUP="munin", MODE="0660"
24 52a6d10b lars falk-petersen
25
case $1 in
26
   config)
27
        cat <<'EOM'
28
graph_title Temperature And Humidity
29
graph_vlabel C / %
30
graph_category sensors
31
temp.label Temperature
32
hum.label Humidity
33
graph_order temp hum
34
graph_args --base 1000
35
36
EOM
37
        exit 0;;
38
esac
39
40 e72c363b lars falk-petersen
[ ! $bin ] && bin="clewarecontrol"
41
if [ ! $serial ]; then
42
	echo "Serial not set! Hint: Read the top of this script."
43
	exit 1
44
fi
45
46 b0f2565a Lars Falk-Petersen
$bin -d $serial -c 1 -ag > /dev/null 2>&1
47 52a6d10b lars falk-petersen
48
echo -n "temp.value "
49 51ee702d Various
$bin -d $serial -b -c 1 -rt
50 52a6d10b lars falk-petersen
51
echo -n "hum.value "
52 51ee702d Various
$bin -d $serial -b -c 1 -rh