[ previous ] [ next ] [ threads ]
 From:  "John Voigt" <megeek at jvoigt dot com>
 To:  <m0n0wall at lists dot m0n0 dot ch>
 Subject:  Config.xml magic - the results
 Date:  Thu, 24 Jun 2004 09:44:19 -0400
In case anyone is interested here is the finished script (in shellcmd

                <shellcmd>mkdir /usr/local/www/cgi</shellcmd>
                <shellcmd>echo "#!/usr/local/bin/php" >
                <shellcmd>echo "&lt;?php echo \"&lt;pre>\";" >>
                <shellcmd>echo "\$ph = popen( \"/usr/bin/uptime; /sbin/ipfw
show\", \"r\" );" >> /usr/local/www/cgi/dump.php</shellcmd>
                <shellcmd>echo "while (\$line = fgets( \$ph )) echo \$line;
pclose( \$ph );" >> /usr/local/www/cgi/dump.php</shellcmd>
                <shellcmd>echo "echo \"&lt;/pre>\"; ?>" >>
                <shellcmd>chmod 755 /usr/local/www/cgi/dump.php</shellcmd>

This creates a new web page called
http://whatever.your.monowall.is.called/cgi/dump.php which will return your
ipfw rules (and also the counters associated with each one.)  This allows
another script (not on the monowall box) to feed MRTG with individual counts
based on queues, internal ip addresses or whatever else you feel like making
a rule for.

I hope someone else finds this useful.

John Voigt, President

Reston Wireless, LLC
High speed internet service
no smoke, no mirrors, no wires (tm)