From 0a547add2f4cc264380d2dab2c472efe5a1d7094 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 3 May 2014 19:17:16 +0200 Subject: 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. --- plugin/vmem.php | 58 --------------------------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 plugin/vmem.php (limited to 'plugin/vmem.php') diff --git a/plugin/vmem.php b/plugin/vmem.php deleted file mode 100644 index f66272b..0000000 --- a/plugin/vmem.php +++ /dev/null @@ -1,58 +0,0 @@ -.rrd - -$obj = new Type_GenericStacked($CONFIG, $_GET); -$obj->rrd_format = '%5.1lf%s'; - -switch($obj->args['type']) { - case 'vmpage_faults': - $obj->data_sources = array('minflt', 'majflt'); - $obj->colors = array('minflt' => '0000f0', - 'majflt' => 'f00000'); - $obj->legend = array('minflt' => 'Minor', - 'majflt' => 'Major'); - $obj->rrd_title = 'Page faults'; - $obj->rrd_vertical = ''; - break; - case 'vmpage_io': - $obj->data_sources = array('in', 'out'); - $obj->legend = array('memory-in' => 'Memory (in)', - 'memory-out' => 'Memory (out)', - 'swap-in' => 'Swap (in)', - 'swap-out' => 'Swap (out)'); - $obj->colors = array('memory-in' => 'ff0000', - 'memory-out' => '0000ff', - 'swap-in' => 'ff00ff', - 'swap-out' => 'ffff00'); - $obj->rrd_title = 'Page IO'; - $obj->rrd_vertical = ''; - break; - case 'vmpage_number': - $obj->data_sources = array('value'); - $obj->order = array('active_anon', 'active_file', - 'anon_pages', 'bounce', - 'dirty', 'file_pages', - 'free_pages', 'inactive_anon', - 'inactive_file', 'mapped', - 'mlock', 'page_table_pages', - 'slab_reclaimable', 'slab_unreclaimable', - 'unevictable', 'unstable', - #'vmscan_write', - 'writeback', 'writeback_temp'); - $obj->rrd_title = 'Pages'; - $obj->rrd_vertical = ''; - break; -} - -$obj->rrd_graph(); -- cgit v1.1