Skip to content

Commit

Permalink
Merge pull request #86 from DataDog/varnish-multiple-instances
Browse files Browse the repository at this point in the history
varnish: add "name" parameter
  • Loading branch information
miketheman committed Mar 19, 2014
2 parents 0bc4f87 + cb939bb commit c68f781
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 11 additions & 4 deletions recipes/varnish.rb
Original file line number Diff line number Diff line change
@@ -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"
# }
# ]

Expand Down
3 changes: 3 additions & 0 deletions templates/default/varnish.yaml.erb
Original file line number Diff line number Diff line change
@@ -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| -%>
Expand Down

0 comments on commit c68f781

Please sign in to comment.