Netstats / Network Statistics Script

Netstats is a simple script for checking network and Internet connections. The Netstats script is used to display the total request, connection to port 80, ESTABLISHED status, TIME_WAIT status, FIN_WAIT1 status, LAST_ACK status, SYN_RECV status, LISTEN status and CLOSE_WAIT status.

Features

  • Used to find out the netstats.
  • Just copy the code and use it in your command line.
  • Server side script to check network statistics.

Downloads

<!--
Script by hscripts.com
--> <!--
Copywrite of HIOXINDIA
--> <!--
More scripts @www.hscripts.com
-->
nreq=$(netstat -apnut | grep ':80' | grep -v '127.0.0.1' | wc -l) nest=$(netstat -apnut | grep 'ESTABLISHED' | grep -v '127.0.0.1' | wc -l) ntmt=$(netstat -apnut | grep 'TIME_WAIT' | grep -v '127.0.0.1' | wc -l) nfnwt=$(netstat -apnut | grep 'FIN_WAIT1' | grep -v '127.0.0.1' | wc -l) nlst=$(netstat -apnut | grep 'LAST_ACK' | grep -v '127.0.0.1' | wc -l) nsyn=$(netstat -apnut | grep 'SYN_RECV' | grep -v '127.0.0.1' | wc -l) nlist=$(netstat -apnut | grep 'LISTEN' | grep -v '127.0.0.1' | wc -l) ncls=$(netstat -apnut | grep 'CLOSE_WAIT' | grep -v '127.0.0.1' | wc -l)
echo "Total request on"
`date +" %d-%m-%y-%R"` >> test.txt echo "Connection to port 80 " $nreq >> test.txt echo "ESTABLISHED status" $nest >> test.txt echo "TIME_WAIT status" $ntmt >> test.txt echo "FIN_WAIT1 status" $nfnwt >> test.txt echo "LAST_ACK status" $nlst >> test.txt echo "SYN_RECV status" $nsys >> test.txt echo "LISTEN status" $nlist >> test.txt echo "CLOSE_WAIT status" $ncls >> test.txt echo "==================================================" >> test.txt
#------------ Script by hscripts.com -------------------------#

  • Release Date - 06-04-2010
  • Get free version without ©copyright link for just $10/-
  • For customization of this script or any script development, mail to support@hscripts.com

Usage

  • Copy the above code and save it with .sh extension
  • This script is used to find the netstats / network statistics.
  • Execute the netstats shell script as sh filename.sh.
  • All the information are stored in test.txt file. Get the details just open test.txt file and read it.

License

Other Scripts


Ask Questions

Ask Question