CDEF Items [edit] (" . db_fetch_cell("select name from cdef where id=$cdef_id") . ")", "", ""); ?>
Choose any one of these items: Function Operator Data Source Special Data Source Another CDEF Custom String
'" . db_fetch_cell("select name from data_input where id=$args[id]") . "'?", getenv("HTTP_REFERER"), "data_input.php?action=remove&id=$args[id]"); include ('include/bottom_footer.php'); exit; } if (($config["remove_verification"]["value"] == "") || ($args[confirm] == "yes")) { db_execute("delete from data_input where id=$args[id]"); db_execute("delete from data_input_fields where data_input_id=$args[id]"); db_execute("delete from data_input_data where data_input_id=$args[id]"); } } function data_save() { include("include/config_arrays.php"); global $form; /* first, find out if any fields have been added -- get a list from POST and compare it to what we've got from the database -- new in 0.8: field names must match [_a-zA-Z], so users *could* include gt's and lt's in their input/output strings by escaping them (ie. \< \>) */ if (preg_match_all("/<([_a-zA-Z0-9]+)>/", $form["input_string"] . $form["output_string"], $matches)) { for ($i=0; ($i < count($matches[1])); $i++) { if (in_array($matches[1][$i], $registered_cacti_names) == false) { if (!db_fetch_cell("select id from data_input_fields where data_name='" . $matches[1][$i] . "' and data_input_id=$form[id]")) { /* new field -- not found in db */ if (!$drew_field) { include_once ("include/top_header.php"); print "
"; start_pagebox("", "98%", "00438C", "3", "center", ""); print "New Fields Detected
\n"; print "Cacti has found additional fields for this data input method. Before cacti can use use fields you must fill in additional information about them below.\n"; print "\n"; end_box(); $drew_field = true; } $j = 0; start_pagebox("", "98%", "aaaaaa", "3", "center", ""); DrawMatrixRowAlternateColorBegin($colors[form_alternate1],$colors[form_alternate2],$j); $j++; print "Field Name
\n"; print "" . $matches[1][$i] . "\n"; print "\n"; DrawMatrixRowAlternateColorBegin($colors[form_alternate1],$colors[form_alternate2],$j); $j++; print "Field Type
\n"; if (strstr($form["input_string"], "<" . $matches[1][$i] . ">") != false) { print "Input\n"; }else{ print "Output\n"; } print "\n"; if (strstr($form["input_string"], "<" . $matches[1][$i] . ">") == false) { DrawMatrixRowAlternateColorBegin($colors[form_alternate1],$colors[form_alternate2],$j); $j++; print "\n"; print "Update RRD File
\n"; print "Whether data from this output field is to be entered into the rrd file."; print "\n"; DrawFormItemCheckBox("active",$data[active],"Update RRD File","on",$args[local_data_id]); print "\n"; } DrawMatrixRowAlternateColorBegin($colors[form_alternate1],$colors[form_alternate2],$j); $j++; print "\n"; print "Name
\n"; print "Enter a meaningful name for this data input method."; print "\n"; DrawFormItemTextBox("name",$data_input[name],"","200", "30"); print "\n"; end_box(); } } } } if ($drew_field == true) { /* if we started a page; finish it */ start_box("", "", ""); ?>
Data Input Methods [edit]", "", ""); if (isset($args[id])) { $data_input = db_fetch_row("select * from data_input where id=$args[id]"); }else{ unset($data_input); } ?>
Name
Enter a meaningful name for this data input method. Input String
The data that in sent to the script, which includes the complete path to the script and input sources in <> brackets. Output String
The data that is expected back from the input script; defined as <> brackets. "; DrawMatrixHeaderItem("Name",$colors[header_text],1); DrawMatrixHeaderItem("Friendly Name",$colors[header_text],2); print ""; $fields = db_fetch_assoc("select id,data_name,name from data_input_fields where data_input_id=$args[id] and input_output='in' order by data_name"); if (sizeof($fields) > 0) { foreach ($fields as $field) { DrawMatrixRowAlternateColorBegin($colors[alternate],$colors[light],$i); $i++; ?> Delete  "; DrawMatrixHeaderItem("Name",$colors[header_text],1); DrawMatrixHeaderItem("Friendly Name",$colors[header_text],1); DrawMatrixHeaderItem("Update RRA",$colors[header_text],2); print ""; $fields = db_fetch_assoc("select id,name,data_name,update_rra from data_input_fields where data_input_id=$args[id] and input_output='out' order by data_name"); if (sizeof($fields) > 0) { foreach ($fields as $field) { DrawMatrixRowAlternateColorBegin($colors[alternate],$colors[light],$i); $i++; ?> Delete 
Data Input Methods", "", "data_input.php?action=edit"); print ""; DrawMatrixHeaderItem("Name",$colors[header_text],1); DrawMatrixHeaderItem(" ",$colors[header_text],1); print ""; $data_inputs = db_fetch_assoc("select * from data_input order by name"); if (sizeof($data_inputs) > 0) { foreach ($data_inputs as $data_input) { DrawMatrixRowAlternateColorBegin($colors[alternate],$colors[light],$i); $i++; ?> Delete