1. Ports
Local: Ss.netstat,lsof
Remote: TELNET,NMAP.NC
2. Number of local processes
3.header (Http,curl), simulating the user's way
4.URL (Wget,curl). How to impersonate a user
5.php,java Write the monitoring program, simulate the user's way (Let development provide)
Sample Judging conditions
[[email protected] ~]# lsof -i :80|wc -l #本地端口 2[[email protected] ~]# nmap 127.0.0.1 -p 80 # Remote Port starting nmap 5.51 ( http://nmap.org ) at 2017-06-28 14:13 cstnmap scan report for localhost (127.0.0.1) host is up (0.000080s latency). port state service80/tcp open httpnmap done: 1 ip address (1 host up) scanned in 0.05 seconds[[email protected] ~]# nmap 127.0.0.1 -p 80|wc -l8[[email protected] ~]# nmap 127.0.0.1 -p 80|grep open|wc -l 1[[email protected] ~]# ps -ef|grep nginx |wc -l #进程12 [[Email protected] ~]# culr -i -s -w " %{http_code} " -o /dev/null 127.0.0.1200 #curl [[email Protected] ~]# wget --spider --timeout=10 --tries=2 127.0.0.1 &>/dev /null[[email protected] ~]# echo $? #wget看返回值0
Case Shell
#!/bin/bashhttp_code= ' Culr-i-s-w "%{http_code}"-o/dev/null 127.0.0.1 ' if [$http _code-ne]then echo ' web is Erro "Else echo" web is ok "fi
This article is from the "Little Rookie" blog, please be sure to keep this source http://baishuchao.blog.51cto.com/12918589/1942710
Multiple scenarios for Shell monitoring Web services