Skip to content

Commit

Permalink
Merge pull request #1 from getresults/master
Browse files Browse the repository at this point in the history
Network info tweaks
  • Loading branch information
ashworthconsulting committed Mar 6, 2014
2 parents ab34de7 + 8d39c8d commit cdb47af
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions bin/loadwatch_cpanel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,20 @@ then
/sbin/service httpd fullstatus >> $DIR/$FILE

# Network
echo -e "\n\nNetwork------------------------------------------------------------\n\n" >> $DIR/$FILE
echo -e "\n\nNetwork (number of HTTP connections by connecting ip address) -----\n\n" >> $DIR/$FILE
netstat -tn 2>/dev/null | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | head >> $DIR/$FILE
echo -e "\n\nNetwork 2----------------------------------------------------------\n\n" >> $DIR/$FILE
netstat -tn 2>/dev/null | grep :80 | awk '{print $5}' | cut -d: -f4 | sort | uniq -c | sort -nr | head >> $DIR/$FILE
echo -e "\n\nNetwork 2 (total number of HTTP connections) ----------------------\n\n" >> $DIR/$FILE

netstat -an | grep :80 | wc -l

# check this line - not sure if it's correct as no field 4 for cut. Counting blank lines?
#netstat -tn 2>/dev/null | grep :80 | awk '{print $5}' | cut -d: -f4 | sort | uniq -c | sort -nr | head >> $DIR/$FILE

echo -e "\n\nNetwork 3 (connection states) ----------------------\n\n" >> $DIR/$FILE
netstat -ant | awk '{print $6}' | sort | uniq -c | sort -n

# Email
echo -e "\n\nEmail------------------------------------------------------------\n\n" >> $DIR/$FILE
echo -e "\n\nEmail---------------------------------------------------------------\n\n" >> $DIR/$FILE
#EXIMQUEUE=`exim -bpc`
#echo "Exim Queue: $EXIMQUEUE " >> $DIR/$FILE
/usr/sbin/exiwhat >> $DIR/$FILE
Expand Down

0 comments on commit cdb47af

Please sign in to comment.