puppet-zabbix
puppet-zabbix copied to clipboard
Add Support for Zabbix Agent 2
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.
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:
- Change the systemd init script to use the new binary name
- Use a new template for the agent2 config
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.
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.
@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?
@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.
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
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).
@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:
- Currently install_agent2 defaults to true. not sure if this is the desired choice? will require testing for different OS
- New plugin settings for agent2 have not had variables/params added to the agent class
- agent2 install will not work for windows yet
- service templates for aix, debian, redhat probably need updating
- Currently automatically removes old package if
$intall_agent2 == true. I assume this is desired? - If downgrading support is required I can add the logic to remove the new package if
$intall_agent2 == false
I have tested this in a centos/redhat environment. Let me know if there is anything you want me to add/fix up.
Share, great work. I will read your code after the weekend, sorry. Life happens.
- Install agent 2 by default is probably okay. As agent2 is backward compatible with userparams.
- It would be great to have them added. I'll spend some time on this.
- I am not quite sure what is 'windows' thing is you speak of... ;-). srsly, perhaps via the params default to old engine there.
- I can look into redhat and debian (and ubuntu).
- Removing the package is desired, however should be toggleable. I seriously have one usecase where both agents are required.
- 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.
@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:
- Best way of cleaning up the startup and config files if someone switches from v1 to v2 or back the other way AND making it optional.
- Testing on non-CentOS/systemd systems
- Updating the module documentation
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.
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:
- First, the service name on Windows should be Zabbix Agent 2 and not Zabbix Agent2 (to be compliant with what the *.msi installer configures).
- Second, the control socket in the agent2 configuration is hard-coded with a Unix path. We have removed it from the template in our tests and it works. This parameter should be templated to only be added on Linux systems.
BTW, we had to create our own Chocolatey package, but that's another topic. We plan starting some tests soon on Linux systems.
Thanks @vincent-zurczak, I've added a commit to address those two issues for Windows.
hey I am interested in this and wondering if we are close to a choco package with zabbix agent 2
Hello, I am interested in this and wondering if this will be implemented? At least for Unix like OS's :-)
Hi, I'm also interested in support for zabbix-agent2.
Any ETA for this update?
Is there any update on this?
I'm very interested in switching to this module but only when you add 2nd agent support Any ETA for this update?