Hi to everybody,
I'm actually using plugin to monitorice varnish with cacti "get_varnish_stats.py" but only works with versions 2.x not 3.x. I found that Varnish remove the stats throug telnet, and that is the metod used by get_varnish script for catch data from varnish clients.
Someone knows a plugin to extract data of varnish 3.x and how to install it on cacti server???
Thanks to all
Plugin Cacti for Varnish 3.x
Moderators: Developers, Moderators
Re: Plugin Cacti for Varnish 3.x
Hallo,
a simple way would be to change the python-script.
As I am not very familiar to python, i use awk to get the data from varnishstats
Hope, that helps you
a simple way would be to change the python-script.
As I am not very familiar to python, i use awk to get the data from varnishstats
Code: Select all
#!/usr/bin/python
import os
import re
import sys
import getopt
cmd="varnishstat -1 | grep 'cache_hit ' | awk '{print $2}'"
out=os.popen(cmd).read()
hit = float(out)
cmd="varnishstat -1 | grep 'cache_miss ' | awk '{print $2}'"
out=os.popen(cmd).read()
miss = float(out)
cmd="varnishstat -1 | grep 'client_req ' | awk '{print $2}'"
out=os.popen(cmd).read()
req = float(out)
print 'varnish_requests:'+str(req)+' varnish_hitrate:'+str(round(hit / (hit + miss) * 100, 1))
Who is online
Users browsing this forum: No registered users and 10 guests