Skip to content

Commit

Permalink
Merge pull request #39 from chromko/refactor_attrs
Browse files Browse the repository at this point in the history
Add empty field checks for agent IP and PORT attributes
  • Loading branch information
chromko authored Jun 14, 2017
2 parents e3f5ec7 + 57dd8d8 commit 62969cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion recipes/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
host_group node['zabbix']['host']['group']
use_ip node['zabbix']['host']['agent']['use_ip']
dns node['zabbix']['host']['dns']
port node['zabbix']['agent']['config']['listen_port']
port node['zabbix']['agent']['config']['listen_port'] unless node['zabbix']['agent']['config']['listen_port'].to_s.empty?
ip_address node['zabbix']['host']['ipaddress']

ipmi_enabled node['zabbix']['host']['ipmi']['enabled']
Expand Down
4 changes: 4 additions & 0 deletions templates/default/zabbix_agentd.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@

# agent configuration options

<% unless @listen_ip.to_s.empty? %>
ListenIP=<%= @listen_ip %>
<% end %>
<% unless @listen_port.to_s.empty? %>
ListenPort=<%= @listen_port %>
<% end %>
<% if node['platform'] != 'windows' %>
PidFile=<%= @pidfile %>
<% end %>
Expand Down

0 comments on commit 62969cd

Please sign in to comment.