2009-12-22 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php: add debug function "f2str" that return as string any call of function, for example "var_dump". *include/fgraph.php: into function "grafico_modulo_boolean" re-add alarms, clean source code and show again the flash graph. *include/functions_db.php: fix the access to IP client, it used very deprecate var, that clean of notice php message of error for this cause. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2229 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
ffbbfa43b1
commit
2c7167ef63
|
@ -1,3 +1,14 @@
|
||||||
|
2009-12-22 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/functions_html.php: add debug function "f2str" that return as
|
||||||
|
string any call of function, for example "var_dump".
|
||||||
|
|
||||||
|
*include/fgraph.php: into function "grafico_modulo_boolean" re-add alarms,
|
||||||
|
clean source code and show again the flash graph.
|
||||||
|
|
||||||
|
*include/functions_db.php: fix the access to IP client, it used very
|
||||||
|
deprecate var, that clean of notice php message of error for this cause.
|
||||||
|
|
||||||
2009-12-21 Ramon Novoa <rnovoa@artica.es>
|
2009-12-21 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* include/api.php: Added an Enterprise API.
|
* include/api.php: Added an Enterprise API.
|
||||||
|
|
|
@ -1233,8 +1233,7 @@ function grafico_modulo_boolean ($idModuleAgent, $period, $show_event,
|
||||||
$date = 0 ) {
|
$date = 0 ) {
|
||||||
global $config;
|
global $config;
|
||||||
global $graphic_type;
|
global $graphic_type;
|
||||||
|
|
||||||
/******WIP****************************************/
|
|
||||||
$nameAgent = get_agentmodule_agent_name ($idModuleAgent);
|
$nameAgent = get_agentmodule_agent_name ($idModuleAgent);
|
||||||
$idAgent = get_agent_id ($nameAgent);
|
$idAgent = get_agent_id ($nameAgent);
|
||||||
$nameModule = get_agentmodule_name ($idModuleAgent);
|
$nameModule = get_agentmodule_name ($idModuleAgent);
|
||||||
|
@ -1246,9 +1245,23 @@ function grafico_modulo_boolean ($idModuleAgent, $period, $show_event,
|
||||||
$interval = (int) ($period / $resolution);
|
$interval = (int) ($period / $resolution);
|
||||||
|
|
||||||
|
|
||||||
//TODO
|
if ($show_event == 1)
|
||||||
//EVENTS AND ALERTS
|
$real_event = array ();
|
||||||
//NEEED TO CODE
|
|
||||||
|
if ($show_alert == 1) {
|
||||||
|
$alert_high = false;
|
||||||
|
$alert_low = false;
|
||||||
|
// If we want to show alerts limits
|
||||||
|
|
||||||
|
$alert_high = get_db_value ('MAX(max_value)', 'talert_template_modules', 'id_agent_module', (int) $id_agente_modulo, true);
|
||||||
|
$alert_low = get_db_value ('MIN(min_value)', 'talert_template_modules', 'id_agent_module', (int) $id_agente_modulo, true);
|
||||||
|
|
||||||
|
// if no valid alert defined to render limits, disable it
|
||||||
|
if (($alert_low === false || $alert_low === NULL) &&
|
||||||
|
($alert_high === false || $alert_high === NULL)) {
|
||||||
|
$show_alert = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$data = get_db_all_rows_filter ('tagente_datos',
|
$data = get_db_all_rows_filter ('tagente_datos',
|
||||||
array ('id_agente_modulo' => $idModuleAgent,
|
array ('id_agente_modulo' => $idModuleAgent,
|
||||||
|
@ -1313,9 +1326,24 @@ function grafico_modulo_boolean ($idModuleAgent, $period, $show_event,
|
||||||
|
|
||||||
$max_value = 1;
|
$max_value = 1;
|
||||||
|
|
||||||
if (! $graphic_type)
|
//if flash graph
|
||||||
return fs_module_chart ($data, $width, $height, $avg_only, $resolution / 10, $time_format);
|
if (! $graphic_type) {
|
||||||
|
$graphPoints2 = array();
|
||||||
|
foreach($graphPoints as $time => $value) {
|
||||||
|
$graphPoints2[] = array(
|
||||||
|
'sum' => $value,
|
||||||
|
'count' => 0,
|
||||||
|
'timestamp_bottom' => $time,
|
||||||
|
'timestamp_top' => ($time + $interval),
|
||||||
|
'min' => 1,
|
||||||
|
'max' => 1,
|
||||||
|
'last' => 1,
|
||||||
|
'events' => 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return fs_module_chart ($graphPoints2, $width, $height, $avg_only, $resolution / 10, $time_format);
|
||||||
|
}
|
||||||
|
|
||||||
$engine = get_graph_engine ($period);
|
$engine = get_graph_engine ($period);
|
||||||
|
|
||||||
$engine->width = $width;
|
$engine->width = $width;
|
||||||
|
@ -1337,10 +1365,7 @@ function grafico_modulo_boolean ($idModuleAgent, $period, $show_event,
|
||||||
$engine->single_graph ();
|
$engine->single_graph ();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
/******WIP****************************************/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw a graph of Module data of agent
|
* Draw a graph of Module data of agent
|
||||||
|
|
|
@ -1514,7 +1514,7 @@ function agent_delete_address ($id_agent, $ip_address) {
|
||||||
process_sql ($sql);
|
process_sql ($sql);
|
||||||
}
|
}
|
||||||
$agent_name = get_agent_name($id_agent, "");
|
$agent_name = get_agent_name($id_agent, "");
|
||||||
audit_db ($config['id_user'], $REMOTE_ADDR, "Agent management",
|
audit_db ($config['id_user'], $_SERVER['REMOTE_ADDR'], "Agent management",
|
||||||
"Deleted IP $ip_address from agent '$agent_name'");
|
"Deleted IP $ip_address from agent '$agent_name'");
|
||||||
|
|
||||||
// Need to change main address?
|
// Need to change main address?
|
||||||
|
@ -2935,7 +2935,7 @@ function delete_agent ($id_agents, $disableACL = false) {
|
||||||
//And at long last, the agent
|
//And at long last, the agent
|
||||||
temp_sql_delete ("tagente", "id_agente", $id_agent);
|
temp_sql_delete ("tagente", "id_agente", $id_agent);
|
||||||
|
|
||||||
audit_db ($config['id_user'], $REMOTE_ADDR, "Agent management",
|
audit_db ($config['id_user'], $_SERVER['REMOTE_ADDR'], "Agent management",
|
||||||
"Deleted agent '$agent_name'");
|
"Deleted agent '$agent_name'");
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,14 @@ function debugPrint ($var, $file = '') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function f2str($function, $params) {
|
||||||
|
ob_start();
|
||||||
|
|
||||||
|
call_user_func_array($function, $params);
|
||||||
|
|
||||||
|
return ob_get_clean();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints an array of fields in a popup menu of a form.
|
* Prints an array of fields in a popup menu of a form.
|
||||||
|
|
Loading…
Reference in New Issue