echo -e "\nServer :" `uptime`; echo "Apache :" `service httpd status | grep -i uptime`; echo "MySQL :" `echo "status;" | mysql | grep -i uptime`;echo -e "\t" `mysqladmin status`;echo -e "\nType\t Used\t\t Percent"; df -h | sed -n '2,2p' | awk '{print "Disk:\t",$3,"\t\t",$5}';df -i | sed -n '2,2p' | awk '{print "Inodes:\t",$3,"\t",$5,"\n"}';netstat -plan |awk '/.*[0-9]+.[0-9]+.[0-9]+.[0-9].*/{gsub(/::ffff:/,"",$0);print $4"\t" $5}'|cut -sd. -f 1->netstat.log;echo "Netstat report";echo;echo "Number of Connections to each port:";cat netstat.log |awk {'print $1'}|cut -d: -f 2|sort|uniq -c|sort -nk 1|tail;echo;echo "Number of connections from each IP:";cat netstat.log |awk {'print $2'}|cut -d: -f 1|sort|uniq -c|sort -nk 1|tail;echo;echo "The number of instances of a particular IP connecting to particular port";cat netstat.log |awk {'print $1 "\t" $2'}|cut -d: -f 2|sort|uniq -c|sort -nk 1|tail;
No comments:
Post a Comment