Please feel free to provide feedback here.
Installation Instructions
1) Put tcp_conns.sh in your cacti scripts directory - /usr/local/cacti/scripts on mine.
2) Edit tcp_conns.sh: Change "public" to whatever your snmp community name is.
2) Import the graph xml files using the Cacti console.
3) Create the graphs and when you do this you shall have to enter
IP address of interface of the tcp connection
IP address of target device to query
Local port number of the tcp connection
For FTP it will obviously be local port number 21.
The data templates for each graph all use the data input method "SNMP - Get TCP Connections By IP And Port Number Of Remote Machine" which is passed the above 3 parameters. This data input method is the tcp_conns.sh script which executes the net-snmp command "snmpwalk" and returns the number of matching connections given your parameters.
tcp_conns.sh :
Code: Select all
#!/bin/sh
conns=`snmpwalk -On -c public -v 1 $3 .1.3.6.1.2.1.6.13.1.3.$1.$2 | wc -l`
echo $conns
Example graphs from my system: