#!/bin/bash


TOTAL_IP=`awk '{

     if($6=="TIME_WAIT"||$6=="LISTEN"||$6=="ESTABLISHED")
    {
        print $5
    }
}' nowcoder.txt| grep "3306" | sort | uniq | wc -l
`

ESTABLISHED=`awk '{

     if($6=="ESTABLISHED")
    {
        print $5,$6
    }
}' nowcoder.txt | grep "3306" | sort  | wc -l
`
TOTAL_LINK=`awk '{

     if($6=="ESTABLISHED")
    {
        print $5
    }
}' nowcoder.txt | grep "3306"|sort | wc -l
`
echo "TOTAL_IP $TOTAL_IP"
echo "ESTABLISHED $ESTABLISHED"
echo  "TOTAL_LINK $TOTAL_LINK"