2007-06-11 17:45:16 +02:00
|
|
|
config_netstat() {
|
|
|
|
echo "graph_title Netstat"
|
|
|
|
echo "graph_args -l 0 --base 1000"
|
|
|
|
echo "graph_vlabel active connections"
|
|
|
|
echo "graph_category network"
|
|
|
|
echo "graph_period second"
|
2007-11-30 12:24:07 +01:00
|
|
|
echo "graph_info This graph shows the TCP activity of all the network interfaces combined."
|
2007-06-11 17:45:16 +02:00
|
|
|
echo "active.label active"
|
|
|
|
echo "active.type DERIVE"
|
|
|
|
echo "active.max 50000"
|
|
|
|
echo "active.min 0"
|
|
|
|
echo "active.info The number of active TCP openings per second."
|
|
|
|
echo "passive.label passive"
|
|
|
|
echo "passive.type DERIVE"
|
|
|
|
echo "passive.max 50000"
|
|
|
|
echo "passive.min 0"
|
|
|
|
echo "passive.info The number of passive TCP openings per second."
|
|
|
|
echo "failed.label failed"
|
|
|
|
echo "failed.type DERIVE"
|
|
|
|
echo "failed.max 50000"
|
|
|
|
echo "failed.min 0"
|
|
|
|
echo "failed.info The number of failed TCP connection attempts per second."
|
|
|
|
echo "resets.label resets"
|
|
|
|
echo "resets.type DERIVE"
|
|
|
|
echo "resets.max 50000"
|
|
|
|
echo "resets.min 0"
|
|
|
|
echo "resets.info The number of TCP connection resets."
|
|
|
|
echo "established.label established"
|
|
|
|
echo "established.type GAUGE"
|
|
|
|
echo "established.max 50000"
|
|
|
|
echo "established.info The number of currently open connections."
|
|
|
|
}
|
|
|
|
fetch_netstat() {
|
|
|
|
NINFO=$(netstat -s | sed 's/ \{1,\}/ /g')
|
|
|
|
echo "active.value" $(echo "$NINFO" | grep "active connections" | cut -d\ -f2)
|
|
|
|
echo "passive.value" $(echo "$NINFO" | grep "passive connection" | cut -d\ -f2)
|
|
|
|
echo "failed.value" $(echo "$NINFO" | grep "failed connection" | cut -d\ -f2)
|
|
|
|
echo "resets.value" $(echo "$NINFO" | grep "connection resets" | cut -d\ -f2)
|
|
|
|
echo "established.value" $(echo "$NINFO" | grep "connections established" | cut -d\ -f2)
|
|
|
|
}
|