puppet-zabbix icon indicating copy to clipboard operation
puppet-zabbix copied to clipboard

SSLparamters for web monitoring are only supported for zabbix version 2.4

Open anotherfigo opened this issue 7 years ago • 5 comments
trafficstars

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.1.3
  • Ruby: 2.1.0
  • Distribution: CentOS 7
  • Module version: 4.1.3 (installed) but code is the same in newest version (6.0.0)
  • Zabbix: 3.2 and 3.4

How to reproduce (e.g Puppet code you use)

add parameters sslcertlocation_dir and/or sslkeylocation_dir (and/or sslcalocation) to wherever you call the server class

What are you seeing

The corresponding parameters are not added to zabbix_server.conf

What behaviour did you expect instead

The corresponding parameters are added to zabbix_server.conf

Output log

Any additional information you'd like to impart

As I understand this happens because of line 432 in zabbix_server.conf.erb https://github.com/voxpupuli/puppet-zabbix/blob/af5dd3838cfa36d376e2b262af5e110a3fc76f9c/templates/zabbix_server.conf.erb#L432

This should be something like the result of versioncmp($zabbix_version, '2.4') >=0 since these parameters are supported starting at version 2.4 of Zabbix Related zabbix documentation: https://www.zabbix.com/documentation/3.2/manual/web_monitoring

anotherfigo avatar Nov 30 '17 12:11 anotherfigo

Hi @anotherfigo, thanks for reporting this. Are you able to provide a PR for this?

bastelfreak avatar Dec 04 '17 10:12 bastelfreak

@bastelfreak Yes, I am trying to.

anotherfigo avatar Dec 06 '17 09:12 anotherfigo

But I've never used rspec before. Based on my basic knowledge with unit tests, I'd test it with a version 2.3 one 2.4 and one 2.5 to validate border values and of-by-ones. I guess testing if the parameters get written to zabbix_server.conf will be sufficient? So the code would be similar to this: is_expected.to contain_file('/etc/') \ .with_content(/^\s*parametername=$/)

But where should I put those tests to?

anotherfigo avatar Dec 06 '17 09:12 anotherfigo

Well, fixing is easy... its just <% if @zabbix_version.to_f >= 2.4 %> instead of https://github.com/voxpupuli/puppet-zabbix/blob/af5dd3838cfa36d376e2b262af5e110a3fc76f9c/templates/zabbix_server.conf.erb#L432

anotherfigo avatar Dec 06 '17 13:12 anotherfigo

Opened PR here: https://github.com/voxpupuli/puppet-zabbix/pull/469

anotherfigo avatar Dec 07 '17 07:12 anotherfigo