mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
Last value report meta with date before
This commit is contained in:
parent
615304712f
commit
83d490df5d
@ -4087,22 +4087,25 @@ function reporting_last_value($report, $content, $datetime, $period)
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$module = new Module($content['id_agent_module']);
|
try {
|
||||||
|
$id_meta = null;
|
||||||
|
if (is_metaconsole()) {
|
||||||
|
$id_meta = metaconsole_get_id_server($content['server_name']);
|
||||||
|
$server = metaconsole_get_connection_by_id($id_meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
$module = new Module($content['id_agent_module'], false, $server['id']);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$result = [];
|
||||||
|
return reporting_check_structure_content($result);
|
||||||
|
}
|
||||||
|
|
||||||
$return['type'] = 'last_value';
|
$return['type'] = 'last_value';
|
||||||
|
|
||||||
if (empty($content['name'])) {
|
if (empty($content['name'])) {
|
||||||
$content['name'] = __('Last Value');
|
$content['name'] = __('Last Value');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_metaconsole()) {
|
|
||||||
$id_meta = metaconsole_get_id_server($content['server_name']);
|
|
||||||
$server = metaconsole_get_connection_by_id($id_meta);
|
|
||||||
if (metaconsole_connect($server) != NOERR) {
|
|
||||||
$result = [];
|
|
||||||
return reporting_check_structure_content($result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$id_agent = $module->agent()->id_agente();
|
$id_agent = $module->agent()->id_agente();
|
||||||
$id_agent_module = $content['id_agent_module'];
|
$id_agent_module = $content['id_agent_module'];
|
||||||
$agent_alias = $module->agent()->alias();
|
$agent_alias = $module->agent()->alias();
|
||||||
@ -4189,10 +4192,6 @@ function reporting_last_value($report, $content, $datetime, $period)
|
|||||||
|
|
||||||
$return['data'] = $result;
|
$return['data'] = $result;
|
||||||
|
|
||||||
if (is_metaconsole()) {
|
|
||||||
metaconsole_restore_db();
|
|
||||||
}
|
|
||||||
|
|
||||||
return reporting_check_structure_content($return);
|
return reporting_check_structure_content($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user