datadir = $CONFIG['datadir']; $obj->args = array( 'host' => $host, 'plugin' => $plugin, 'pinstance' => $pinstance, 'type' => $type, 'tinstance' => $tinstance, ); $obj->data_sources = array('rx', 'tx'); $obj->ds_names = array( 'rx' => 'Receive ', 'tx' => 'Transmit', ); $obj->colors = array( 'rx' => '0000ff', 'tx' => '00b000', ); $obj->width = $width; $obj->heigth = $heigth; $obj->seconds = $seconds; $obj->rrd_format = '%5.1lf%s'; switch($type) { case 'if_errors': $obj->rrd_title = sprintf('Interface Errors (%s)', $tinstance); $obj->rrd_vertical = 'Errors per second'; break; case 'if_octets': $obj->rrd_title = sprintf('Interface Traffic (%s)', $tinstance); $obj->rrd_vertical = 'Bits per second'; break; case 'if_packets': $obj->rrd_title = sprintf('Interface Packets (%s)', $tinstance); $obj->rrd_vertical = 'Packets per second'; break; } collectd_flush(ident_from_args($obj->args)); $obj->rrd_graph(); ?>