Varnish cache statistics

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

Moderators: Moderators, Developers

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

Sorry for the late reply...

#16 Post by davideb » Wed Nov 04, 2009 9:37 am

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...

#17 Post by davideb » Thu Nov 12, 2009 8:54 am

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 273 times

jsajdak
Posts: 1
Joined: Thu Nov 12, 2009 1:24 pm

#18 Post by jsajdak » Thu Nov 12, 2009 2:24 pm

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

#19 Post by Xumet » Mon Feb 15, 2010 6:51 am


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

version 3 combined

#20 Post by glen » Wed Apr 14, 2010 4:54 pm

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

#21 Post by Tiago Cruz » Fri Apr 30, 2010 9:35 am

Guys,

Is not a security problem have this port 6082 open? :o

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

#22 Post by glen » Sun May 02, 2010 11:56 am

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

#23 Post by rel1sh » Mon Sep 10, 2012 8:01 pm

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

#24 Post by pironic » Wed Sep 26, 2012 10:31 am

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

#25 Post by pironic » Wed Sep 26, 2012 3:49 pm

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 165 times

CyberNBD
Posts: 1
Joined: Mon Apr 08, 2013 4:12 pm

Re: Varnish cache statistics

#26 Post by CyberNBD » Mon Apr 08, 2013 4:13 pm

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

#27 Post by glen » Sat Feb 01, 2014 9:15 pm

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