Fixed metaconsole SNMP interface graphs

This commit is contained in:
Luis Calvo 2020-09-08 11:48:27 +02:00
parent 5093d94db3
commit 4a93f6c3a6
2 changed files with 8 additions and 2 deletions

View File

@ -1286,7 +1286,7 @@ function graphic_combined_module(
if ($count_modules > 0) {
foreach ($module_list as $key => $value) {
$sources[$key]['id_server'] = $value['server'];
$sources[$key]['id_server'] = (isset($value['id_server']) === true) ? $value['id_server'] : $params['id_server'];
$sources[$key]['id_agent_module'] = $value['module'];
$sources[$key]['weight'] = $weights[$key];
$sources[$key]['label'] = $params_combined['labels'];
@ -1339,6 +1339,7 @@ function graphic_combined_module(
$modules = [];
foreach ($sources as $source) {
if (is_metaconsole() === true) {
metaconsole_restore_db();
$server = metaconsole_get_connection_by_id($source['id_server']);
if (metaconsole_connect($server) != NOERR) {
continue;
@ -1499,8 +1500,9 @@ function graphic_combined_module(
}
if (is_metaconsole()) {
metaconsole_restore_db();
$server = metaconsole_get_connection_by_id(
$agent_module_id['server']
isset($agent_module_id['server']) ? $agent_module_id['server'] : $source['id_server']
);
if (metaconsole_connect($server) != NOERR) {
continue;

View File

@ -154,6 +154,10 @@ if ($date > $now) {
'zoom' => $zoom,
];
if (is_metaconsole()) {
$params['id_server'] = $server_id;
}
if ($config['type_interface_charts'] == 'line') {
$stacked = CUSTOM_GRAPH_LINE;
} else {