data_sources = array('hc', 'hp'); $obj->ds_names = array( 'hc' => 'Heures creuses', 'hp' => 'Heures pleines', ); $obj->colors = array( 'hc' => '0000ff', 'hp' => '00b000', ); $obj->rrd_format = '%5.1lf%s'; $instance = $CONFIG['version'] < 5 ? 'tinstance' : 'pinstance'; switch($obj->args['type']) { case 'teleinfo': $obj->data_sources = array('hc', 'hp'); $obj->ds_names = array( 'hc' => 'Heures creuses', 'hp' => 'Heures pleines', ); $obj->colors = array( 'hc' => '0000ff', 'hp' => 'ff0000', ); $obj->rrd_title = sprintf('EDF Teleinformation (%s)', $obj->args['tinstance']); $obj->rrd_vertical = 'Watt/heure'; break; case 'teleinfo_power': $obj->data_sources = array('ic', 'pap'); $obj->ds_names = array( 'ic' => 'Courant', 'pap' => 'Puissance', ); $obj->colors = array( 'ic' => '0000ff', 'pap' => 'ff0000', ); $obj->rrd_title = sprintf('EDF Puissance (%s)', $obj->args['pinstance']); $obj->rrd_vertical = "Watt/Ampere"; /* $obj->scale = $CONFIG['network_datasize'] == 'bits' ? 8 : 1; */ break; } collectd_flush($obj->identifiers); $obj->rrd_graph();