Skip to content

Commit

Permalink
arrayify the values and collects
Browse files Browse the repository at this point in the history
otherwise if you don't pass in an array you get a really awful error :)
  • Loading branch information
kitchen authored and sijis committed Jan 9, 2015
1 parent 15f9ec5 commit 06ad3cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/plugin/snmp.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
Type "<%= val['Type'] %>"
Table <%= val['Table'] %>
Instance "<%= val['Instance'] %>"
Values <% val['Values'].sort.each do |x| -%>"<%= x %>" <% end %>
Values <% Array(val['Values']).sort.each do |x| -%>"<%= x %>" <% end %>
</Data>
<% end -%>
<% @hosts.sort_by {|k,v| k}.each do |key,val| -%>
<Host "<%=key %>">
Address "<%= val['Address'] %>"
Version <%= val['Version'] %>
Community "<%= val['Community'] %>"
Collect <% val['Collect'].sort.each do |x| -%>"<%= x -%>" <% end %>
Collect <% Array(val['Collect']).sort.each do |x| -%>"<%= x -%>" <% end %>
Interval <%= val['Interval'] %>
</Host>
<% end -%>
Expand Down

0 comments on commit 06ad3cd

Please sign in to comment.