i've found a way to graph shorewall chain statistics, a'la http://forums.cacti.net/viewtopic.php?t ... t=iptables this.
it's a wee bit of a security risk, and i basically just followed venquessa's instructions. the problem is that www-data (the user account used by cacti normally), is unable to parse iptables information as it's not a root account.
so...
1. create a new data input method, call it "iptables collection method" or whatever. select "Script/Command" for the Input Type. the command you need to enter for the input string is "sudo <path_cacti>/scripts/iptables.pl <chain>". i'll follow up on the sudo bit in a moment. you can get the iptables.pl from the above link, and pop it into your scripts directory (correcting the above path in the input string as necessary). also, create an Input Field called "chain", you will use this later in the data source to select a particular chain for analysis. you'll also need an Output Field to hold the string outputted by iptables.pl.
2. you need to edit your /etc/sudoers file (i'm on ubuntu so that's where mine is) to reflect the following:
Code: Select all
www-data ALL = NOPASSWD: /usr/share/cacti/site/scripts/iptables.pl
Code: Select all
sudo -u www-data sudo /usr/share/cacti/site/scripts/iptables.pl <chain>
Code: Select all
sudo -u www-data sudo /usr/share/cacti/site/scripts/iptables.pl INPUT
Code: Select all
48279686
you then need to create the Data Template and Data Source to grab the actual data and have it ready for graphing. i'm sure the rest of it is pretty strightforward, as it's just the initial bit that caused me heartache.
i've attached a few screenshots. my cacti (0.8.6f on ubuntu 5.10) won't let me export template items without crashing, so these screenies will have to do. if you want to have a look at my iptables graphing output, have a clicky here:
http://magog.dyndns.org/cacti/graph.php ... rra_id=all