Varnish cache statistics

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

davideb
Posts: 6
Joined: Mon Aug 17, 2009 10:14 am
Location: Amsterdam - The Netherland

Sorry for the late reply...

Post by davideb »

basic wrote:I'm not able to import the varnish+xinetd template in Cacti, it's giving me an "Error: XML: Hash version does not exist.". What version of Cacti are you using?

We are still running 0.8.7d here, i'm guessing you're running 0.8.7e and it's not backwards compatible?

Thanks!
I'm using 0.8.7d too. Strange, I can re-export the whole shebang and send it to you. (kind of annoying that these kind of things don't work between patches...)
If you want to mail me directly: db AT sentia POINT nl

Davide
davideb
Posts: 6
Joined: Mon Aug 17, 2009 10:14 am
Location: Amsterdam - The Netherland

Re: Sorry for the late reply...

Post by davideb »

I'm using 0.8.7d too. Strange, I can re-export the whole shebang

Don't know why but it seems that the original XMS was somehow corrupted. Well, here it is again.

Davide
Attachments
varnish.zip
Templates for the statistics.
(4.76 KiB) Downloaded 300 times
jsajdak
Posts: 1
Joined: Thu Nov 12, 2009 1:24 pm

Post by jsajdak »

Thank you for this Davide.

If anyone else grabs this, you may want to note that the original scripts were called varnish.pl or varnish2.pl. For me (maybe my install is screwy), I had to go update the "Data Input Methods" for "Varnish Input Stats" from

/usr/bin/perl <path_cacti>/scripts/test.pl <ip> <port>
to
/usr/bin/perl <path_cacti>/scripts/varnish.pl <ip> <port>

after I imported the template
Xumet
Posts: 18
Joined: Thu Mar 16, 2006 12:02 pm

Post by Xumet »

glen
Posts: 9
Joined: Sun Oct 05, 2008 10:46 am

version 3 combined

Post by glen »

i've combined two templates into superior one:

http://forums.cacti.net/viewtopic.php?p ... ht=#186676
Tiago Cruz
Posts: 7
Joined: Wed Sep 19, 2007 9:00 am

Post by Tiago Cruz »

Guys,

Is not a security problem have this port 6082 open? :o
glen
Posts: 9
Joined: Sun Oct 05, 2008 10:46 am

Post by glen »

you can limit your 8062 port access with iptables, or use interface that is not exposed to the Internet (LAN interface, loopback device), also Varnish 2.1 should have authentication support in admin port, haven't checked as I limit my port access with private network.
rel1sh
Posts: 1
Joined: Mon Sep 10, 2012 7:36 pm

Re: Varnish cache statistics

Post by rel1sh »

Coming in a bit late here, but the current version of varnish (I'm using 3.0.2) has deprecated the "stats" keyword for varnishadm. The recommended way to generate stats is now exclusively through the varnishstat command, which can only be run on the actual varnish server since it needs to read from the shared memory logs.

Does anyone using varnish 3.0 have a working cacti config?
pironic
Posts: 4
Joined: Tue Mar 02, 2010 1:40 pm

Re: Varnish cache statistics

Post by pironic »

rel1sh wrote:Does anyone using varnish 3.0 have a working cacti config?
+1 to the need of this... im looking into making something, but every attempt has been a dead end so far. I'm actually at the point where i might want to emulate the old functionality in a python script on the varnish server.
pironic
Posts: 4
Joined: Tue Mar 02, 2010 1:40 pm

Re: Varnish cache statistics

Post by pironic »

alright i've updated the script to work with varnish > 3... but it has a few more requirements (naturally)

i've just created a stupid simple php file to expose the contents of the varnishstat from the server to the cacti instance... then I did 2 things to the xml file: hosted the file on a different port other than 80. lock down the port it is served on via iptables.
you dont have to use the php file, but you do have to export the "varnishstat -x" command to the python script somehow... the php script i used is also included if you decide to go that route.

The python script needs python 2.7 as well because im using urllib2 and ElementTree.

The graphs are otherwise untouched. Good luck.
Attachments
cacti-varnish-0.2.zip
(4.31 KiB) Downloaded 202 times
CyberNBD
Posts: 1
Joined: Mon Apr 08, 2013 4:12 pm

Re: Varnish cache statistics

Post by CyberNBD »

The Readme states:
"- When creating your graph for your device, make sure to enter the url to the generated
xml file on your varnish-cache server."

Where do we put this?

EDIT: nvm, confused with another template.
glen
Posts: 9
Joined: Sun Oct 05, 2008 10:46 am

Re: Varnish cache statistics

Post by glen »

i posted to the "other thread" (http://forums.cacti.net/viewtopic.php?f=12&t=36093) this:

i've updated template and script to work with varnish3:

https://github.com/glensc/cacti-template-varnish

supports varnish2 as well via "-2" option in poller.

i myself use xinetd, probably other options could be coded as well (ssh, snmp, systemd, ...)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests