Skip to content

Instantly share code, notes, and snippets.

@pantaluna
Created October 20, 2014 10:21
Show Gist options
  • Save pantaluna/6049d1c14d4776a03383 to your computer and use it in GitHub Desktop.
Save pantaluna/6049d1c14d4776a03383 to your computer and use it in GitHub Desktop.
collectd varnish 4.0.2
nano /etc/cgi-collectd-varnishstat.sh
#!/bin/bash
echo "Content-Type:application/json"
echo "Cache-Control: no-cache, no-store, must-revalidate"
echo "Pragma: no-cache"
echo "Expires: 0"
echo ""
varnishstat -j -f MAIN.cache*
exit 0
<Plugin curl_json>
# VARNISH metrics:
<URL "http://myserver/cgi-bin/cgi-collectd-varnishstat.sh">
Instance "varnish"
User "xxx"
Password "yyy"
<Key "MAIN.cache_hit/value">
Type "gauge"
Instance "cache_hit"
</Key>
<Key "MAIN.cache_hitpass/value">
Type "gauge"
Instance "cache_hitpass"
</Key>
<Key "MAIN.cache_miss/value">
Type "gauge"
Instance "cache_miss"
</Key>
</URL>
</Plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment