From 46fefe8e8fe3f893ceed55918c802053033fa1a2 Mon Sep 17 00:00:00 2001 From: sepich Date: Mon, 10 Mar 2014 10:57:11 -0700 Subject: [PATCH] Plugin template for curl_json --- plugin/curl_json.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 plugin/curl_json.php diff --git a/plugin/curl_json.php b/plugin/curl_json.php new file mode 100644 index 0000000..97765b1 --- /dev/null +++ b/plugin/curl_json.php @@ -0,0 +1,33 @@ +args['type']) { + #COUNTER type example + case 'http_requests': + $obj->data_sources = array('count'); + $obj->ds_names = array('count' => "PHP requests"); + $obj->colors['count'] = '00b000'; + unset($obj->ds_names['value']); + $obj->rrd_title = $obj->args['type'].' of '.$obj->args['pinstance']; + $obj->rrd_vertical = 'con/s'; + break; + + #Insert other COUNTER type values here + + #By default values counted as GAUGE + default: + $obj->rrd_title = $obj->args['type'].' of '.$obj->args['pinstance']; + $obj->rrd_vertical = 'Count'; + break; +} + +$obj->rrd_format = '%5.1lf%s'; + +collectd_flush($obj->identifiers); +$obj->rrd_graph();