diff options
author | Pim van den Berg | 2014-05-03 19:17:16 +0200 |
---|---|---|
committer | Pim van den Berg | 2014-05-12 21:32:24 +0200 |
commit | 0a547add2f4cc264380d2dab2c472efe5a1d7094 (patch) | |
tree | 55bb43a3e31c5814848d61eea92c8438e4a37886 /plugin/swap.php | |
parent | type/base: set default title to "Plugin Type (PluginInstance) (Category)" (diff) | |
download | apt-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 'plugin/swap.php')
-rw-r--r-- | plugin/swap.php | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/plugin/swap.php b/plugin/swap.php deleted file mode 100644 index 140772c..0000000 --- a/plugin/swap.php +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | # Collectd Swap plugin | ||
4 | |||
5 | require_once 'conf/common.inc.php'; | ||
6 | |||
7 | ## LAYOUT | ||
8 | # swap/ | ||
9 | # swap/swap-cached.rrd | ||
10 | # swap/swap-free.rrd | ||
11 | # swap/swap-used.rrd | ||
12 | |||
13 | switch(GET('t')) { | ||
14 | case 'swap': | ||
15 | require_once 'type/GenericStacked.class.php'; | ||
16 | $obj = new Type_GenericStacked($CONFIG, $_GET); | ||
17 | $obj->order = array('free', 'cached', 'used'); | ||
18 | $obj->legend = array( | ||
19 | 'free' => 'Free', | ||
20 | 'cached' => 'Cached', | ||
21 | 'used' => 'Used', | ||
22 | ); | ||
23 | $obj->colors = array( | ||
24 | 'free' => '00e000', | ||
25 | 'cached' => '0000ff', | ||
26 | 'used' => 'ff0000', | ||
27 | ); | ||
28 | $obj->rrd_title = 'Swap utilization'; | ||
29 | $obj->rrd_vertical = 'Bytes'; | ||
30 | break; | ||
31 | case 'swap_io': | ||
32 | require_once 'type/GenericIO.class.php'; | ||
33 | $obj = new Type_GenericIO($CONFIG, $_GET); | ||
34 | $obj->order = array('out', 'in'); | ||
35 | $obj->legend = array( | ||
36 | 'out' => 'Out', | ||
37 | 'in' => 'In', | ||
38 | ); | ||
39 | $obj->colors = array( | ||
40 | 'out' => '0000ff', | ||
41 | 'in' => '00b000', | ||
42 | ); | ||
43 | $obj->rrd_title = 'Swapped I/O pages'; | ||
44 | $obj->rrd_vertical = 'Pages'; | ||
45 | break; | ||
46 | } | ||
47 | |||
48 | $obj->rrd_format = '%5.1lf%s'; | ||
49 | |||
50 | $obj->rrd_graph(); | ||