Open leonanu opened 4 years ago
If you have a service that has @
in its name, and it's not in the service_discovery_whitelist
, zabbix creates the item.
eg getty@.service
If you have a service that the name matches with other service names, but are outside the service_discovery_whitelist
, zabbix creates the item.
ex.:
cat service_discovery_whitelist
Result
servicename|ssh|etc
But you have a service with the name = servicename_test.service
Zabbix creates servicename_test
item.
Edit zbx_service_discovery.sh
service_list=$(echo "$service_list" | grep -E -f /etc/zabbix/service_discovery_whitelist)
Fix:
service_list=$(echo "$service_list" | grep -Eiowf /etc/zabbix/service_discovery_whitelist)
If a service unit file named
foo-service.service
, thezbx_service_discovery.sh
will not cut the filename crorrectly.awk -F'.service' '{print $1}')
Fix:awk -F'\\.service' '{print $1}')