Troy
Troy Aden wrote:
Thanks for the response. So that is great to hear that it is doable. Does
anyone have a way to actually do it? I need a practical example that I can
use. Sorry but I have absolutely no Perl hacking skills whatsoever. Has
anyone done this?
I have not done it, just had a quick look at the code.
this looks like the location where the statistics are read:
*# get in/out statistics
$in = `$shorewall show $show | head -n 7 | tail -1 | awk '{ print \$2 }'`;
$out = `$shorewall show $show | head -n 8 | tail -1 | awk '{ print \$2 }'`;
I have awk on my leaf box so executing this locally for web statistics results in
gatekeeper: -root- # shorewall show web | head -n 7 | tail -n -1 | awk '{print $2}' 13M
be aware that the tail command on LEAF bering needs the -n also....
using ssh to run this command remotely on the leaf box and still getting the output locally ...
luna > ssh -l root gatekeeper shorewall show web | head -n 7 | tail -n -1 | awk '{print $2}'
13M
so this would lead to
#!/usr/bin/perl
$shorewall = "/sbin/shorewall"; $remote_host = "gatekeeper"; $leaf_remote_handler = "/usr/bin/ssh -l root $remote_host";
$out = `$leaf_remote_handler $shorewall show web | head -n 8 | tail -n -1 | awk '{ print \$2 }'`;
print $out;¨
and the result is (assuming you save the above in a file called foo):
luna > ./foo 241M
of course this is quite crude but you should get what you want this way.
Erich *
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click ------------------------------------------------------------------------ leaf-user mailing list: leaf-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/leaf-user SR FAQ: http://leaf-project.org/pub/doc/docmanager/docid_1891.html