Skip to content

glensc/cacti-template-varnish

Repository files navigation

Cacti Varnish Template

Uses advanced template from: http://forums.cacti.net/viewtopic.php?p=182152

Combines script to pull data via Varnish admin port from http://forums.cacti.net/viewtopic.php?t=31260

How to install

  1. Import cacti_host_template_varnish.xml to Cacti
  2. Copy get_varnish_stats.py to scripts
  3. Make the varnishstat available to your Cacti machine (read below)

IMPORTANT: You need to recompile spine with ./configure --with-results-buffer=2048.

For Varnish 2, you can use Varnish management service, configure it to be accessible. For 2.0 make sure you lock down appropriately with iptables or similar, because there is no authentication for this interface, for 2.1 the authentication is (currently) not implemented by this template poller.

Varnish 3 does not have stats command anymore in management interface. You can setup inetd daemon like xinetd to serve the varnishstat command remotely (again be sure to restrict access to prevent any unauthorized access):

service varnishstat
{
    socket_type         = stream
    wait                = no
    user                = nobody
    server              = /usr/bin/varnishstat
    server_args         = -1
    only_from          = 10.10.0.7
    log_on_success      = HOST
}

Samples

Backend Traffic

Backend Traffic

Critbit data

Critbit data

Data structure sizes

Data structure sizes

ESI

ESI

Hitrate %

Hitrate %

Hit rates

Hit rates

LRU activity

LRU activity

Memory allocation requests

Memory allocation requests

Number of objects

Number of objects

Object expunging

Object expunging

Objects delivered with sendfile vs write

Objects delivered with sendfile vs write

Objects overflowing workspace

Objects overflowing workspace

Objects per objecthead

Objects per objecthead

Request rates

Request rates

Session herd

Session herd

Sessions

Sessions

Shared memory activity

Shared memory activity

SHM writes and records

SHM writes and records

Thread status

Thread status

Memory Usage

Memory Usage

Transfer rates

Transfer rates

Uptime

Uptime

VCL and purges

VCL and purges

Author

Elan Ruusamäe [email protected]