From 79653d74d9c46a9ff41a56ad62be4055f5702f59 Mon Sep 17 00:00:00 2001 From: Carlo Cabanilla Date: Mon, 23 Dec 2013 16:04:26 -0500 Subject: [PATCH 1/2] varnish: add "name" parameter This will let you monitor multiple varnishes per host. Requires [code changes](https://github.com/DataDog/dd-agent/tree/varnish-multiple-instances) before it will work though. --- templates/default/varnish.yaml.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/default/varnish.yaml.erb b/templates/default/varnish.yaml.erb index 8576239e..dd8ef8c6 100644 --- a/templates/default/varnish.yaml.erb +++ b/templates/default/varnish.yaml.erb @@ -1,6 +1,9 @@ instances: <% @instances.each do |i| -%> - varnishstat: <%= i["varnishstat"] || "/usr/bin/varnishstat" %> + <% if i.key?("name") -%> + name: <%= i["name"] %> + <% end -%> <% if i.key?("tags") -%> tags: <% i["tags"].each do |t| -%> From cb939bbb4815bca2a4ffbaf6b450c34317f38431 Mon Sep 17 00:00:00 2001 From: Carlo Cabanilla Date: Mon, 23 Dec 2013 17:29:37 -0500 Subject: [PATCH 2/2] update varnish inline docs --- recipes/varnish.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/recipes/varnish.rb b/recipes/varnish.rb index a8fd81ec..db217d67 100644 --- a/recipes/varnish.rb +++ b/recipes/varnish.rb @@ -1,16 +1,23 @@ include_recipe "datadog::dd-agent" # Monitor Varnish -# -# Assuming you have 2 clusters, one tagged and one with a custom -# path to varnishstat -# you need to set up the following attributes +# +# You'll need to set up the following attributes: # node.datadog.varnish.instances = [ +# +# # Path to varnishstat (required) # { # :varnishstat => "/opt/local/bin/varnishstat" # }, +# +# # Tags to apply to all varnish metrics (optional) # { # :tags => ["test", "cache"] +# }, +# +# # Varnish instance name, passed to varnishstat -n (optional) +# { +# :name => "myvarnish0" # } # ]