blob: 6cf6757cc3dfce5ee8d796bdeafa4b3897aaa199 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
usb-wde1 tools
--------------
Tools to collect and analyze data from the USB-WDE1 weather receiver from ELV.de
idea
----
1. pipe each received line to a command
2. command splits up line into variables
3. add variable data to rrdtool
4. repeat
idea: cat socat output to "read"
Test it:
$ php lines-to-stdout.php | ./work-with-lines.sh
RRDtool database setup
----------------------
EXAMPLE
rrdtool create temperature.rrd --step 300 \
DS:temp:GAUGE:600:-273:5000 \
RRA:AVERAGE:0.5:1:1200 \
RRA:MIN:0.5:12:2400 \
RRA:MAX:0.5:12:2400 \
RRA:AVERAGE:0.5:12:2400
This sets up an RRD called temperature.rrd which accepts one temperature value every 300 seconds. If no new data is supplied for more than 600 seconds, the temperature becomes *UNKNOWN*. The minimum acceptable value is -273 and the maximum is 5'000.
A few archive areas are also defined. The first stores the temperatures supplied for 100 hours (1'200 * 300 seconds = 100 hours). The second RRA stores the minimum temperature recorded over every hour (12 * 300 seconds = 1 hour), for 100 days (2'400 hours). The third and the fourth RRA's do the same for the maximum and average temperature, respectively.
|