<% if @data or @hosts -%>
<Plugin snmp>
<% @data.sort_by {|k,v| k}.each do |key,val| -%>
  <Data "<%=key %>">
    Type "<%= val['Type'] %>"
    Table <%= val['Table'] %>
    Instance "<%= val['Instance'] %>"
<% if val['InstancePrefix'] -%>
    InstancePrefix "<%= val['InstancePrefix'] %>"
<% end -%>
    Values <% Array(val['Values']).sort.each do |x| -%>"<%= x %>" <% end %>
<% if val['Scale'] -%>
    Scale <%= val['Scale'] %>
<% end -%>
<% if val['Shitf'] -%>
    Shitf <%= val['Shitf'] %>
<% 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 <% Array(val['Collect']).sort.each do |x| -%>"<%= x -%>" <% end %>
    Interval <%= val['Interval'] %>
  </Host>
<% end -%>
</Plugin>
<% end -%>

<% if @data or @hosts -%>
<Plugin snmp>
<% @data.sort_by {|k,v| k}.each do |key,val| -%>
  <Data "<%=key %>">
    Type "<%= val['Type'] %>"
    Table <%= val['Table'] %>
    Instance "<%= val['Instance'] %>"
<% if val['InstancePrefix'] -%>
    InstancePrefix "<%= val['InstancePrefix'] %>"
<% end -%>
    Values <% Array(val['Values']).each do |x| -%>"<%= x %>" <% end %>
<% if val['Scale'] -%>
    Scale <%= val['Scale'] %>
<% end -%>
<% if val['Shitf'] -%>
    Shitf <%= val['Shitf'] %>
<% 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 <% Array(val['Collect']).sort.each do |x| -%>"<%= x -%>" <% end %>
    Interval <%= val['Interval'] %>
  </Host>
<% end -%>
</Plugin>
<% end -%>

Remove sorting of Values option in data block on snmp plugin
Remove sorting of Values option in data block on snmp plugin
