<Plugin amqp>
  <Publish "graphite">
    Host "<%= @amqphost %>"
    Port "<%= @amqpport %>"
    VHost "<%= @amqpvhost%>"
    User "<%= @amqpuser %>"
    Password "<%= @amqppass %>"
    Format "<%= @amqpformat %>"
<% if @amqpstorerates and @amqpformat == 'JSON' -%>
    StoreRates true
<% else -%>
    StoreRates false
<% end -%>
    Exchange "<%= @amqpexchange %>"
    Persistent <%= @amqppersistent %>
    RoutingKey "<%= @amqproutingkey %>"
    GraphitePrefix "<%= @graphiteprefix %>"
    GraphiteEscapeChar "<%= @escapecharacter %>"
<% if scope.lookupvar('collectd::collectd_version_real') and (scope.function_versioncmp([scope.lookupvar('collectd::collectd_version_real'), '5.4']) >= 0) -%>
<%   if @graphiteseparateinstances -%>
    GraphiteSeparateInstances <%= @graphiteseparateinstances %>
<%   end -%>
<%   if @graphitealwaysappendds -%>
    GraphiteAlwaysAppendDS <%= @graphitealwaysappendds %>
<%   end -%>
<% end -%>
  </Publish>
</Plugin>
