voxpupuli / puppet-zabbix

Puppet module for creating and maintaining zabbix components with puppet.
https://forge.puppet.com/puppet/zabbix
Apache License 2.0
80 stars 229 forks source link

Add Support for Zabbix Agent 2 #692

Closed aredoff closed 7 months ago

aredoff commented 4 years ago

The current version of this module does not support Zabbix Agent 2. Agent 2 has much more functionality and we would like to switch to it. Please add new agent support to your wonderful module.

jameskirsop commented 3 years ago

I've got a branch with limited agent2 support here: https://github.com/jameskirsop/puppet-zabbix/tree/agent2

It needs some polishing before a PR can be created. Basically, switching out the zabbix_package_agent parameter from zabbix_agent to zabbix_agent2 will do a couple of things:

To standardise a little bit, I've changed the config and pid file names from zabbbix_agentd (old version specific) to zabbix_agent so that they'll appear correct regardless of the agent version that's being run on the system. This means the module should be easier to support in the future (less if statement blocks to determine version).

I'll need to put some more time in to complete the changes so that it's got more coverage, but if you're on a system that uses systemd this may work for you.

PR's to my branch are welcome while I continue chipping away.

jameskirsop commented 3 years ago

I've put work on this on hold until we get #743 done, so that at least I can test a working master release with my branch on top of it in my puppet environments.

Heidistein commented 3 years ago

@jameskirsop I'd like to test your changes, provide feedback and pullrequests (if needed) but could you please update your repo to the latest from master?

shane-davidson commented 3 years ago

@Heidistein would it be more beneficial to just switch the manifest to install agent2 rather than increasing complexity to support both?

I have the following code working for redhat/centos https://github.com/shane-davidson/puppet-zabbix/tree/agent2

I have updated the debian/ubuntu service but have not tested it. my code will remove the old package (zabbix-agent) and install the new (zabbix-agent2)

only thing missing is plugin settings for the new agent which i can easily add.

shane-davidson commented 3 years ago

Updating everything to zabbix-agent2 would also depend on a choco package so I have placed a request for the Zabbix guys to update the choco package to support zabbix-agent2 here: https://github.com/zabbix/zabbix-agent-chocolatey/issues/27

Heidistein commented 3 years ago

I certainly would be easyer and cleaner to just support agent2. However I dare not to choose the agent version for people (just yet). Guaranteed there will be a situation where agent2 is a problem, and agent itself is required. For example, hand in my own pocket, we still have ancient machines, used for the battles of Napoleon, for which there is no agent2 available (nor will there ever).

shane-davidson commented 3 years ago

@Heidistein no worries. I have created a new branch here: https://github.com/shane-davidson/puppet-zabbix/tree/agent_agent2

It keeps all the same variables between agent and agent2 versions and switches between them with the bool $install_agent2 here

considerations:

I have tested this in a centos/redhat environment. Let me know if there is anything you want me to add/fix up.

Heidistein commented 3 years ago

Share, great work. I will read your code after the weekend, sorry. Life happens.

  1. Install agent 2 by default is probably okay. As agent2 is backward compatible with userparams.
  2. It would be great to have them added. I'll spend some time on this.
  3. I am not quite sure what is 'windows' thing is you speak of... ;-). srsly, perhaps via the params default to old engine there.
  4. I can look into redhat and debian (and ubuntu).
  5. Removing the package is desired, however should be toggleable. I seriously have one usecase where both agents are required.
  6. I think the remove agent2 package is required. People using the module will expect it, not because downgrading is required for me, but just because people are, you know, people :)

Again, next week I will help you. I will make testcases and code for debian, allthough redhat is my street.

jameskirsop commented 2 years ago

@Heidistein, I've just merged the latest changes from master onto my branch for you to test / PR against.

Some things I still need to work on / need guidance for /help with:

I also suggest we pull out the plugins section from the module's configuration template and allow users to load in their own plugins configuration as required by using the Include config parameter - and perhaps pre-creating a directory in the configuration root to contain these files as a helper.

vincent-zurczak commented 2 years ago

Hello @jameskirsop. I have no relation with @Heidistein, but I am glad you completed the support of Agent2 on your fork. Thank you for this work! We have been testing it since last week and so far, there are only two glitches we found on Windows:

BTW, we had to create our own Chocolatey package, but that's another topic. We plan starting some tests soon on Linux systems.

jameskirsop commented 2 years ago

Thanks @vincent-zurczak, I've added a commit to address those two issues for Windows.

kristiantaylor commented 2 years ago

hey I am interested in this and wondering if we are close to a choco package with zabbix agent 2

sahaqaa commented 2 years ago

Hello, I am interested in this and wondering if this will be implemented? At least for Unix like OS's :-)

anders-larsson commented 2 years ago

Hi, I'm also interested in support for zabbix-agent2.

amalraj2711 commented 1 year ago

Any ETA for this update?

jpfir commented 1 year ago

Is there any update on this?

SmartSceptic commented 1 year ago

I'm very interested in switching to this module but only when you add 2nd agent support Any ETA for this update?