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

Zabbix 7.2 support #1442

Merged
merged 4 commits into from
Feb 6, 2025
Merged

Conversation

mu1f407
Copy link
Contributor

@mu1f407 mu1f407 commented Jan 13, 2025

SUMMARY

This PR adds support for Zabbix 7.2. There are some changes in httpapi plugin which simplifies the code. Fixes modules where tests failed.

Fixes #1431

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

All modules (except inventory plugin)

ADDITIONAL INFORMATION

Notable code changes in httpapi plugin (beside of 7.2 support):

  • Using self.connection._auth for request headers. It makes possible to remove {'auth': 'fake'} conditions.
  • Check for api_version() in the login method. It is more clear replacement for try-except block in login. We now also need to know Zabbix version because it has to be decided if auth should be sent in body or Authorization: Bearer should be in the header.
  • More detailed logging which includes called JSON-RPC method, if used with -vvvv. Example:
    <127.0.0.1> Zabbix httpapi request: POST http://127.0.0.1:8080/api_jsonrpc.php (hostgroup.get)
    <127.0.0.1> Zabbix httpapi request: POST http://127.0.0.1:8080/api_jsonrpc.php (host.get)
    <127.0.0.1> Zabbix httpapi request: POST http://127.0.0.1:8080/api_jsonrpc.php (maintenance.get)
    

Copy link

codecov bot commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 81.53846% with 12 lines in your changes missing coverage. Please review.

Project coverage is 78.49%. Comparing base (a0f5d37) to head (d1b6a1c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
plugins/httpapi/zabbix.py 74.07% 4 Missing and 3 partials ⚠️
plugins/modules/zabbix_host_info.py 54.54% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1442      +/-   ##
==========================================
+ Coverage   78.40%   78.49%   +0.09%     
==========================================
  Files          47       47              
  Lines        5848     5873      +25     
  Branches     1491     1499       +8     
==========================================
+ Hits         4585     4610      +25     
- Misses        780      782       +2     
+ Partials      483      481       -2     

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

@mu1f407 mu1f407 marked this pull request as ready for review January 18, 2025 21:57
@duchenpaul
Copy link

Thanks for the fix, can we get this PR merged as soon as possible?

@drax20144
Copy link

thanks for the work, a merge would be awsome :)

@wessp01
Copy link

wessp01 commented Feb 4, 2025

Thanks for this PR! Everything looks great. Could we get this merged?

@DerkieH
Copy link

DerkieH commented Feb 4, 2025

This would be awesome, a merge would be welcomed!

@chrisallennc
Copy link

@D3DeFi @ragingpastry @BGmot @pyrodie18 @lzadjsf @mu1f407 any ETA on when this will be merged and a new version released? As of now the currently community.zabbix release does not work with Zabbix 7.2

@ricardoklein
Copy link

Hi there,
can we have this soon? Creating hosts manually in Zabbix is no fun after you had a taste of doing it in Ansible.

@pyrodie18 pyrodie18 merged commit 42e2ddb into ansible-collections:main Feb 6, 2025
52 checks passed
@mu1f407 mu1f407 deleted the zabbix-7.2-support branch February 7, 2025 19:53
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.

httpapi not working with Zabbix 7.2.0
8 participants