$oid_value, ); $rrd_name = array('customoid', $customoid['customoid_descr']); if ($customoid['customoid_datatype'] == 'COUNTER') { $datatype = $customoid['customoid_datatype']; } else { $datatype = 'GAUGE'; } $rrd_def = RrdDefinition::make() ->addDataset('oid_value', $datatype); $tags = compact('rrd_name', 'rrd_def'); data_update($device, 'customoid', $tags, $fields); dbUpdate(array('customoid_current' => $oid_value, 'lastupdate' => array('NOW()'), 'customoid_prev' => $prev_oid_value), 'customoids', '`customoid_id` = ?', array($customoid['customoid_id'])); }//end foreach unset($customoid, $prev_oid_value, $rawdata, $user_funcs, $oid_value, $error, $fields, $rrd_def, $rrd_name, $tags);