From 9f87fc57018373bdb304ca00427711d0e454a90f Mon Sep 17 00:00:00 2001 From: Benjamin Dupuis Date: Thu, 10 Mar 2011 20:11:11 +0100 Subject: plugin: add postgresql plugin Source: http://www.quake.fr/tmp/plugin_bdu.tar.gz --- plugin/postgresql.php | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 plugin/postgresql.php (limited to 'plugin') diff --git a/plugin/postgresql.php b/plugin/postgresql.php new file mode 100644 index 0000000..bca39f9 --- /dev/null +++ b/plugin/postgresql.php @@ -0,0 +1,65 @@ +width = $width; + $obj->heigth = $heigth; + $obj->ds_names = array( + 'value' => 'Size', + ); + $obj->colors = array( + 'value' => '0000ff', + ); + $obj->rrd_title = sprintf('DB Size %s', + !empty($obj->args['pinstance']) ? $obj->args['pinstance'] : ''); + $obj->rrd_vertical = 'Size'; + $obj->rrd_format = '%5.1lf%s'; + break; + case 'pg_blks': + require_once 'type/GenericStacked.class.php'; + $obj = new Type_GenericStacked($CONFIG); + $obj->width = $width; + $obj->heigth = $heigth; + $obj->generate_colors(); + + $obj->rrd_title = sprintf('%s/%s', $obj->args['pinstance'], $obj->args['type']); + $obj->rrd_vertical = 'Ops per second'; + $obj->rrd_format = '%5.1lf%s'; + break; + case 'pg_n_tup_c': + require_once 'type/GenericStacked.class.php'; + $obj = new Type_GenericStacked($CONFIG); + $obj->width = $width; + $obj->heigth = $heigth; + $obj->generate_colors(); + + $obj->rrd_title = sprintf('%s/%s', $obj->args['pinstance'], $obj->args['type']); + $obj->rrd_vertical = 'Ops per second'; + $obj->rrd_format = '%5.1lf%s'; + break; + +} + + +collectd_flush($obj->identifiers); +$obj->rrd_graph(); -- cgit v1.1