pfstat PFStat Settings pfstat is a small utility that collects packet filter statistics and produces graphs.
Services
pfstat.xml
PFStat Graphs pfstat is a small utility that collects packet filter statistics and produces graphs. /pfstat/
Services
['installedpackages']['package']['$packagename']['configuration'] /etc/crontab * * * * * root /usr/local/bin/pfstat -q >> /var/log/pfstat /etc/crontab */5 * * * * root /usr/local/bin/pfstat -c /usr/local/etc/pfstat.conf -d /var/log/pfstat Graph Name graphname Description description Graph Name graphname Enter the name of the graph here input Graph Description description Enter the description of the graph here input Image Name imagename Enter the filename for this image. Must end in .jpg. ex. filename.jpg input Graph Size Width graphsizewidth Graph width in pixels. Recommend 960 for large images, 320 for small images. input Graph Size Height graphsizeheight Graph height in pixels. Recommend 300 for large images, 200 for small images. input Update interval from input 1 1 true true true true Update interval duration fromclassification select rowhelper Location location Location of graph select Graph Source counters select Color color Color of graph select Appearance appearance Appearance type select $fout = fopen("/usr/local/etc/pfstat.conf","w"); $leftgraphtext = ""; $rightgraphtext = ""; $isfirstleft = 0; $isfirstright = 0; foreach($config['installedpackages']['pfstat']['config'] as $rowhelper) { foreach($rowhelper['row'] as $row) { if($row['location'] == "left") { if($isfirstleft == 1) $leftgraphtext .= ",\n"; $leftgraphtext .= $row['counters'] . " label \"" . $row['counters'] . "\" color " . $row['color'] . " " . $row['appearance']; $isfirstleft = 1; } else { if($isfirstright == 1) $rightgraphtext .= ",\n"; $rightgraphtext .= $row['counters'] . " label \"" . $row['counters'] . "\" color " . $row['color'] . " " . $row['appearance']; $isfirstright = 1; } } } foreach($config['installedpackages']['pfstat']['config'] as $pkgconfig) { fwrite($fout, "image \"/usr/local/www/pfstat/" . $pkgconfig['imagename'] ."\" { \n"); $from = $pkgconfig['from']; if($from == "") $from = "30"; fwrite($fout, "from " . $from . " " . $pkgconfig['fromclassification'] . " to now \n"); fwrite($fout, "width " . $pkgconfig['graphsizewidth'] . " height " . $pkgconfig['graphsizeheight'] . " \n"); if($leftgraphtext != "") { fwrite($fout, " left \n"); fwrite($fout, " " . $leftgraphtext . "\n"); } if($rightgraphtext != "") { fwrite($fout, " right \n"); fwrite($fout, " " . $rightgraphtext . "\n"); } fwrite($fout, "}\n\n"); } fclose($fout); system("mkdir -p /usr/local/www/pfstat 2>/dev/null"); system("/usr/bin/killall cron 2>/dev/null"); system("/usr/sbin/cron 2>/dev/null"); system("rm /usr/local/etc/pfstat*");