summaryrefslogtreecommitdiffstats
path: root/rasmgr/test/check_opensockets.sh
diff options
context:
space:
mode:
Diffstat (limited to 'rasmgr/test/check_opensockets.sh')
-rw-r--r--rasmgr/test/check_opensockets.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/rasmgr/test/check_opensockets.sh b/rasmgr/test/check_opensockets.sh
new file mode 100644
index 0000000..7ec3ab2
--- /dev/null
+++ b/rasmgr/test/check_opensockets.sh
@@ -0,0 +1,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.
+