Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu Jun 22, 2017 5:04 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Varnish Template
PostPosted: Mon Feb 15, 2010 6:19 am 
Offline

Joined: Thu Mar 16, 2006 12:02 pm
Posts: 26
Hi!

I've made a varnish template based in the "munin" template located in the trunk version. It's a "beta version".

See you
Xavier


Attachments:
varnish_template.png
varnish_template.png [ 18.91 KiB | Viewed 14699 times ]
VarnishCacti.rar [28.68 KiB]
Downloaded 762 times
Top
 Profile  
 
 Post subject: version 3
PostPosted: Wed Apr 14, 2010 4:45 pm 
Offline

Joined: Sun Oct 05, 2008 10:46 am
Posts: 9
i combined templates from this post [1] and script from the other post [2], and built up what i took the liberty to call version 3.

this way i can have many graphs and do not have to play with snmp, don't need to do anything than open port of varnishd.

you may want to upgrade to version 2.1 your varnish, as 2.0 are missing "uptime" column, but all other graphs should be okay. i personally can live without the uptime graph :)

you can download it from here:
http://glen.alkohol.ee/pld/cacti-templa ... h-3.tar.gz

[1] http://forums.cacti.net/viewtopic.php?p=182152
[2] http://forums.cacti.net/viewtopic.php?t=31260


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 10, 2010 11:44 pm 
Offline

Joined: Fri Jul 14, 2006 7:18 am
Posts: 8
Location: Los Angeles
Thanks a lot, it works on my varnish 2.0.x
cacti/spine is 0.8.7e


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 17, 2010 5:22 pm 
Offline

Joined: Fri Sep 17, 2010 5:14 pm
Posts: 1
Does not work on 2.1.2 Varnish, output format has changed.
To make it worse output format is now different when you connect via telnet or just do varnishstat -1

I've modified script and template to reflect that. Call it version 4 if you like.
The python script no longer connect over telnet, but executes remote ssh command.
Make sure you have private-public key auth setup between cacti and varnish hosts.


Attachments:
cacti-template-varnish-4.zip [33.24 KiB]
Downloaded 666 times
Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 24, 2010 12:38 pm 
Offline

Joined: Fri Sep 10, 2010 2:03 pm
Posts: 1
Client OS: CentOS 5.5 64bit
Varnish version: 2.1.2-1
I tried varnish4 and am getting:
09/24/2010 01:30:02 PM - CMDPHP: Poller[0] Host[2] DS[258] CMD: /usr/bin/python /usr/share/cacti/scripts/get_varnish_stats.py -h <host IP>, output: U

I took out the host IP in the above line. Here is what happens when I run the script by hand /usr/bin/python /usr/share/cacti/scripts/get_varnish_stats.py -h hostIP:

client_conn:333121 client_drop:0 client_req:1117404 cache_hit:967173 cache_hitpass:0 cache_miss:97962 backend_conn:67563 backend_unhealthy:0 backend_busy:0 backend_fail:0 backend_reuse:82765 backend_toolate:15228 backend_recycle:97993 backend_unused:0 fetch_head:0 fetch_length:84664 fetch_chunked:13362 fetch_eof:0 fetch_bad:0 fetch_close:16 fetch_oldhttp:0 fetch_zero:44 fetch_failed:10 n_sess_mem:398 n_sess:243 n_object:4796 n_vampireobject:0 n_objectcore:4908 n_objecthead:5660 n_smf:0 n_smf_frag:0 n_smf_large:0 n_vbe_conn:23 n_wrk:121 n_wrk_create:443 n_wrk_failed:0 n_wrk_max:27 n_wrk_queue:0 n_wrk_overflow:2520 n_wrk_drop:0 n_backend:1 n_expired:93042 n_lru_nuked:0 n_lru_saved:0 n_lru_moved:655428 n_deathrow:0 losthdr:582 n_objsendfile:0 n_objwrite:751436 n_objoverflow:0 s_sess:333027 s_req:1117404 s_pipe:52143 s_pass:192 s_fetch:97976 s_hdrbytes:594870970 s_bodybytes:14912987702 sess_closed:122695 sess_pipeline:778 sess_readahead:337 sess_linger:1027598 sess_herd:825124 shm_records:54720521 shm_writes:15965230 shm_flushes:12747563 shm_cont:21143 shm_cycles:27 sm_nreq:0 sm_nobj:0 sm_balloc:0 sm_bfree:0 sma_nreq:199091 sma_nobj:9781 sma_nbytes:114365047 sma_balloc:3565439013 sma_bfree:3451073966 sms_nreq:109 sms_nobj:0 sms_nbytes:0 sms_balloc:53392 sms_bfree:53392 backend_req:98176 n_vcl:1 n_vcl_avail:1 n_vcl_discard:0 n_purge:1 n_purge_add:1 n_purge_retire:0 n_purge_obj_test:0 n_purge_re_test:0 n_purge_dups:0 hcb_nolock:1065060 hcb_lock:52096 hcb_insert:52096 esi_parse:0 esi_errors:0 accept_fail:0 client_drop_late:0 uptime:32972

