Closed vitroth closed 4 years ago
@vitroth Thanks for your PR, but please be careful about tests and foodcritic
I'm looking at those test results now trying to understand why it failed. The code in recipes/agent.rb on line 29 appears to be whats causing rake to abort but that wasn't changed by this PR.
The remaining warnings appear to be complaints about accessing node attributes via node[:zabbix]... syntax vs node["zabbix"]. I'll update those.
All foodcritic issues now addressed.
thanks for foodcritic :) :+1:
Oh, you seems to fix rubocop too
Corrected an error introduced while addressing rubocop comments.
Any updates on the status of this PR?
Ping? I have additional changes in our fork that I'd like to submit back upstream as well, but these baseline changes need to be merged first. Is there anything you need from me to make it easier to merge this PR?
@vitroth do you want to be the maintainer ? i dont use zabbix currently ?
Each individual commit has its own comments, but overall these enable a site to use the zabbix cookbook to audit and compare the hosts/items/triggers/templates in the zabbix database against the chef system database, so hosts removed from chef can be removed from monitoring, and monitoring items/triggers that have been added by chef can be removed if chef no longer specifies them (i.e. a host role changed, or trigger rules were changed). (Doing that requires marking items/triggers with a site-specific string in the name when adding them, and then fetching all items/triggers with that name to compare against what the site cookbook's now say should exist.)
Also added a userparam resource type to create zabbix-agent config files in the agent's include_dir. Each userparam resource will create a unique file with a single UserParam configuration entry. This allows sites to configure custom monitoring items in a per-application scalable way.