2013年7月3日 星期三

Linux view monitor (cpu memory disk network lan net status)


view cpu
sar
sar - q
mpstat -P ALL 1 1000 # view multi cpu
mpstat 1 10000
ps
top , and then press 1

view memory

cat /proc/meminfo | less
free -u
sar -r
vmstat 5 5
ps
top


view disk
iostat
sar-d
vmstat


view net 


route -n;
nmap -sT 127.0.0.1  ## view open port 
netstat -tlunp ## view connect ; 
netstat -tl ## view listen ; traceroute; nslookup -q=mx domain.com 
netstat -tlnp | grep dovecot ; 

tcpdump -i eth0 -nn host 20.0.0.243 ; 
tcpdump host 20.0.0.244


netstat -i
bwm-ng

sar
tcpdump

dig@8.8.8.8 www.domainName.com ## view dbs
eth tool eth0
iwconfig
ifconfig eth0
mii -tool -u eth0 
lsof -i -n | egrep ## command | listen
arping 20.0.0.111 ## find mac from ip
arp ## list lan ip# abd Mac #


Network Monitor

iptraf

yum install iptraf ## view lan traffic  ## iptraf
apt-get install ntop
iptraf ;


ntop

yum install ntop -yabc123

ntop
i.e. : http:// ipnumber:3000
http://hongkong2000.no-ip.org:3000/

run ntop in background

#nohup ntop > /dev/null 2>&1 &
#kill PID <- it is ntop PID


linux background 
1. nohup means: Do not terminate this process even when the stty is cut off.
2. > /dev/null means: stdout goes to /dev/null (which is a dummy device that does not record any output).
3. 2>&1 means: stderr also goes to the stdout (which is already redirected to /dev/null). You may replace &1 with a file path to keep a log of errors, e.g.: 2>/tmp/myLog
4. & at the end means: run this command as a background task.















ftop

yum install ftop -y
ftop

沒有留言:

張貼留言