From 56c3e85275f09af53ded3c5e10340f6847047a78 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Wed, 15 Jun 2011 22:47:04 +0200 Subject: plugin/contextswitch: collectd 5 compatibility --- plugin/contextswitch.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugin') diff --git a/plugin/contextswitch.php b/plugin/contextswitch.php index 47851e6..8a2036f 100644 --- a/plugin/contextswitch.php +++ b/plugin/contextswitch.php @@ -10,7 +10,7 @@ require_once 'inc/collectd.inc.php'; # contextswitch/contextswitch.rrd $obj = new Type_Default($CONFIG); -$obj->data_sources = array('contextswitches'); +$obj->data_sources = array('value'); $obj->ds_names = array( 'contextswitches' => 'Context switches', ); @@ -23,5 +23,9 @@ $obj->rrd_title = 'Context switches'; $obj->rrd_vertical = 'switch per second Bits'; $obj->rrd_format = '%4.0lf'; +# backwards compatibility +if ($CONFIG['version'] < 5) + $obj->data_sources = array('contextswitches'); + collectd_flush($obj->identifiers); $obj->rrd_graph(); -- cgit v1.1