10000 When creating a zabbix_item on a host of type zabbix_agent, snmp_trap… by WouterVanHecke123 · Pull Request #1481 · ansible-collections/community.zabbix · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

When creating a zabbix_item on a host of type zabbix_agent, snmp_trap… #1481

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

Conversation

WouterVanHecke123
Copy link
Contributor
@WouterVanHecke123 WouterVanHecke123 commented Mar 6, 2025
SUMMARY

When creating a zabbix_item directly on a host using type zabbix_agent, snmp_trap, snmp_agent, ipmi_agent or jmx_agent, we must provide the interfaceid according to the zabbix API. This PR does implement this.
Fixes #1478

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

community.zabbix.zabbix_item

ADDITIONAL INFORMATION

Detailed information in #1478

@BGmot
Copy link
Collaborator
BGmot commented Mar 7, 2025

Thanks for your interest in contributing.
But there are a lot of coding style / documentation misses...
Try to run locally following

flake8 plugins/
ansible-test sanity -v --color --exclude molecule/ --python <your_python_version>
ansible-test integration -v --color --diff --python 3.12 --requirements --coverage zabbix_item
tox -elinters-py3 -vv
ansible-doc -t module community.zabbix.zabbix_item
python -m pycodestyle --max-line-length 160 --config /dev/null --ignore E402,E741,W503,W504 plugins/modules/
ansible-test sanity --test validate-modules

Fix all the errors and push.

Also you are taking "main" interface but the host can have multiple interfaces of different types. It would be nice to be able to select interface by IP/FQDN and type, can you look into this as well?

@BGmot BGmot self-requested a review March 7, 2025 00:24
@BGmot BGmot self-assigned this Mar 7, 2025
@WouterVanHecke123 WouterVanHecke123 force-pushed the feature/register-items-on-host branch from f9333e6 to 1e91815 Compare March 9, 2025 23:58
@WouterVanHecke123
Copy link
Contributor Author

Did some improvements as requested

Copy link
codecov bot commented Mar 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.10%. Comparing base (6bdeef3) to head (4e0703f).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1481      +/-   ##
==========================================
+ Coverage   79.00%   79.10%   +0.09%     
==========================================
  Files          47       47              
  Lines        5955     5992      +37     
  Branches     1537     1552      +15     
==========================================
+ Hits         4705     4740      +35     
- Misses        770      771       +1     
- Partials      480      481       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@BGmot
Copy link
Collaborator
BGmot commented Apr 6, 2025

Please create a changelog fragment in https://github.com/ansible-collections/community.zabbix/tree/main/changelogs/fragments mentioning that now we support more item types.

@BGmot
Copy link
Collaborator
BGmot commented Apr 8, 2025

Please create a changelog fragment in https://github.com/ansible-collections/community.zabbix/tree/main/changelogs/fragments mentioning that now we support more item types.

And rebase against main, then all the integration tests will pass.

@WouterVanHecke123 WouterVanHecke123 force-pushed the feature/register-items-on-host branch 2 times, most recently from a7ba03e to 3f8b1e5 Compare April 9, 2025 21:39
…, snmp_agent, ipmi_agent or jmx_agent, we must provide the interfaceid
@WouterVanHecke123 WouterVanHecke123 force-pushed the feature/register-items-on-host branch from 3f8b1e5 to 4e0703f Compare April 9, 2025 21:41
@WouterVanHecke123
Copy link
Contributor Author

Implemented the requested remarks & rebased against main

@BGmot
Copy link
Collaborator
BGmot commented Apr 10, 2025

Thanks for contributing!

@BGmot BGmot merged commit 6cc3e59 into ansible-collections:main Apr 10, 2025
53 checks passed
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

Successfully merging this pull request may close these issues.

When using zabbix_item we get an error when trying to create a zabbix_agent item on a Host
2 participants
0