2013-04-12 Sancho Lerena <slerena@artica.es>
* include/functions.php: Added a new function to detect when a string data is a snapshot or now (by counting \n > 2). * operation/agentes/datos_agente.php: Removed duped column with datetime information on string data. * operation/agentes/estado_monitores.php: Using snapshot detect function. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7970 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
85a36a8c8d
commit
a8eff92aa2
|
@ -1,3 +1,15 @@
|
|||
2013-04-12 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
* include/functions.php: Added a new function to detect
|
||||
when a string data is a snapshot or now (by counting
|
||||
\n > 2).
|
||||
|
||||
* operation/agentes/datos_agente.php: Removed duped
|
||||
column with datetime information on string data.
|
||||
|
||||
* operation/agentes/estado_monitores.php: Using snapshot
|
||||
detect function.
|
||||
|
||||
2013-04-12 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_graph.php: Optimize the event graphs
|
||||
|
|
|
@ -1718,4 +1718,26 @@ function copy_dir($src, $dst) {
|
|||
}
|
||||
closedir($dir);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns 1 if this is Snapshot data, 0 otherwise
|
||||
* Looks for two or more carriage returns.
|
||||
*/
|
||||
|
||||
function is_snapshot_data ($data){
|
||||
|
||||
// TODO IDEA: In the future, we can set a variable in setup
|
||||
// to define how many \n must have a snapshot to define it's
|
||||
// a snapshot. I think two or three is a good value anyway.
|
||||
|
||||
$temp = array();
|
||||
$count = preg_match_all ("/\n/", $data, $temp);
|
||||
|
||||
if ($count > 2)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
@ -112,8 +112,7 @@ else if (preg_match ("/string/", $moduletype_name)) {
|
|||
|
||||
$columns = array(
|
||||
"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "left"),
|
||||
"Data" => array("datos", "modules_format_data", "align" => "left"),
|
||||
"Time" => array("utimestamp", "modules_format_time", "align" => "center")
|
||||
"Data" => array("datos", "modules_format_data", "align" => "left")
|
||||
);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -470,10 +470,10 @@ foreach ($modules as $module) {
|
|||
$module_value = io_safe_output($module["datos"]);
|
||||
}
|
||||
|
||||
// There are carriage returns here ?
|
||||
// If carriage returns present... then is a "Snapshot" data (full command output)
|
||||
if (($config['command_snapshot']) && (preg_match ("/[\n]+/i", io_safe_output($module["datos"])))) {
|
||||
|
||||
$is_snapshot = is_snapshot_data ( $module_value );
|
||||
|
||||
if (($config['command_snapshot']) && ($is_snapshot)){
|
||||
$handle = "snapshot"."_".$module["id_agente_modulo"];
|
||||
$url = 'include/procesos.php?agente='.$module["id_agente_modulo"];
|
||||
$win_handle = dechex(crc32($handle));
|
||||
|
@ -635,4 +635,4 @@ function print_form_filter_monitors($status_filter_monitor = -1,
|
|||
|
||||
ui_toggle($form_text, __('Form filter'), __('Form filter'));
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue