aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/nginx.php
diff options
context:
space:
mode:
authorPim van den Berg2014-05-03 19:17:16 +0200
committerPim van den Berg2014-05-12 21:32:24 +0200
commit0a547add2f4cc264380d2dab2c472efe5a1d7094 (patch)
tree55bb43a3e31c5814848d61eea92c8438e4a37886 /plugin/nginx.php
parenttype/base: set default title to "Plugin Type (PluginInstance) (Category)" (diff)
downloadapt-panopticon_cgp-0a547add2f4cc264380d2dab2c472efe5a1d7094.zip
apt-panopticon_cgp-0a547add2f4cc264380d2dab2c472efe5a1d7094.tar.gz
apt-panopticon_cgp-0a547add2f4cc264380d2dab2c472efe5a1d7094.tar.bz2
apt-panopticon_cgp-0a547add2f4cc264380d2dab2c472efe5a1d7094.tar.xz
graph.php: use JSON plugins instead of including PHP plugin files
A couple of big changes here. A lot of logic moved to graph.php. The PHP plugin files have been rewritten to JSON. In these JSON files *everything* is optional. Also *NOT* having a JSON plugin file won't block you from having a graph. The JSON will just make the graphs prettier (by having a title, y-axis title, legend, colors, etc..). The Collectd types.db file is parsed and used to determine RRD content. When things are not defined in the JSON it will fallback to a default.
Diffstat (limited to '')
-rw-r--r--plugin/nginx.php66
1 files changed, 0 insertions, 66 deletions
diff --git a/plugin/nginx.php b/plugin/nginx.php
deleted file mode 100644
index cbb0fa4..0000000
--- a/plugin/nginx.php
+++ /dev/null
@@ -1,66 +0,0 @@
1<?php
2
3# Collectd nginx plugin
4
5require_once 'conf/common.inc.php';
6require_once 'type/Default.class.php';
7
8## LAYOUT
9# nginx/
10# nginx/connections-accepted.rrd
11# nginx/connections-handled.rrd
12# nginx/nginx_connections-active.rrd
13# nginx/nginx_connections-reading.rrd
14# nginx/nginx_connections-waiting.rrd
15# nginx/nginx_connections-writing.rrd
16# nginx/nginx_requests.rrd
17
18$obj = new Type_Default($CONFIG, $_GET);
19
20switch($obj->args['type'])
21{
22 case 'connections':
23 $obj->order = array('accepted', 'handled');
24 $obj->legend = array(
25 'accepted' => 'Accepted',
26 'handled' => 'Handled',
27 );
28 $obj->colors = array(
29 'accepted' => 'ff0000',
30 'handled' => '0000ff',
31 );
32 $obj->rrd_title = sprintf('nginx connections');
33 $obj->rrd_vertical = 'Connections/s';
34 break;
35 case 'nginx_connections':
36 $obj->order = array('active', 'reading', 'waiting', 'writing');
37 $obj->legend = array(
38 'active' => 'Active',
39 'reading' => 'Reading',
40 'waiting' => 'Waiting',
41 'writing' => 'Writing',
42 );
43 $obj->colors = array(
44 'active' => '005d57',
45 'reading' => '4444ff',
46 'waiting' => 'f24ac8',
47 'writing' => '00cf00',
48 );
49 $obj->rrd_title = sprintf('nginx connections');
50 $obj->rrd_vertical = 'Connections/s';
51 break;
52 case 'nginx_requests':
53 $obj->legend = array(
54 'value' => 'Requests',
55 );
56 $obj->colors = array(
57 'value' => '00aa00',
58 );
59 $obj->rrd_title = sprintf('nginx requests');
60 $obj->rrd_vertical = 'Requests per second';
61 break;
62}
63
64$obj->rrd_format = '%5.1lf%s';
65
66$obj->rrd_graph();