Skip to content

feat: add Zabbix 7 API compatibility and proxy group support - #1026

Open
mouchymouchy wants to merge 2 commits into
voxpupuli:masterfrom
mouchymouchy:feature/zabbix7-proxygroup
Open

feat: add Zabbix 7 API compatibility and proxy group support#1026
mouchymouchy wants to merge 2 commits into
voxpupuli:masterfrom
mouchymouchy:feature/zabbix7-proxygroup

Conversation

@mouchymouchy

Copy link
Copy Markdown

Pull Request (PR) description

Update the zabbix_host provider to use the new Zabbix 7 API fields:

  • Replace deprecated proxy_hostid with proxyid
  • Add proxy_groupid and monitored_by fields for proxy group support
  • Add proxygroup property to zabbix_host type
  • Fix interfacedetails insync? comparison to use sorted comparison
  • Add monitored_by_group parameter to agent class and resources

@mouchymouchy
mouchymouchy force-pushed the feature/zabbix7-proxygroup branch 2 times, most recently from 778f2d3 to d7c2a01 Compare February 20, 2026 17:01
@mouchymouchy

mouchymouchy commented Feb 20, 2026

Copy link
Copy Markdown
Author

Hi everyone

Proxygroup management appear on zabbix 7 version so all tests with zabbix 6 are failed.
Do I disable proxygroup on zabbix 6 or do you see another approach ?

I added optionnal support of proxygroup on zabbix 7+ release to continue suporting zabbix 6 version.
I should be ready now.

@mouchymouchy
mouchymouchy force-pushed the feature/zabbix7-proxygroup branch from 25a5b46 to 63bb68a Compare March 3, 2026 08:28
Henri Nougayrede added 2 commits March 3, 2026 09:30
Update the zabbix_host provider to use the new Zabbix 7 API fields:
- Replace deprecated proxy_hostid with proxyid
- Add proxy_groupid and monitored_by fields for proxy group support
- Add proxygroup property to zabbix_host type
- Fix interfacedetails insync? comparison to use sorted comparison
- Add monitored_by_group parameter to agent class and resources
Add zabbix 6 support
@mouchymouchy
mouchymouchy force-pushed the feature/zabbix7-proxygroup branch from 63bb68a to 4ef9791 Compare March 3, 2026 08:32

@cvquesty cvquesty left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got a little lost in the toe, so I'm going to lean on the quality of your tests to tell me "it's ok". Otherwise, all looks good.

@teluq-pbrideau

Copy link
Copy Markdown
Contributor

I tried your branch, but it failed compatibility with puppetapi 5.0.0-alpha1.
Should you include the new 7.0.0-alpha4 version to this PR in the zabbix::zabbixapi class? Or should it be in another PR maybe?

I did not find reference to this anywhere, but sorry if this is a duplicate I missed...

I just opened an issue for this version to be released on rubygems.org:
markt-de/zabbixapi#129

@teluq-pbrideau

teluq-pbrideau commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

@mouchymouchy Sorry, I just found a bug in your PR.

When zabbix clients talk directly to the server, this error is raised:

 {
  "code": -32602,
  "message": "Invalid params.",
  "data": "Invalid parameter \"/1\": the parameter \"proxyid\" is missing."
}

You define the monitored_by as 1 or 2, but when there is no proxy, this should be set to 0
https://www.zabbix.com/documentation/7.0/en/manual/api/reference/host/object

monitored_by

Source that is used to monitor the host.
Possible values:
0 - (default) Zabbix server;
1 - Proxy;
2 - Proxy group.

    monitored_by = proxy_groupid && proxyid.nil? ? 2 : 1

If I enter manually monitored_by: 0 instead of your change in this PR, it works as expected. Please fix it so monitored_by is 0 when there is no proxy configured.

EDIT: just to be clear, the problem is in this file: lib/puppet/provider/zabbix_host/ruby.rb on the new line 92.
Solution also could be to delete the entry, as 0 is the default value: host_params.delete(:monitored_by) if host_params[:proxyid].nil?. Not necessarily the cleanest, but it also worked in my tests.

teluq-pbrideau added a commit to teluq-pbrideau/puppet-zabbix that referenced this pull request Apr 29, 2026
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.

3 participants