Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to specify type of interface in agent class #697

Merged
merged 7 commits into from
Nov 6, 2020

Conversation

zv0n
Copy link
Contributor

@zv0n zv0n commented Jul 9, 2020

Pull Request (PR) description

This pull request adds option to specify interface type in agent.pp, so you can create an agent that is purely SNMP/JMX/IPMI.

@zv0n
Copy link
Contributor Author

zv0n commented Sep 17, 2020

Can someone take a look at this please?

@@ -16,8 +16,12 @@ def self.instances
)

api_hosts.map do |h|
interface = h['interfaces'].select { |i| i['type'].to_i == 1 && i['main'].to_i == 1 }.first
interface = h['interfaces'].select { |i| i['main'].to_i == 1 }.first
Copy link
Member

Choose a reason for hiding this comment

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

can you add some inline comments to describe the magic that's happening here?

@@ -253,6 +256,7 @@
$zbx_group_create = $zabbix::params::agent_zbx_group_create,
$zbx_templates = $zabbix::params::agent_zbx_templates,
Array[Hash] $zbx_macros = [],
Integer $zbx_interface_type = 1,
Copy link
Member

Choose a reason for hiding this comment

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

can you enforce the datatype a bit more? are negative values allowed? I think there is an upper limit that could be enforced as well?

@bastelfreak bastelfreak added enhancement New feature or request needs-work not ready to merge just yet labels Nov 3, 2020
@zv0n
Copy link
Contributor Author

zv0n commented Nov 6, 2020

@bastelfreak I've made the requested changes and rebased to current master

@bastelfreak bastelfreak removed the needs-work not ready to merge just yet label Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants