write readme
[usb-wde1-tools.git] / munin / README
1 USB-WDE1 Munin plugin
2 =====================
3 Generate graphs for temperature and humidity by utilizing Munin.
4
5
6 Idea
7 ----
8 0. Keep a logfile with the most recent single line
9 1. Use the munin plugin to generate munin-compatible data from the log file
10
11
12 Setup
13 -----
14 0. Checkout the munin plugin code:
15    $ cd /usr/local/src
16    $ git clone ssh://git.cweiske.de/~/git/usb-wde1-tools.git
17    $ cd usb-wde1-tools
18
19 1. A process needs to watch the USB interface and log the last
20    line with temperature data into a log file.
21    You can do that manually with
22    $ socat /dev/ttyUSB0,b9600 STDOUT |./munin/log-single-line.sh test.log
23    or
24    $ ./dummy-data-generator.php |./munin/log-single-line.sh test.log
25
26    The most easy way is to run
27    $ cd munin && nohup ./usb-wde1-log-last.sh &
28    once. It backgrounds the logging process and logs into /tmp/usb-wde1-last.
29    This process needs to be started whenever the machine is rebooted.
30
31 2. Link the munin plugin:
32    $ cd /etc/munin/plugins
33    $ ln -s /usr/local/src/usb-wde1-tools/munin/usb-wde1_ usb-wde1_temperature
34    $ ln -s /usr/local/src/usb-wde1-tools/munin/usb-wde1_ usb-wde1_humidity
35
36 3. Configure the plugins
37    Edit /etc/munin/plugin-conf.d/munin-node and add the following lines:
38    [usb-wde1_*]
39    env.logfile /tmp/usb-wde1-last
40    env.host_name House
41    env.sensors 0 1 7
42    env.sensor0 Living room
43    env.sensor1 Kitchen
44    env.sensor7 Outside
45
46 4. Try it:
47    $ munin-run usb-wde1_temperature autoconf
48     - should echo "yes"
49    $ munin-run usb-wde1_temperature config
50     - should display the plugin configuration with all environment variables
51       set
52    $ munin-run usb-wde1_temperature
53     - should display the current values from the log file
54
55 5. You are done - enjoy.