aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/varnish.php
blob: 4de44637efd50fd6fd4481c41be0757fd1455cf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php

# Collectd varnish plugin

require_once 'conf/common.inc.php';
require_once 'type/Default.class.php';
require_once 'inc/collectd.inc.php';

## LAYOUT
#varnish-default-backend/connections-failures.rrd
#varnish-default-backend/connections-recycled.rrd
#varnish-default-backend/connections-success.rrd
#varnish-default-backend/connections-unused.rrd
#varnish-default-backend/connections-not-attempted.rrd
#varnish-default-backend/connections-reuses.rrd
#varnish-default-backend/connections-too-many.rrd
#varnish-default-backend/connections-was-closed.rrd
#varnish-default-cache/cache_result-hitpass.rrd
#varnish-default-cache/cache_result-hit.rrd
#varnish-default-cache/cache_result-miss.rrd
#varnish-default-connections/connections-accepted.rrd
#varnish-default-connections/connections-dropped.rrd
#varnish-default-connections/connections-received.rrd

$obj = new Type_Default($CONFIG);
$obj->width = $width;
$obj->heigth = $heigth;
$obj->rrd_format = '%5.1lf%s';
switch($obj->args['pinstance']) {
	case 'default-backend':
		$obj->rrd_title = 'backend';
		$obj->rrd_vertical = 'hits';
		break;
	case 'default-cache':
		$obj->rrd_title = 'cache';
		$obj->rrd_vertical = 'hits';
		break;
	case 'default-connections':
		$obj->rrd_title = 'connections';
		$obj->rrd_vertical = 'hits';
		break;
}
collectd_flush($obj->identifiers);
$obj->rrd_graph();