From 984144dbae8764fc074866c6b4d4976139a22853 Mon Sep 17 00:00:00 2001 From: newrain Date: Thu, 17 Jun 2021 23:53:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zabbix_agentd.d/script/dbMonitor.sh | 2 +- zabbix_agentd.d/script/osMonitor.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zabbix_agentd.d/script/dbMonitor.sh b/zabbix_agentd.d/script/dbMonitor.sh index a985859..ad9437a 100644 --- a/zabbix_agentd.d/script/dbMonitor.sh +++ b/zabbix_agentd.d/script/dbMonitor.sh @@ -74,7 +74,7 @@ function Config() { #8、数据库登陆主机为%的用户 function RemoteUser(){ - _result=$($cmdPath -N -u$replUser -p$replPasswd -e "select User from mysql.user where Host='%';" 2>/dev/null | awk '{print $2}') + _result=$($cmdPath -N -u$replUser -p$replPasswd -e "select User from mysql.user where Host='%';" 2>/dev/null | awk '{print $1}') echo $_result } diff --git a/zabbix_agentd.d/script/osMonitor.sh b/zabbix_agentd.d/script/osMonitor.sh index 99d43f4..7d59193 100644 --- a/zabbix_agentd.d/script/osMonitor.sh +++ b/zabbix_agentd.d/script/osMonitor.sh @@ -73,8 +73,8 @@ function conns() { all) netstat -an | grep ESTABLISHED | wc -l ;; - [1-9]*) - lsof -i:$1 | wc -l + [0-9]*) + netstat -tn|grep :80 |grep -v tcp6 |grep "ESTABLISHED" |wc -l ;; esac }