IP Conntrack monitoring

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
Alives
Cacti User
Posts: 103
Joined: Mon Jul 11, 2005 11:39 am

IP Conntrack monitoring

Post by Alives »

I use this template/script to graph the number of IP connections on a host at any given time.

You can use it for localhost or a remote host. It checks remote hosts using ssh so you will need to have keys installed without a passphrase. This is a big security risk and I do not advise it (I still do it and accept the dangers but only on my local lan).


To install, copy the ip_conntrack.sh script to your cacti/scripts/ directory and give it executable permissions. If you are using this to monitor a host other than the localhost, you will need to set up ssh keys. You also need to allow the user running cacti sudo access to cat the ip_conntrack table. Add the following to your sudoers file:

Code: Select all

www-data ALL=NOPASSWD: /bin/cat /proc/net/ip_conntrack
Attachments
cacti_graph_template_traffic_ip_conntrack_count.xml
(7.93 KiB) Downloaded 857 times
graph_image.php.png
graph_image.php.png (29.11 KiB) Viewed 15245 times
ip_conntrack.sh
(175 Bytes) Downloaded 1000 times
psynode
Posts: 1
Joined: Tue May 06, 2008 8:44 pm

better way for ip_conntrack

Post by psynode »

using wc -l /proc/net/ip_conntrack is a bad idea, as if you use this for a large router/nat firewall this number will get high

the count i already done in proc so use:
cat /proc/sys/net/ipv4/netfilter/ip_conntrack_count

Cheers
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests