From 165f771b18fad6565ac4d49a3aa8e518e6c6330e Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 23 Dec 2004 05:36:59 +0000 Subject: Create pfstat.conf from posted settings. And the crowd goes wild! --- packages/pfstat.xml | 104 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 91 insertions(+), 13 deletions(-) diff --git a/packages/pfstat.xml b/packages/pfstat.xml index 184d5db7..d1943c35 100644 --- a/packages/pfstat.xml +++ b/packages/pfstat.xml @@ -1,4 +1,4 @@ - + pfstat @@ -64,12 +64,43 @@ Graph height in pixels. Recommend 300 for large images, 200 for small images. input + + From + from + + input + 1 + 1 + + + From Class + fromclassification + + select + + + + + + + + rowhelper - Left Counters - leftcounters + Location + location + Location of graph + select + + + + + + + Graph Source + counters select @@ -103,18 +134,65 @@ 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 \"" . $pkgconfig['imagename'] ."\" { \n"); + fwrite($fout, "from " . $pkgconfig['from'] . " " . $pkgconfig['fromclassification'] . " to now \n"); + fwrite($fout, "width " . $pkgconfig['graphsizewidth'] . " height " . $pkgconfig['graphsizeheight'] . " \n"); + fwrite($fout, " left \n"); + fwrite($fout, " " . $leftgraphtext . "\n"); + fwrite($fout, " right \n"); + fwrite($fout, " " . $rightgraphtext . "\n"); + fwrite($fout, "}\n\n"); + } + fclose($fout); + + -- cgit v1.2.3