{"id":82343,"date":"2026-07-25T08:02:42","date_gmt":"2026-07-25T00:02:42","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/82343.html"},"modified":"2026-07-25T08:02:42","modified_gmt":"2026-07-25T00:02:42","slug":"%e3%80%8a100%e4%b8%aa%e5%8f%8d%e5%b8%b8%e8%af%86%e7%bb%8f%e9%aa%8c22%ef%bc%9a%e7%94%a8shell%e5%86%99%e4%b8%80%e4%b8%aa%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%81%a5%e5%ba%b7%e6%a3%80%e6%9f%a5","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/82343.html","title":{"rendered":"\u300a100\u4e2a\u201c\u53cd\u5e38\u8bc6\u201d\u7ecf\u9a8c22\uff1a\u7528shell\u5199\u4e00\u4e2a\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u811a\u672c\u300b"},"content":{"rendered":"<h3>\u672c\u671f\u6458\u8981<\/h3>\n<p>\u670d\u52a1\u5668\u76d1\u63a7\u5de5\u5177\u5f88\u591a&#xff08;Zabbix\u3001Prometheus\u3001\u4e91\u76d1\u63a7&#xff09;&#xff0c;\u4f46\u6709\u65f6\u5019\u4f60\u53ea\u9700\u8981\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u811a\u672c&#xff1a;\u6bcf\u5929\u8dd1\u4e00\u6b21&#xff0c;\u628aCPU\u3001\u5185\u5b58\u3001\u78c1\u76d8\u3001\u7f51\u7edc\u3001\u8fdb\u7a0b\u7b49\u5173\u952e\u6307\u6807\u6c47\u603b\u6210\u62a5\u544a&#xff0c;\u53d1\u5230\u90ae\u7bb1\u6216\u9489\u9489\u3002\u672c\u6587\u4ece\u96f6\u5f00\u59cb&#xff0c;\u6559\u4f60\u5199\u4e00\u4e2a\u5b8c\u6574\u7684\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u811a\u672c\u3002\u5305\u542b&#xff1a;\u83b7\u53d6\u7cfb\u7edf\u8d1f\u8f7d\u3001\u5185\u5b58\u4f7f\u7528\u7387\u3001\u78c1\u76d8\u4f7f\u7528\u7387\u3001\u50f5\u5c38\u8fdb\u7a0b\u6570\u3001\u7f51\u7edc\u8fde\u63a5\u72b6\u6001\u3001\u6700\u8fd1\u767b\u5f55\u8bb0\u5f55\u3001\u7cfb\u7edf\u9519\u8bef\u65e5\u5fd7\u3002\u6700\u540e\u5c06\u7ed3\u679c\u683c\u5f0f\u5316\u4e3a\u6613\u8bfb\u7684\u6587\u672c&#xff0c;\u5e76\u81ea\u52a8\u53d1\u9001\u544a\u8b66\u3002\u8bfb\u5b8c\u4f60\u5c31\u80fd\u5b9a\u5236\u81ea\u5df1\u4e13\u5c5e\u7684\u5065\u5eb7\u68c0\u67e5\u5de5\u5177\u3002<\/p>\n<h3>\u4e3a\u4ec0\u4e48\u9700\u8981\u81ea\u5df1\u5199\u68c0\u67e5\u811a\u672c&#xff1f;<\/h3>\n<table>\n<tr>\u573a\u666f\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u5c0f\u56e2\u961f\u6ca1\u6709\u4e13\u4e1a\u76d1\u63a7<\/td>\n<td>\u5199\u4e2a\u811a\u672c\u6bcf\u5929\u8dd1\u4e00\u6b21&#xff0c;\u6210\u672c\u51e0\u4e4e\u4e3a\u96f6<\/td>\n<\/tr>\n<tr>\n<td>\u4e91\u76d1\u63a7\u4e0d\u591f\u7ec6<\/td>\n<td>\u81ea\u5b9a\u4e49\u68c0\u67e5\u7279\u5b9a\u8fdb\u7a0b\u3001\u7279\u5b9a\u7aef\u53e3<\/td>\n<\/tr>\n<tr>\n<td>\u76d1\u63a7\u76f2\u533a<\/td>\n<td>\u6bd4\u5982\u50f5\u5c38\u8fdb\u7a0b\u3001\u65f6\u949f\u540c\u6b65\u504f\u5dee<\/td>\n<\/tr>\n<tr>\n<td>\u5b9a\u65f6\u5de1\u68c0<\/td>\n<td>\u6bcf\u5468\u751f\u6210\u4e00\u4efd\u5065\u5eb7\u62a5\u544a\u5b58\u6863<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u4e00\u4e2a\u5b8c\u6574\u7684\u5065\u5eb7\u68c0\u67e5\u811a\u672c<\/h3>\n<p>bash<\/p>\n<p>#!\/bin\/bash<br \/>\n# \u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u811a\u672c v1.0<br \/>\n# \u7528\u9014&#xff1a;\u6536\u96c6\u7cfb\u7edf\u5173\u952e\u6307\u6807&#xff0c;\u8f93\u51fa\u62a5\u544a\u5e76\u53d1\u9001\u544a\u8b66<\/p>\n<p>THRESHOLD_CPU&#061;80      # CPU\u544a\u8b66\u9608\u503c(%)<br \/>\nTHRESHOLD_MEM&#061;90      # \u5185\u5b58\u544a\u8b66\u9608\u503c(%)<br \/>\nTHRESHOLD_DISK&#061;85     # \u78c1\u76d8\u544a\u8b66\u9608\u503c(%)<br \/>\nTHRESHOLD_ZOMBIE&#061;5    # \u50f5\u5c38\u8fdb\u7a0b\u544a\u8b66\u9608\u503c<br \/>\nREPORT_FILE&#061;&#034;\/tmp\/health_check_$(date &#043;%Y%m%d).txt&#034;<br \/>\nALERT_EMAIL&#061;&#034;admin&#064;example.com&#034;<\/p>\n<p># \u683c\u5f0f\u5316\u8f93\u51fa\u51fd\u6570<br \/>\nprint_section() {<br \/>\n    echo &#034;&#034;<br \/>\n    echo &#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;<br \/>\n    echo &#034;$1&#034;<br \/>\n    echo &#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;<br \/>\n}<\/p>\n<p># \u5f00\u59cb\u751f\u6210\u62a5\u544a<br \/>\n{<br \/>\n    echo &#034;\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u62a5\u544a&#034;<br \/>\n    echo &#034;\u68c0\u67e5\u65f6\u95f4: $(date &#039;&#043;%Y-%m-%d %H:%M:%S&#039;)&#034;<br \/>\n    echo &#034;\u4e3b\u673a\u540d: $(hostname)&#034;<br \/>\n    echo &#034;IP\u5730\u5740: $(hostname -I | awk &#039;{print $1}&#039;)&#034;<\/p>\n<p>    # 1. CPU\u8d1f\u8f7d<br \/>\n    print_section &#034;1. CPU\u72b6\u6001&#034;<br \/>\n    LOAD&#061;$(uptime | awk -F&#039;load average:&#039; &#039;{print $2}&#039;)<br \/>\n    echo &#034;\u8d1f\u8f7d: $LOAD&#034;<\/p>\n<p>    CPU_USAGE&#061;$(top -bn1 | grep &#034;Cpu(s)&#034; | awk &#039;{print $2}&#039; | cut -d&#039;%&#039; -f1)<br \/>\n    echo &#034;CPU\u4f7f\u7528\u7387: ${CPU_USAGE}%&#034;<br \/>\n    if (( $(echo &#034;$CPU_USAGE &gt; $THRESHOLD_CPU&#034; | bc -l) )); then<br \/>\n        echo &#034;\u26a0\ufe0f \u8b66\u544a: CPU\u4f7f\u7528\u7387\u8d85\u8fc7\u9608\u503c ${THRESHOLD_CPU}%&#034;<br \/>\n    fi<\/p>\n<p>    # 2. \u5185\u5b58\u72b6\u6001<br \/>\n    print_section &#034;2. \u5185\u5b58\u72b6\u6001&#034;<br \/>\n    MEM_TOTAL&#061;$(free -h | awk &#039;\/^Mem:\/ {print $2}&#039;)<br \/>\n    MEM_USED&#061;$(free -h | awk &#039;\/^Mem:\/ {print $3}&#039;)<br \/>\n    MEM_FREE&#061;$(free -h | awk &#039;\/^Mem:\/ {print $4}&#039;)<br \/>\n    MEM_PERCENT&#061;$(free | awk &#039;\/^Mem:\/ {printf &#034;%.0f&#034;, $3\/$2 * 100}&#039;)<br \/>\n    echo &#034;\u603b\u5185\u5b58: $MEM_TOTAL&#034;<br \/>\n    echo &#034;\u5df2\u7528: $MEM_USED&#034;<br \/>\n    echo &#034;\u7a7a\u95f2: $MEM_FREE&#034;<br \/>\n    echo &#034;\u4f7f\u7528\u7387: ${MEM_PERCENT}%&#034;<br \/>\n    if [ $MEM_PERCENT -gt $THRESHOLD_MEM ]; then<br \/>\n        echo &#034;\u26a0\ufe0f \u8b66\u544a: \u5185\u5b58\u4f7f\u7528\u7387\u8d85\u8fc7\u9608\u503c ${THRESHOLD_MEM}%&#034;<br \/>\n    fi<\/p>\n<p>    # 3. \u78c1\u76d8\u72b6\u6001<br \/>\n    print_section &#034;3. \u78c1\u76d8\u72b6\u6001&#034;<br \/>\n    df -h | grep -v tmpfs | grep -v devtmpfs<\/p>\n<p>    # \u68c0\u67e5\u6bcf\u4e2a\u5206\u533a\u4f7f\u7528\u7387<br \/>\n    df -h | grep -v tmpfs | awk &#039;NR&gt;1 {print $5,$6}&#039; | while read percent mount; do<br \/>\n        usage&#061;$(echo $percent | sed &#039;s\/%\/\/&#039;)<br \/>\n        if [ $usage -gt $THRESHOLD_DISK ]; then<br \/>\n            echo &#034;\u26a0\ufe0f \u8b66\u544a: \u5206\u533a $mount \u4f7f\u7528\u7387 $percent \u8d85\u8fc7\u9608\u503c ${THRESHOLD_DISK}%&#034;<br \/>\n        fi<br \/>\n    done<\/p>\n<p>    # 4. \u50f5\u5c38\u8fdb\u7a0b<br \/>\n    print_section &#034;4. \u8fdb\u7a0b\u72b6\u6001&#034;<br \/>\n    ZOMBIE_COUNT&#061;$(ps aux | awk &#039;$8&#061;&#061;&#034;Z&#034;&#039; | grep -v grep | wc -l)<br \/>\n    echo &#034;\u50f5\u5c38\u8fdb\u7a0b\u6570: $ZOMBIE_COUNT&#034;<br \/>\n    if [ $ZOMBIE_COUNT -gt $THRESHOLD_ZOMBIE ]; then<br \/>\n        echo &#034;\u26a0\ufe0f \u8b66\u544a: \u50f5\u5c38\u8fdb\u7a0b\u6570\u8d85\u8fc7\u9608\u503c $THRESHOLD_ZOMBIE&#034;<br \/>\n        ps aux | awk &#039;$8&#061;&#061;&#034;Z&#034;&#039;<br \/>\n    fi<\/p>\n<p>    # CPU\u5360\u7528TOP5<br \/>\n    echo &#034;&#034;<br \/>\n    echo &#034;CPU\u5360\u7528TOP5:&#034;<br \/>\n    ps aux &#8211;sort&#061;-%cpu | head -6 | tail -5 | awk &#039;{print $3&#034;%&#034;, $11}&#039;<\/p>\n<p>    # \u5185\u5b58\u5360\u7528TOP5<br \/>\n    echo &#034;&#034;<br \/>\n    echo &#034;\u5185\u5b58\u5360\u7528TOP5:&#034;<br \/>\n    ps aux &#8211;sort&#061;-%mem | head -6 | tail -5 | awk &#039;{print $4&#034;%&#034;, $11}&#039;<\/p>\n<p>    # 5. \u7f51\u7edc\u8fde\u63a5<br \/>\n    print_section &#034;5. \u7f51\u7edc\u8fde\u63a5&#034;<br \/>\n    ESTABLISHED&#061;$(ss -t state established | tail -n &#043;2 | wc -l)<br \/>\n    TIME_WAIT&#061;$(ss -t state time-wait | tail -n &#043;2 | wc -l)<br \/>\n    echo &#034;\u5df2\u5efa\u7acb\u8fde\u63a5: $ESTABLISHED&#034;<br \/>\n    echo &#034;TIME_WAIT\u8fde\u63a5: $TIME_WAIT&#034;<\/p>\n<p>    # \u68c0\u67e5\u5e38\u89c1\u670d\u52a1\u7aef\u53e3<br \/>\n    echo &#034;&#034;<br \/>\n    echo &#034;\u670d\u52a1\u7aef\u53e3\u68c0\u67e5:&#034;<br \/>\n    for port in 22 80 443 3306 6379; do<br \/>\n        if ss -tln | grep -q &#034;:$port &#034;; then<br \/>\n            echo &#034;\u2705 \u7aef\u53e3 $port \u5df2\u76d1\u542c&#034;<br \/>\n        else<br \/>\n            echo &#034;\u274c \u7aef\u53e3 $port \u672a\u76d1\u542c&#034;<br \/>\n        fi<br \/>\n    done<\/p>\n<p>    # 6. \u6700\u8fd1\u767b\u5f55\u8bb0\u5f55<br \/>\n    print_section &#034;6. \u6700\u8fd1\u767b\u5f55&#034;<br \/>\n    last -10 | head -10<\/p>\n<p>    # 7. \u7cfb\u7edf\u9519\u8bef\u65e5\u5fd7&#xff08;\u6700\u8fd15\u6761&#xff09;<br \/>\n    print_section &#034;7. \u7cfb\u7edf\u9519\u8bef\u65e5\u5fd7&#034;<br \/>\n    journalctl -p err -n 5 &#8211;no-pager 2&gt;\/dev\/null || tail -5 \/var\/log\/messages 2&gt;\/dev\/null<\/p>\n<p>    # 8. \u65f6\u95f4\u540c\u6b65\u68c0\u67e5<br \/>\n    print_section &#034;8. \u65f6\u95f4\u540c\u6b65&#034;<br \/>\n    if command -v chronyc &amp;&gt; \/dev\/null; then<br \/>\n        chronyc tracking | grep &#034;System time&#034;<br \/>\n    else<br \/>\n        echo &#034;chrony\u672a\u5b89\u88c5&#xff0c;\u8df3\u8fc7&#034;<br \/>\n    fi<\/p>\n<p>    echo &#034;&#034;<br \/>\n    echo &#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;<br \/>\n    echo &#034;\u68c0\u67e5\u5b8c\u6210&#xff0c;\u8be6\u7ec6\u62a5\u544a\u5df2\u4fdd\u5b58\u81f3: $REPORT_FILE&#034;<br \/>\n    echo &#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034;<\/p>\n<p>} &gt; $REPORT_FILE<\/p>\n<p># \u8f93\u51fa\u5230\u5c4f\u5e55<br \/>\ncat $REPORT_FILE<\/p>\n<p># \u53d1\u9001\u544a\u8b66&#xff08;\u5982\u6709\u8d85\u8fc7\u9608\u503c&#xff09;<br \/>\nif grep -q &#034;\u26a0\ufe0f&#034; $REPORT_FILE; then<br \/>\n    mail -s &#034;\u26a0\ufe0f \u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u544a\u8b66 &#8211; $(hostname)&#034; $ALERT_EMAIL &lt; $REPORT_FILE<br \/>\n    echo &#034;\u544a\u8b66\u90ae\u4ef6\u5df2\u53d1\u9001&#034;<br \/>\nfi<\/p>\n<h3>\u5982\u4f55\u4f7f\u7528<\/h3>\n<p>1. \u4fdd\u5b58\u811a\u672c<\/p>\n<p>bash<\/p>\n<p>vi \/usr\/local\/bin\/health_check.sh<\/p>\n<p>2. \u6dfb\u52a0\u6267\u884c\u6743\u9650<\/p>\n<p>bash<\/p>\n<p>chmod &#043;x \/usr\/local\/bin\/health_check.sh<\/p>\n<p>3. \u624b\u52a8\u6d4b\u8bd5<\/p>\n<p>bash<\/p>\n<p>.\/health_check.sh<\/p>\n<p>4. \u6dfb\u52a0\u5230crontab\u5b9a\u65f6\u6267\u884c<\/p>\n<p>bash<\/p>\n<p># \u6bcf\u5929\u65e9\u4e0a8\u70b9\u6267\u884c\u4e00\u6b21<br \/>\n0 8 * * * \/usr\/local\/bin\/health_check.sh<\/p>\n<p># \u4e5f\u53ef\u4ee5\u5199\u5230\u65e5\u5fd7\u6587\u4ef6<br \/>\n0 8 * * * \/usr\/local\/bin\/health_check.sh &gt;&gt; \/var\/log\/health_check.log 2&gt;&amp;1<\/p>\n<h3>\u6269\u5c55\u529f\u80fd&#xff1a;\u53d1\u9001\u5230\u9489\u9489\/\u4f01\u4e1a\u5fae\u4fe1<\/h3>\n<p>bash<\/p>\n<p># \u9489\u9489\u673a\u5668\u4eba\u544a\u8b66\u51fd\u6570<br \/>\nsend_dingtalk() {<br \/>\n    WEBHOOK&#061;&#034;https:\/\/oapi.dingtalk.com\/robot\/send?access_token&#061;xxx&#034;<br \/>\n    curl -s -X POST $WEBHOOK -H &#034;Content-Type: application\/json&#034; -d &#034;{<br \/>\n        \\\\&#034;msgtype\\\\&#034;: \\\\&#034;text\\\\&#034;,<br \/>\n        \\\\&#034;text\\\\&#034;: {\\\\&#034;content\\\\&#034;: \\\\&#034;$1\\\\&#034;}<br \/>\n    }&#034;<br \/>\n}<\/p>\n<p># \u5982\u679c\u6709\u544a\u8b66&#xff0c;\u53d1\u9001\u5230\u9489\u9489<br \/>\nif grep -q &#034;\u26a0\ufe0f&#034; $REPORT_FILE; then<br \/>\n    SUMMARY&#061;$(grep &#034;\u26a0\ufe0f&#034; $REPORT_FILE | head -5)<br \/>\n    send_dingtalk &#034;\u670d\u52a1\u5668\u544a\u8b66\\\\n\u4e3b\u673a: $(hostname)\\\\n$SUMMARY&#034;<br \/>\nfi<\/p>\n<h3>\u811a\u672c\u4f18\u5316\u5efa\u8bae<\/h3>\n<table>\n<tr>\u4f18\u5316\u70b9\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u914d\u7f6e\u6587\u4ef6\u5316<\/td>\n<td>\u628a\u9608\u503c\u3001\u90ae\u7bb1\u7b49\u53c2\u6570\u653e\u5230\u5916\u90e8\u914d\u7f6e\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>\u65e5\u5fd7\u5f52\u6863<\/td>\n<td>\u68c0\u67e5\u62a5\u544a\u6309\u65e5\u671f\u5f52\u6863&#xff0c;\u4fdd\u755930\u5929<\/td>\n<\/tr>\n<tr>\n<td>\u8fdc\u7a0b\u4e0a\u62a5<\/td>\n<td>\u901a\u8fc7API\u4e0a\u62a5\u5230\u5185\u90e8\u76d1\u63a7\u5e73\u53f0<\/td>\n<\/tr>\n<tr>\n<td>\u591a\u670d\u52a1\u5668<\/td>\n<td>\u7528ansible\u6279\u91cf\u90e8\u7f72&#xff0c;\u7edf\u4e00\u6536\u96c6\u7ed3\u679c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u4e0b\u671f\u9884\u544a<\/h3>\n<p>\u300a100\u4e2a\u201c\u53cd\u5e38\u8bc6\u201d\u7ecf\u9a8c23&#xff1a;rsync\u6bd4scp\u5f3a\u5728\u54ea&#xff1f;\u2014\u2014\u589e\u91cf\u540c\u6b65\u8be6\u89e3\u300b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u671f\u6458\u8981\u670d\u52a1\u5668\u76d1\u63a7\u5de5\u5177\u5f88\u591a&#xff08;Zabbix\u3001Prometheus\u3001\u4e91\u76d1\u63a7&#xff09;&#xff0c;\u4f46\u6709\u65f6\u5019\u4f60\u53ea\u9700\u8981\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u811a\u672c&#xff1a;\u6bcf\u5929\u8dd1\u4e00\u6b21&#xff0c;\u628aCPU\u3001\u5185\u5b58\u3001\u78c1\u76d8\u3001\u7f51\u7edc\u3001\u8fdb\u7a0b\u7b49\u5173\u952e\u6307\u6807\u6c47\u603b\u6210\u62a5\u544a&#xff0c;\u53d1\u5230\u90ae\u7bb1\u6216\u9489\u9489\u3002\u672c\u6587\u4ece\u96f6\u5f00\u59cb&#xff0c;\u6559\u4f60\u5199\u4e00\u4e2a\u5b8c\u6574\u7684\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u811a\u672c\u3002\u5305\u542b&#xff1a;\u83b7\u53d6\u7cfb\u7edf\u8d1f\u8f7d\u3001\u5185\u5b58\u4f7f\u7528\u7387\u3001\u78c1\u76d8\u4f7f\u7528\u7387\u3001\u50f5\u5c38\u8fdb\u7a0b\u6570\u3001\u7f51\u7edc\u8fde\u63a5\u72b6\u6001\u3001\u6700\u8fd1\u767b\u5f55\u8bb0\u5f55\u3001\u7cfb\u7edf\u9519\u8bef\u65e5\u5fd7\u3002\u6700\u540e\u5c06\u7ed3\u679c\u683c\u5f0f\u5316\u4e3a\u6613\u8bfb\u7684\u6587\u672c&amp;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[230,43,44],"topic":[],"class_list":["post-82343","post","type-post","status-publish","format-standard","hentry","category-server","tag-php","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u300a100\u4e2a\u201c\u53cd\u5e38\u8bc6\u201d\u7ecf\u9a8c22\uff1a\u7528shell\u5199\u4e00\u4e2a\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u811a\u672c\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/82343.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u300a100\u4e2a\u201c\u53cd\u5e38\u8bc6\u201d\u7ecf\u9a8c22\uff1a\u7528shell\u5199\u4e00\u4e2a\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u811a\u672c\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u672c\u671f\u6458\u8981\u670d\u52a1\u5668\u76d1\u63a7\u5de5\u5177\u5f88\u591a&#xff08;Zabbix\u3001Prometheus\u3001\u4e91\u76d1\u63a7&#xff09;&#xff0c;\u4f46\u6709\u65f6\u5019\u4f60\u53ea\u9700\u8981\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u811a\u672c&#xff1a;\u6bcf\u5929\u8dd1\u4e00\u6b21&#xff0c;\u628aCPU\u3001\u5185\u5b58\u3001\u78c1\u76d8\u3001\u7f51\u7edc\u3001\u8fdb\u7a0b\u7b49\u5173\u952e\u6307\u6807\u6c47\u603b\u6210\u62a5\u544a&#xff0c;\u53d1\u5230\u90ae\u7bb1\u6216\u9489\u9489\u3002\u672c\u6587\u4ece\u96f6\u5f00\u59cb&#xff0c;\u6559\u4f60\u5199\u4e00\u4e2a\u5b8c\u6574\u7684\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u811a\u672c\u3002\u5305\u542b&#xff1a;\u83b7\u53d6\u7cfb\u7edf\u8d1f\u8f7d\u3001\u5185\u5b58\u4f7f\u7528\u7387\u3001\u78c1\u76d8\u4f7f\u7528\u7387\u3001\u50f5\u5c38\u8fdb\u7a0b\u6570\u3001\u7f51\u7edc\u8fde\u63a5\u72b6\u6001\u3001\u6700\u8fd1\u767b\u5f55\u8bb0\u5f55\u3001\u7cfb\u7edf\u9519\u8bef\u65e5\u5fd7\u3002\u6700\u540e\u5c06\u7ed3\u679c\u683c\u5f0f\u5316\u4e3a\u6613\u8bfb\u7684\u6587\u672c&amp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/82343.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-25T00:02:42+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/82343.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/82343.html\",\"name\":\"\u300a100\u4e2a\u201c\u53cd\u5e38\u8bc6\u201d\u7ecf\u9a8c22\uff1a\u7528shell\u5199\u4e00\u4e2a\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u811a\u672c\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-25T00:02:42+00:00\",\"dateModified\":\"2026-07-25T00:02:42+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/82343.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/82343.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/82343.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u300a100\u4e2a\u201c\u53cd\u5e38\u8bc6\u201d\u7ecf\u9a8c22\uff1a\u7528shell\u5199\u4e00\u4e2a\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u811a\u672c\u300b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u300a100\u4e2a\u201c\u53cd\u5e38\u8bc6\u201d\u7ecf\u9a8c22\uff1a\u7528shell\u5199\u4e00\u4e2a\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u811a\u672c\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/82343.html","og_locale":"zh_CN","og_type":"article","og_title":"\u300a100\u4e2a\u201c\u53cd\u5e38\u8bc6\u201d\u7ecf\u9a8c22\uff1a\u7528shell\u5199\u4e00\u4e2a\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u811a\u672c\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u672c\u671f\u6458\u8981\u670d\u52a1\u5668\u76d1\u63a7\u5de5\u5177\u5f88\u591a&#xff08;Zabbix\u3001Prometheus\u3001\u4e91\u76d1\u63a7&#xff09;&#xff0c;\u4f46\u6709\u65f6\u5019\u4f60\u53ea\u9700\u8981\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u811a\u672c&#xff1a;\u6bcf\u5929\u8dd1\u4e00\u6b21&#xff0c;\u628aCPU\u3001\u5185\u5b58\u3001\u78c1\u76d8\u3001\u7f51\u7edc\u3001\u8fdb\u7a0b\u7b49\u5173\u952e\u6307\u6807\u6c47\u603b\u6210\u62a5\u544a&#xff0c;\u53d1\u5230\u90ae\u7bb1\u6216\u9489\u9489\u3002\u672c\u6587\u4ece\u96f6\u5f00\u59cb&#xff0c;\u6559\u4f60\u5199\u4e00\u4e2a\u5b8c\u6574\u7684\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u811a\u672c\u3002\u5305\u542b&#xff1a;\u83b7\u53d6\u7cfb\u7edf\u8d1f\u8f7d\u3001\u5185\u5b58\u4f7f\u7528\u7387\u3001\u78c1\u76d8\u4f7f\u7528\u7387\u3001\u50f5\u5c38\u8fdb\u7a0b\u6570\u3001\u7f51\u7edc\u8fde\u63a5\u72b6\u6001\u3001\u6700\u8fd1\u767b\u5f55\u8bb0\u5f55\u3001\u7cfb\u7edf\u9519\u8bef\u65e5\u5fd7\u3002\u6700\u540e\u5c06\u7ed3\u679c\u683c\u5f0f\u5316\u4e3a\u6613\u8bfb\u7684\u6587\u672c&amp;","og_url":"https:\/\/www.wsisp.com\/helps\/82343.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-25T00:02:42+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/82343.html","url":"https:\/\/www.wsisp.com\/helps\/82343.html","name":"\u300a100\u4e2a\u201c\u53cd\u5e38\u8bc6\u201d\u7ecf\u9a8c22\uff1a\u7528shell\u5199\u4e00\u4e2a\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u811a\u672c\u300b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-25T00:02:42+00:00","dateModified":"2026-07-25T00:02:42+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/82343.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/82343.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/82343.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u300a100\u4e2a\u201c\u53cd\u5e38\u8bc6\u201d\u7ecf\u9a8c22\uff1a\u7528shell\u5199\u4e00\u4e2a\u670d\u52a1\u5668\u5065\u5eb7\u68c0\u67e5\u811a\u672c\u300b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/82343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=82343"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/82343\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=82343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=82343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=82343"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=82343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}