-
Notifications
You must be signed in to change notification settings - Fork 289
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
Zabbix Agent: zabbix_api_server_port is undefined when hostgroup or host api creation is enabled #1410
Comments
Will you show whole log to me? |
Did the same run with the zabbix_proxy. # Zabbix Proxy Setup
#
---
- name: Setup a zabbix proxy.
hosts: zabbix_proxy
become: true
roles:
- role: geerlingguy.mysql
mysql_users:
- name: zabbix_proxy
password: zabbix_proxy
- role: community.zabbix.zabbix_proxy
zabbix_proxy_server: zabbix-1.vagrant;zabbix-2.vagrant
zabbix_api_server_host: zabbix-1.vagrant
zabbix_api_login_user: Admin
zabbix_api_login_pass: zabbix
zabbix_api_create_proxy: true
zabbix_proxy_name: '{{ inventory_hostname }}'
- role: community.zabbix.zabbix_agent
zabbix_agent_package_remove: true
zabbix_agent_server: '{{ zabbix_agent_server_overwrite | default("zabbix-1.vagrant,zabbix-2.vagrant") }}'
zabbix_agent_serveractive: '{{ zabbix_agent_serveractive_overwrite | default("zabbix-1.vagrant;zabbix-2.vagrant") }}'
zabbix_agent2: true
zabbix_api_create_hostgroup: false
zabbix_api_create_hosts: false
zabbix_api_login_pass: zabbix
zabbix_api_login_user: Admin
zabbix_api_server_host: zabbix-1.vagrant
zabbix_agent_tags:
- tag: environment
value: development The same error message is thrown. |
Same issue with zabbix_proxy role when zabbix_api_create_proxy is set.
but the proxy registration task still fails:
However setting zabbix_api_server_port variable in host_vars of host set in zabbix_api_server_host fixes the issue. |
The problem is in ansible itself or netcommon collection.
|
Interesting observation.
|
Tried the following, still fails at last task with same error message
|
Based on the discussion here: ansible/ansible#84374 created a pull request with a proposed fix |
SUMMARY
When running the zabbix-agent role against a linux node and the
zabbix_api_create_hostgroup
or thezabbix_api_create_host
is set totrue
, the playbook fails with the errorFAILED! => {"msg": "'zabbix_api_server_port' is undefined"}
on the task API | Create host groups or API | Create a new host or update an existing host's info respectively.ISSUE TYPE
COMPONENT NAME
Role: zabbix_agent
Part of requirements.yml
requirements.lock
requirements-dev.lock
STEPS TO REPRODUCE
I've created two virtual machines with vagrant. The OS is Ubuntu 22.04. One machine is the zabbix server/agent (zabbix-1.vagrant) and the other machine is just an agent (ubuntu-2204.vagrant).
EXPECTED RESULTS
Hostgroup and host api calls are successful.
ACTUAL RESULTS
The zabbix agent is installed successfully but the api calls for hostgroup and host generation/update fail.
The text was updated successfully, but these errors were encountered: