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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

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

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
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
1 participant