diff --git a/zabbix_agentd.d/script/osMonitor.sh b/zabbix_agentd.d/script/osMonitor.sh index 5f2a62c..63807a5 100644 --- a/zabbix_agentd.d/script/osMonitor.sh +++ b/zabbix_agentd.d/script/osMonitor.sh @@ -98,11 +98,13 @@ function services() { local s case $1 in servicesList) - s="$(systemctl list-unit-files|grep enabled |wc -l)" + + s="$(systemctl list-unit-files|grep enabled |awk '{print $1}' | awk -F '.' '{print $1}')" echo $s ;; service) - systemctl list-unit-files|grep enabled |awk '{print $1}' | awk -F '.' '{print $1}' + s=$(systemctl list-unit-files|grep enabled) + echo $s ;; esac }