aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin
diff options
context:
space:
mode:
authorAurélien ROUGEMONT2011-04-18 20:08:37 +0200
committerPim van den Berg2011-04-18 20:08:37 +0200
commit36140cf61a3b19c008aec9d19bbe39fbe4e19df9 (patch)
tree3e311b7369ad4ab0d972d2e0d747b91bfd49902d /plugin
parentplugin/zfs_arc: code cosmetics (diff)
downloadapt-panopticon_cgp-36140cf61a3b19c008aec9d19bbe39fbe4e19df9.zip
apt-panopticon_cgp-36140cf61a3b19c008aec9d19bbe39fbe4e19df9.tar.gz
apt-panopticon_cgp-36140cf61a3b19c008aec9d19bbe39fbe4e19df9.tar.bz2
apt-panopticon_cgp-36140cf61a3b19c008aec9d19bbe39fbe4e19df9.tar.xz
plugin: add varnish plugin
Diffstat (limited to 'plugin')
-rw-r--r--plugin/varnish.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/plugin/varnish.php b/plugin/varnish.php
new file mode 100644
index 0000000..703a49f
--- /dev/null
+++ b/plugin/varnish.php
@@ -0,0 +1,46 @@
1<?php
2
3# Collectd varnish plugin
4
5require_once 'conf/common.inc.php';
6require_once 'type/Default.class.php';
7require_once 'inc/collectd.inc.php';
8
9## LAYOUT
10#varnish-default-backend/connections-failures.rrd
11#varnish-default-backend/connections-recycled.rrd
12#varnish-default-backend/connections-success.rrd
13#varnish-default-backend/connections-unused.rrd
14#varnish-default-backend/connections-not-attempted.rrd
15#varnish-default-backend/connections-reuses.rrd
16#varnish-default-backend/connections-too-many.rrd
17#varnish-default-backend/connections-was-closed.rrd
18#varnish-default-cache/cache_result-hitpass.rrd
19#varnish-default-cache/cache_result-hit.rrd
20#varnish-default-cache/cache_result-miss.rrd
21#varnish-default-connections/connections-accepted.rrd
22#varnish-default-connections/connections-dropped.rrd
23#varnish-default-connections/connections-received.rrd
24
25$obj = new Type_Default($CONFIG);
26$obj->width = $width;
27$obj->heigth = $heigth;
28switch($obj->args['pinstance']) {
29 case 'default-backend':
30 $obj->rrd_title = 'backend';
31 $obj->rrd_vertical = 'hits';
32 $obj->rrd_format = '%5.1lf%s';
33 break;
34 case 'default-cache':
35 $obj->rrd_title = 'cache';
36 $obj->rrd_vertical = 'hits';
37 $obj->rrd_format = '%5.1lf%s';
38 break;
39 case 'default-connections':
40 $obj->rrd_title = 'connections';
41 $obj->rrd_vertical = 'hits';
42 $obj->rrd_format = '%5.1lf%s';
43 break;
44}
45collectd_flush($obj->identifiers);
46$obj->rrd_graph();