summaryrefslogtreecommitdiffstats
path: root/rasmgr/test/check_opensockets.sh
blob: 7ec3ab2bb5694d0a2f72bf816e7f33b84aed438f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

# check_opensockets.sh: periodically check the number of waiting sockets in the local system
# parameters:
#	$1	sleep time between checks

export SLEEPTIME=$1

if test "$1" == ""
then
	echo usage: $0 sleepseconds
	exit
fi

echo "$0: start checking for open (waiting) sockets, in intervals of $SLEEPTIME seconds."

while echo \--- check time: `date` \----------------
do
	netstat -na | grep WAIT
	echo summary: `netstat -na | grep WAIT | wc -l` TIME_WAIT state sockets.
	sleep $SLEEPTIME
done

echo $0: done.