export nginxbin=/usr/local/nginx
export nginxcfg=/etc/nginx/ngins.conf
export nginxip=127.0.0.1
export ret=~/nginx_${nginxip}.txt
export nginxerrlotg=xxxx
echo -e '\n[1] Nginx Version' | tee -a ${ret}
${nginxbin} -V 2>&1 | tee -a ${ret}
echo -e '\n[2] Nginx Config Syntax' | tee -a ${ret}
${nginxbin} -t -c ${nginxcfg} &> /tmp/nginx_conf_check.log
cat /tmp/nginx_conf_check.log | tee -a ${ret}
echo -e '\n[3] Nginx Status' | tee -a ${ret}
ps -eo pid,%cpu,%mem,lstart,etime,cmd |grep "nginx.*${binpath}" |grep -v grep >> ${ret}
echo -e '\n[4] Nginx Config' | tee -a ${ret}
cat ${nginxcfg} >> ${ret}
echo -e '\n[5] System limit' |tee -a ${ret}
ulimit -a |tee -a ${ret}
echo -e '\n[6] 日志tail100' |tee -a ${ret}
tail -n 100 ${nginxerrlotg} |tee -a ${ret}
原创不易,转载时请标明作者及出处。
作者:打个小肥鸡
转自:https://www.sretalk.com/?p=163