3
# Plugin to monitor network connections.
7
# This will measure the amount of network traffic coming into and
8
# out of the server. It will report back the number of connections
9
# accepted, requested, established, and closed. It uses
10
# /usr/bin/netstat to gather it's information.
14
# None known. /usr/bin/netstat should be executable by everyone by
17
# $Log: netstat.in,v $
18
# Revision 1.1 2004/01/02 18:50:00 jimmyo
19
# Renamed occurrances of lrrd -> munin
21
# Revision 1.1.1.1 2004/01/02 15:18:07 jimmyo
22
# Import of LRRD CVS tree after renaming to Munin
24
# Revision 1.2 2003/11/07 17:43:16 jimmyo
25
# Cleanups and log entries
32
# autoconf (optional - only used by munin-config)
34
# Magic markers (optional - used by munin-config and some installation
37
#%# capabilities=autoconf
41
if($ARGV[0] && $ARGV[0] eq "autoconf")
43
if(-e "/usr/bin/netstat" && -X "/usr/bin/netstat")
55
if($ARGV[0] && $ARGV[0] eq "config")
57
print "graph_title Netstat\n";
58
print "graph_args -l 0 --base 1000\n";
59
print "graph_vlabel requests connections\n";
60
print "requests.label requests\n";
61
print "requests.type COUNTER\n";
62
print "requests.max 50000\n";
63
print "accepts.label accepts\n";
64
print "accepts.type COUNTER\n";
65
print "accepts.max 50000\n";
66
print "established.label established\n";
67
print "established.type COUNTER\n";
68
print "established.max 50000\n";
69
print "closed.label closed\n";
70
print "closed.type COUNTER\n";
71
print "closed.max 50000\n";
75
my(%toFind) = ("requests" => "connection requests",
76
"accepts" => "connection accepts",
77
"established" => "connections established",
78
"closed" => "connections closed ("
81
my($item,$line,@lineArray);
83
foreach $item (keys(%toFind))
85
$line = `/usr/bin/netstat -s|grep '$toFind{$item}'`;
86
@lineArray = split(/ +/,$line);
87
print "$item.value $lineArray[0]\n";