-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgraph
executable file
·74 lines (72 loc) · 2.11 KB
/
graph
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
#
# graph - Geiger graph generator
# Copyright (C) 2015 abouvier <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config/geiger.conf"
rrdtool graph geiger.png --imgformat=PNG \
--title="Geiger counter ($tube)" \
--start="-1hour" \
--end="now" \
--vertical-label="CPM" \
--right-axis-label="μSv/h" \
--right-axis="$factor:0" \
--right-axis-format="%.2lf" \
--alt-y-grid \
--units-length=4 \
--width=720 \
--height=240 \
--lower-limit=0 \
--slope-mode \
--border=0 \
--pango-markup \
--watermark="$(date --rfc-2822)" \
--color="BACK#924d8b" \
--color="CANVAS#924d8b" \
--color="GRID#aea79f" \
--color="MGRID#beb8b2" \
--color="FONT#ffffff" \
--color="AXIS#beb8b2" \
--color="FRAME#333333" \
--color="ARROW#beb8b2" \
DEF:cpm="$rrdfile":cpm:AVERAGE \
VDEF:min=cpm,MINIMUM \
VDEF:avg=cpm,AVERAGE \
VDEF:max=cpm,MAXIMUM \
VDEF:last=cpm,LAST \
CDEF:trend=cpm,240,TRENDNAN \
VDEF:tmin=trend,MINIMUM \
VDEF:tavg=trend,AVERAGE \
VDEF:tmax=trend,MAXIMUM \
VDEF:tlast=trend,LAST \
COMMENT:"\t" \
COMMENT:"Min\t" \
COMMENT:"Average\t" \
COMMENT:"Max\t" \
COMMENT:"Last\l" \
AREA:"cpm#19b6eeaa#19b6ee44:gradheight=-75" \
LINE2:"cpm#19b6ee:CPM\t" \
GPRINT:min:"%.0lf\t" \
GPRINT:avg:"%.0lf\t" \
GPRINT:max:"%.0lf\t" \
GPRINT:last:"%.0lf\l" \
LINE2:"trend#e36c43:CPM\t" \
GPRINT:tmin:"%.0lf\t" \
GPRINT:tavg:"%.0lf\t" \
GPRINT:tmax:"%.0lf\t" \
GPRINT:tlast:"%.0lf\l" \
COMMENT:"\u" \
LINE:"avg#3fb24f:Average" \
HRULE:"$alert#dd4814:Alert\r"