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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
| // index.php
$rrd_file = "r733.rrd";
include_once "update_r733.php";
function draw_rrd() {
global $rrd_file;
$opts = array( "--start", "-1h", "--vertical-label=deg C", "--title=R733 Temperature last hour",
"DEF:battery=".$rrd_file.":Battery:AVERAGE",
"DEF:emu=".$rrd_file.":EMU:AVERAGE",
"COMMENT: Max Average Last\\n",
"AREA:battery#99CC00:Battery \:",
"GPRINT:battery:MAX:%2.0lfdeg C",
"GPRINT:battery:AVERAGE:%2.0lfdeg C",
"GPRINT:battery:LAST:%2.0lfdeg C\\r",
"LINE2:emu#6699CC:EMU \:",
"GPRINT:emu:MAX:%2.0lfdeg C",
"GPRINT:emu:AVERAGE:%2.0lfdeg C",
"GPRINT:emu:LAST:%2.0lfdeg C\\r"
);
$ret = rrd_graph("r733_1h.gif", $opts, count($opts));
if(!is_array($ret)) {
$err = rrd_error();
exit("draw_rrd() ERROR: $err\n");
}
$opts = array( "--start", "-1d", "--vertical-label=deg C", "--title=R733 Temperature last day",
"DEF:battery=".$rrd_file.":Battery:AVERAGE",
"DEF:emu=".$rrd_file.":EMU:AVERAGE",
"COMMENT: Max Average Last\\n",
"AREA:battery#99CC00:Battery \:",
"GPRINT:battery:MAX:%2.0lfdeg C",
"GPRINT:battery:AVERAGE:%2.0lfdeg C",
"GPRINT:battery:LAST:%2.0lfdeg C\\r",
"LINE2:emu#6699CC:EMU \:",
"GPRINT:emu:MAX:%2.0lfdeg C",
"GPRINT:emu:AVERAGE:%2.0lfdeg C",
"GPRINT:emu:LAST:%2.0lfdeg C\\r"
);
$ret = rrd_graph("r733_1d.gif", $opts, count($opts));
if(!is_array($ret)) {
$err = rrd_error();
exit("draw_rrd() ERROR: $err\n");
}
$opts = array( "--start", "-1w", "--vertical-label=deg C", "--title=R733 Temperature last week",
"DEF:battery=".$rrd_file.":Battery:AVERAGE",
"DEF:emu=".$rrd_file.":EMU:AVERAGE",
"COMMENT: Max Average Last\\n",
"AREA:battery#99CC00:Battery \:",
"GPRINT:battery:MAX:%2.0lfdeg C",
"GPRINT:battery:AVERAGE:%2.0lfdeg C",
"GPRINT:battery:LAST:%2.0lfdeg C\\r",
"LINE2:emu#6699CC:EMU \:",
"GPRINT:emu:MAX:%2.0lfdeg C",
"GPRINT:emu:AVERAGE:%2.0lfdeg C",
"GPRINT:emu:LAST:%2.0lfdeg C\\r"
);
$ret = rrd_graph("r733_1w.gif", $opts, count($opts));
if(!is_array($ret)) {
$err = rrd_error();
exit("draw_rrd() ERROR: $err\n");
}
$opts = array( "--start", "-1m", "--vertical-label=deg C", "--title=R733 Temperature last month",
"DEF:battery=".$rrd_file.":Battery:AVERAGE",
"DEF:emu=".$rrd_file.":EMU:AVERAGE",
"COMMENT: Max Average Last\\n",
"AREA:battery#99CC00:Battery \:",
"GPRINT:battery:MAX:%2.0lfdeg C",
"GPRINT:battery:AVERAGE:%2.0lfdeg C",
"GPRINT:battery:LAST:%2.0lfdeg C\\r",
"LINE2:emu#6699CC:EMU \:",
"GPRINT:emu:MAX:%2.0lfdeg C",
"GPRINT:emu:AVERAGE:%2.0lfdeg C",
"GPRINT:emu:LAST:%2.0lfdeg C\\r"
);
$ret = rrd_graph("r733_1m.gif", $opts, count($opts));
if(!is_array($ret)) {
$err = rrd_error();
exit("draw_rrd() ERROR: $err\n");
}
$opts = array( "--start", "-1y", "--vertical-label=deg C", "--title=R733 Temperature last year",
"DEF:battery=".$rrd_file.":Battery:AVERAGE",
"DEF:emu=".$rrd_file.":EMU:AVERAGE",
"COMMENT: Max Average Last\\n",
"AREA:battery#99CC00:Battery \:",
"GPRINT:battery:MAX:%2.0lfdeg C",
"GPRINT:battery:AVERAGE:%2.0lfdeg C",
"GPRINT:battery:LAST:%2.0lfdeg C\\r",
"LINE2:emu#6699CC:EMU \:",
"GPRINT:emu:MAX:%2.0lfdeg C",
"GPRINT:emu:AVERAGE:%2.0lfdeg C",
"GPRINT:emu:LAST:%2.0lfdeg C\\r"
);
$ret = rrd_graph("r733_1y.gif", $opts, count($opts));
if(!is_array($ret)) {
$err = rrd_error();
exit("draw_rrd() ERROR: $err\n");
}
} // end function draw_rrd()
draw_rrd();
?>
<img src="r733_1h.gif"><br>
<img src="r733_1d.gif"><br>
<img src="r733_1w.gif"><br>
<img src="r733_1m.gif"><br>
<img src="r733_1y.gif"> |
Recent Comments