Does varnishstat return unknown/unparseable data?

Alex DeWolf


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 24, 2010 6:51 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14863
Location: MI, USA
That's a nasty template. I hate templates that return such long data. It does not make for a scalable system. Make sure that your poller_output table has a width large enough to handle this output result. The command would be:

Code:
alter table poller_output modify column output varchar(????) not null default ''


TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Re: Varnish Template
PostPosted: Sun Sep 26, 2010 5:26 pm 
Offline

Joined: Thu Sep 23, 2010 4:38 pm
Posts: 3
Also note that spine has a buffer size of 1024 bytes, so my db inserts were getting truncated (to around 919 chars) and failing with MySQL error 1064 :roll:

The same issue exists with the MySQL template, see http://code.google.com/p/mysql-cacti-templates/issues/detail?id=2

Apparently the workaround is to revert to use the cmd.php poller (but, I'd rather not have to do that).

Also - I don't like the ssh + varnishstat method for retrieving this data, when you could just do this:

Code:
varnishadm -T <host IP:port> stats


(varnishadm is shipped with the Varnish source).

I'll be sticking with the previous version of this template for now I think.


Top
 Profile  
 
 Post subject: Re: Varnish Template
PostPosted: Sun Sep 26, 2010 6:15 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14863
Location: MI, USA
There is a spine ./configure option to increase the buffer to whatever you like. Run ./configure --help prior to making. You will see the option there.

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: Re: Varnish Template
PostPosted: Tue May 24, 2011 5:38 pm 
Offline

Joined: Tue May 24, 2011 5:05 pm
Posts: 1
I modified Bashton version http://blog.bashton.com/2009/varnish-cache-statistics-via-cacti/

This version works with varnish 2.1.3 and later for telnet authentication on management port
With the compatibility for the previous versions, if you want to graph both
You can also graph new installations without traffic (I fixed a division by zero bug)


Attachments:
cacti-varnish-0.2.tar.gz [3.81 KiB]
Downloaded 410 times
Top
 Profile  
 
 Post subject: Re: Varnish Template
PostPosted: Sun Sep 18, 2011 7:03 pm 
Offline

Joined: Thu Sep 23, 2010 4:38 pm
Posts: 3
Telnet to management port / varnishadm will not work with Varnish v3.0 - you have to ssh onto the remote machine and issue varnishstat.

I will probably update this some day, unless someone beats me to it (we are not using v3 yet).


Top
 Profile  
 
 Post subject: Re: Varnish Template
PostPosted: Wed Oct 26, 2011 7:08 am 
Offline

Joined: Fri Jul 16, 2010 8:36 am
Posts: 4
An update for varnish 3 would be great.


Top
 Profile  
 
 Post subject: Re: Varnish Template
PostPosted: Tue Nov 22, 2011 7:49 am 
Offline

Joined: Sun Nov 20, 2011 8:45 pm
Posts: 25
I've been looking into varnish 3 and there is no clean way to get it out remotely.
Im forced to do it now via snmp :-(
Hope something better will come someday.


Top
 Profile  
 
 Post subject: Re: Varnish Template
PostPosted: Thu Nov 24, 2011 6:08 am 
Offline

Joined: Thu Nov 24, 2011 6:00 am
Posts: 3
@niko2,
we are using varnish 2.1.5-1~lenny4
the python script doesn´t work properly.
secret is set and port is accessable.
our error message:

File "/usr/share/cacti/site/scripts/get_varnish_stats.py", line 48, in <module>
req = req.group(0).split()[0]
AttributeError: 'NoneType' object has no attribute 'group'
ERROR: Not enough arguments

any solution ?

Regards,
Hanno


Top
 Profile  
 
 Post subject: Re: Varnish Template
PostPosted: Thu Nov 24, 2011 8:51 am 
Offline

Joined: Thu Nov 24, 2011 6:00 am
Posts: 3
Hi,
I found a solution using varnishadm.
http://forums.cacti.net/viewtopic.php?f=12&t=43772
works fine :D
Regards,
Hanno


Top
 Profile  
 
 Post subject: Re: Varnish Template
PostPosted: Sat Feb 01, 2014 9:10 pm 
Offline

Joined: Sun Oct 05, 2008 10:46 am
Posts: 9
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, ...)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Yahoo [Bot] and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group