Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2011
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. eparator="---------------------------------------------------------------------------------"
  4. top -b -n2 -d 0.90 | awk ' /^top/ { i++ } i == 2 {print }'|head -n 13|tail -n +3 >/dev/shm/tmpA.stdin &
  5. pid1=$!
  6.  
  7. #IOTOP=$(iotop -d 0.5 --batch -n 2 -P 2>/dev/null) ; echo "$IOTOP"|grep "Total DISK READ" -A5|tail -n 6 >/tmp/B.stdin &
  8. iotop -d 1.3 --batch -n 2 -P 2>/dev/null |grep "Total DISK READ\:" -A5|tail -n 10|grep -vi 'grep\|sadc\|less\|cut\|bwm' |grep "Total DISK READ\:" -A5 >/dev/shm/tmpB.stdin &
  9. pid2=$!
  10.  
  11. echo "iface Rx Tx Total" >/dev/shm/tmpC.stdin
  12. bwm-ng -I eth0,eth1 -o plain -c 1 -N -t 1500|grep -i eth|cut -b 12- >>/dev/shm/tmpC.stdin &
  13. pid3=$!
  14.  
  15. grep -v "MARK\|Disabled Privacy Extensions" /var/log/messages.log|tail -n 8 >/dev/shm/tmpD.stdin &
  16. pid4=$!
  17.  
  18. nbtscan 192.168.117.1-254 -t 1 -r|grep -vi "ILC" |tail -n +5 >/dev/shm/tmpE.stdin &
  19. pid5=$!
  20.  
  21. df -h|grep ' /\|File'|grep -vi 'udev\|infserv\|/dev/shm\|/mnt/nas' >/dev/shm/tmpF.stdin &
  22. pid6=$!
  23.  
  24. wait $pid1
  25. wait $pid2
  26. wait $pid3
  27. wait $pid4
  28. wait $pid5
  29. wait $pid6
  30.  
  31.  
  32. A=$(cat /dev/shm/tmpA.stdin)
  33. B=$(cat /dev/shm/tmpB.stdin)
  34. C=$(cat /dev/shm/tmpC.stdin)
  35. D=$(cat /dev/shm/tmpD.stdin)
  36. E=$(cat /dev/shm/tmpE.stdin)
  37. F=$(cat /dev/shm/tmpF.stdin)
  38.  
  39.  
  40. echo -e "\
  41. [TOP] \n$eparator\n$A\n\n\
  42. [IOTOP] \n$eparator\n$B\n\n\
  43. [BWM-NG] \n$eparator\n$C\n\n\
  44. [DMESG] \n$eparator\n$D\n\n\
  45. [NBTSCAN] \n$eparator\n$E\n\n\
  46. [DISK FREE]\n$eparator\n$F\n\n\
  47. "\
  48. |cut -b 1-80
  49.  
  50.  
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement