diff options
Diffstat (limited to 'plugin/varnish.php')
-rw-r--r-- | plugin/varnish.php | 46 |
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 | |||
5 | require_once 'conf/common.inc.php'; | ||
6 | require_once 'type/Default.class.php'; | ||
7 | require_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; | ||
28 | switch($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 | } | ||
45 | collectd_flush($obj->identifiers); | ||
46 | $obj->rrd_graph(); | ||