检查nginx反向代理节点状态

来源:互联网 发布:程序员群头像 编辑:程序博客网 时间:2024/06/07 00:30
#!/bin/shrslist=($(grep 10.0.0 /application/nginx/conf/extra/upstream01.conf |awk -F "[ :]"'{print $2}'))for ((i=0;i<${#rslist[*]};i++))do   portnum = `nmap ${rslist[i]} -p 80|grep open |wc -l`  if [ $portnum -eq 1 ];then    echo "${rslist[i]} up"  else     echo "${rslist[i]} down"  fidone