1 #!/usr/bin/env rrdcgi
2 <html>
3 <head>
4 <title>Traffic Stats for oss.oetiker.ch</title>
5 </head>
6 <body>
7 <h1>Traffic Stats for oss.oetiker.ch</h1>
9 <h2>The Bytes</h2>
10 <table border="1" cellspacing="0" cellpadding="2">
11 <tr><td>Period</td>
12 <td>Incoming</td>
13 <td>Outgoing</td>
14 <td>Total</td></tr>
16 <!--
17 <RRD::GRAPH -
18 --start="midnight"
19 --end="start+24h"
20 --imginfo=" "
21 DEF:in=lan.rrd:in:AVERAGE:step=1800
22 DEF:out=lan.rrd:out:AVERAGE:step=1800
23 VDEF:is=in,TOTAL
24 PRINT:is:"%0.2lf %s"
25 VDEF:os=out,TOTAL
26 PRINT:os:"%0.2lf %S"
27 CDEF:sum=in,out,+
28 VDEF:ss=sum,TOTAL
29 PRINT:ss:"%0.2lf %S"
30 >
31 -->
33 <tr><td><RRD::TIME::NOW %Y-%m-%d></td>
34 <td align="right"><RRD::PRINT 0></td>
35 <td align="right"><RRD::PRINT 1></td>
36 <td align="right"><RRD::PRINT 2></td></tr>
38 <!--
39 <RRD::GRAPH -
40 --start="<RRD::TIME::NOW %Y%m01>"
41 --end="now"
42 --imginfo=" "
43 DEF:in=lan.rrd:in:AVERAGE:step=1800
44 DEF:out=lan.rrd:out:AVERAGE:step=1800
45 VDEF:is=in,TOTAL
46 PRINT:is:"%0.2lf %s"
47 VDEF:os=out,TOTAL
48 PRINT:os:"%0.2lf %S"
49 CDEF:sum=in,out,+
50 VDEF:ss=sum,TOTAL
51 PRINT:ss:"%0.2lf %S"
52 >
53 -->
55 <tr><td><RRD::TIME::NOW %Y-%m></td>
56 <td align="right"><RRD::PRINT 0></td>
57 <td align="right"><RRD::PRINT 1></td>
58 <td align="right"><RRD::PRINT 2></td></tr>
60 <!--
61 <RRD::GRAPH -
62 --start="<RRD::TIME::NOW %Y0101>"
63 --end="now"
64 --imginfo=" "
65 DEF:in=lan.rrd:in:AVERAGE:step=1800
66 DEF:out=lan.rrd:out:AVERAGE:step=1800
67 VDEF:is=in,TOTAL
68 PRINT:is:"%0.2lf %s"
69 VDEF:os=out,TOTAL
70 PRINT:os:"%0.2lf %S"
71 CDEF:sum=in,out,+
72 VDEF:ss=sum,TOTAL
73 PRINT:ss:"%0.2lf %S"
74 >
75 -->
77 <tr><td><RRD::TIME::NOW %Y></td>
78 <td align="right"><RRD::PRINT 0></td>
79 <td align="right"><RRD::PRINT 1></td>
80 <td align="right"><RRD::PRINT 2></td></tr>
81 </table>
83 <h2>Current</h2>
85 <RRD::SETVAR start -2h>
86 <RRD::SETVAR end now>
87 <RRD::INCLUDE graph.inc>
89 <h2>Day</h2>
91 <RRD::SETVAR start -24h>
92 <RRD::SETVAR end now>
93 <RRD::INCLUDE graph.inc>
95 <h2>7 Days</h2>
97 <RRD::SETVAR start -7d>
98 <RRD::SETVAR end now>
99 <RRD::INCLUDE graph.inc>
101 <h2>Month</h2>
103 <RRD::SETVAR start -30d>
104 <RRD::SETVAR end now>
105 <RRD::INCLUDE graph.inc>
107 <h2>This Year</h2>
109 <RRD::SETVAR start "Jan1">
110 <RRD::SETVAR end "Dec31">
111 <RRD::INCLUDE graph.inc>
113 <h2>Last Year</h2>
115 <RRD::SETVAR start "Jan1-365d">
116 <RRD::SETVAR end "Dec31-365d">
117 <RRD::INCLUDE graph.inc>
119 </body>
120 </html>