Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in zbx_service_discovery.sh #28

Open
leonanu opened this issue Nov 12, 2020 · 1 comment
Open

Bug in zbx_service_discovery.sh #28

leonanu opened this issue Nov 12, 2020 · 1 comment

Comments

@leonanu
Copy link

leonanu commented Nov 12, 2020

If a service unit file named foo-service.service, the zbx_service_discovery.sh will not cut the filename crorrectly.

awk -F'.service' '{print $1}')
Fix:
awk -F'\\.service' '{print $1}')

@netoayres
Copy link

netoayres commented Jun 23, 2021

  1. If you have a service that has @ in its name, and it's not in the service_discovery_whitelist, zabbix creates the item.
    eg [email protected]

  2. 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants