The following files were
added to the standard m0n0wall pb27r630 release to provide graphing
support:
(unless otherwise indicated by a link or source code,
these files came from standard FreeBSD 4.9 distribution built with
dynamic libraries) |
| Filename |
Size (bytes) |
Notes |
| /var/net4801.rrd |
1059716 |
Fixed size round robin database. Created by cron job if not present.
Periodically copied to /cf/net4801.rrd by cronjob for persistence. |
| /usr/sbin/cron |
30280 |
binary for processing crontab |
| /usr/local/bin/rrdtool |
12576 |
round robin database tool for creating database |
| /usr/local/bin/rrdupdate |
10712 |
round robin database tool for updated database |
| /usr/local/bin/snmpget |
5676 |
used to gather network statistics from network interfaces |
| /usr/local/lib/libnetsnmp.so.5 |
486689 |
required by snmpget |
| /usr/local/lib/librrd.so.0 |
644326 |
required by rrdtool, rrdupdate |
| /usr/local/share/snmp/mibs/* |
0-1MB |
copied over the MIB files, such as IF-MIB.txt so that snmpget can
understand names such as IF-MIB::ifOutOctets.1
for processing. |
| /usr/bin/cut |
6824 |
used to parse data gathering output |
| /usr/bin/head |
5156 |
used to parse data gathering output |
| /usr/bin/tr |
11984 |
used to parse data gathering output |
| /usr/lib/libdevstat.so.2 |
12104 |
required by snmpget |
| /usr/local/bin/env4801 |
8155 |
utility used to read net4801 temperature and voltages. Poul-Henning
Kamp website for env4801. |
| /etc/crontab |
218 |
used to schedule statistics collection, contents:
|
| /usr/local/bin/gatherstats.sh |
2411 |
used to create (if necessary RRD database), and collect and add
new data to database:
|
| /usr/local/www/stats.php |
2240 |
Simple web page to display network interface stats. Calls graph.php
to generate each graph.
#!/usr/local/bin/php
<HTML>
<head>
</head>
<body>
<img src=graph.php?if=1&t=<?php echo($_GET['t']);
?>><br>
<img src=graph.php?if=2&t=<?php echo($_GET['t']);
?>><br>
<img src=graph.php?if=3&t=<?php echo($_GET['t']);
?>><br>
<img src=graph.php?if=4&t=<?php echo($_GET['t']);
?>><br>
<img src=graph.php?if=5&t=<?php echo($_GET['t']);
?>><br>
<img src=graph.php?if=6&t=<?php echo($_GET['t']);
?>><br>
<img src=graph.php?if=7&t=<?php echo($_GET['t']);
?>><br>
</body>
</HTML>
|
|
| /usr/local/www/statst.php |
2240 |
Simple web page to display enviromental stats. Calls grapht.php
to generate each graph.
#!/usr/local/bin/php
<HTML>
<head>
</head>
<body>
<img src=grapht.php?n=temp&t=<?php echo($_GET['t']);
?>><br>
<img src=grapht.php?n=vcc&t=<?php echo($_GET['t']);
?>><br>
<img src=grapht.php?n=vpower&t=<?php echo($_GET['t']);
?>><br>
<img src=grapht.php?n=loadavg&t=<?php echo($_GET['t']);
?>><br>
</body>
</HTML>
|
|
| /usr/local/www/graph.php |
2240 |
PHP script to generate PNG image using rrdtool for given network
interface and timeframe
#!/usr/local/bin/php
<?php
header("Content-Type: image/png");
if(!isset($_GET['if'])){
$if = "1";
}
else {
$if = $_GET['if'];
}
$name1 = "in" . $if;
$name2 = "out" . $if;
$title = "Interface $if Bandwidth";
$units = "KBytes/sec";
switch($_GET['t']){
case "today":
$starttimesecs = 0-(24*60*60);
$endtimesecs = 0-1;
$title= $title . " Current Day";
break;
default:
case "thishour":
$starttimesecs = 0-(60*60);
$endtimesecs = 0-1;
$title= $title . " Current Hour";
break;
case "lasthour":
$endtimesecs = 0-(60*60);
$starttimesecs = $endtimesecs - (60*60);
$title= $title . " Previous Hour";
break;
case "yesterday":
$endtimesecs = 0-(24*60*60);
$starttimesecs = $endtimesecs - (24*60*60);
$title= $title . " Previous Day";
break;
case "thisweek":
$starttimesecs = 0-(24*60*60*7);
$endtimesecs = 0-1;
$title = $title . " Current Week";
break;
case "lastweek":
$endtimesecs = 0-(24*60*60*7);
$starttimesecs = $endtimesecs - (24*60*60*7);
$title = $title . " Previous Week";
break;
case "thismonth":
$starttimesecs = 0-(24*60*60*30);
$endtimesecs = 0-1;
$title = $title . " Current Month";
break;
case "lastmonth":
$endtimesecs = 0-(24*60*60*30);
$starttimesecs = $endtimesecs - (24*60*60*30);
$title = $title . " Previous Month";
break;
case "thisyear":
$starttimesecs = 0-(24*60*60*365);
$endtimesecs = 0-1;
$title = $title . " Current Year";
break;
case "lastyear":
$endtimesecs = 0-(24*60*60*365);
$starttimesecs = $endtimesecs - (24*60*60*365);
$title = $title . " Previous Year";
break;
}
$arg = ("graph - -a PNG -h 125 -s $starttimesecs -e $endtimesecs
"
. " -v \"$units\" "
. " -t \"$title\" "
. " DEF:V1=/var/net4801.rrd:$name1:AVERAGE "
. " DEF:V2=/var/net4801.rrd:$name2:MAX "
. " CDEF:kbin=V1,1024,/ "
. " CDEF:kbout=V2,1024,/ "
. " AREA:V1#00FF00:\"Bandwidth In\""
. " LINE1:V2#FF0000:\"Bandwidth Out\"\\\j"
. " GPRINT:kbin:LAST:\"Last Bandwidth In\: %3.2lf
KBps\" "
. " GPRINT:kbout:LAST:\"Last Bandwidth Out\: %3.2lf
KBps\"\\\j "
. " GPRINT:kbin:AVERAGE:\"Average Bandwidth In\: %3.2lf
KBps\" "
. " GPRINT:kbout:AVERAGE:\"Average Bandwidth Out\:
%3.2lf KBps\"\\\j");
passthru("/usr/local/bin/rrdtool $arg");
?>
|
|
| /usr/local/www/grapht.php |
2365 |
PHP script to generate PNG image using rrdtool for
given enviromental data (temp, vcc, vpower, loadavg) and timeframe
|
#!/usr/local/bin/php
<?php
header("Content-Type: image/png");
switch($_GET['n']){
default:
case "temp":
$name = "temp";
$title = "Temperature";
$units = "Degrees C";
$abrv = "C";
break;
case "vcc":
$name = "vcc";
$title = "VCC";
$units = "Volts";
$abrv = "V";
break;
case "vpower":
$name = "vpower";
$title = "VPower";
$units = "Volts";
$abrv = "V";
break;
case "loadavg":
$name = "loadavg";
$title = "Load Average";
$units = "Units";
$abrv = " ";
break;
}
switch($_GET['t']){
case "today":
$starttimesecs = 0-(24*60*60);
$endtimesecs = 0-1;
$title= $title . " Current Day";
break;
default:
case "thishour":
$starttimesecs = 0-(60*60);
$endtimesecs = 0-1;
$title= $title . " Current Hour";
break;
case "lasthour":
$endtimesecs = 0-(60*60);
$starttimesecs = $endtimesecs - (60*60);
$title= $title . " Previous Hour";
break;
case "yesterday":
$endtimesecs = 0-(24*60*60);
$starttimesecs = $endtimesecs - (24*60*60);
$title= $title . " Previous Day";
break;
case "thisweek":
$starttimesecs = 0-(24*60*60*7);
$endtimesecs = 0-1;
$title = $title . " Current Week";
break;
case "lastweek":
$endtimesecs = 0-(24*60*60*7);
$starttimesecs = $endtimesecs - (24*60*60*7);
$title = $title . " Previous Week";
break;
case "thismonth":
$starttimesecs = 0-(24*60*60*30);
$endtimesecs = 0-1;
$title = $title . " Current Month";
break;
case "lastmonth":
$endtimesecs = 0-(24*60*60*30);
$starttimesecs = $endtimesecs - (24*60*60*30);
$title = $title . " Previous Month";
break;
case "thisyear":
$starttimesecs = 0-(24*60*60*365);
$endtimesecs = 0-1;
$title = $title . " Current Year";
break;
case "lastyear":
$endtimesecs = 0-(24*60*60*365);
$starttimesecs = $endtimesecs - (24*60*60*365);
$title = $title . " Previous Year";
break;
}
$arg = ("graph - -a PNG -h 125 -s $starttimesecs
-e $endtimesecs "
. " -v \"$units\" "
. " -t \"$title\" "
. " DEF:V=/var/net4801.rrd:$name:AVERAGE "
. " DEF:maxV=/var/net4801.rrd:$name:MAX "
. " AREA:V#00FF00:\"Average\""
. " LINE1:maxV#FF0000:\"Maximum\"\\\j"
. " GPRINT:V:MIN:\"Min\: %3.2lf $abrv\"
"
. " GPRINT:V:AVERAGE:\"Avg\: %3.2lf $abrv\"
"
. " GPRINT:V:LAST:\"Last\: %3.2lf $abrv\"
"
. " GPRINT:maxV:MAX:\"Max\: %3.2lf $abrv\"\\\j");
passthru("/usr/local/bin/rrdtool $arg");
?>
|
|
|