mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-25 23:05:30 +02:00
Changed the behaviour of the network map tooltip info for the strict users
This commit is contained in:
parent
c29c47dc09
commit
fd41fba3d8
@ -58,50 +58,17 @@ switch($action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($stats['agents'])) {
|
if (isset($stats['agents'])) {
|
||||||
if ($metaconsole) {
|
// TODO: GET STATUS OF THE AGENTS AND ADD IT TO SUMMARY
|
||||||
include_once ('include/functions_reporting.php');
|
$summary .= count($stats['agents']) .
|
||||||
|
" x " . html_print_image($hack_metaconsole . 'images/bricks.png',true) .
|
||||||
$servers = db_get_all_rows_sql ("SELECT *
|
' ' . __('Agents') . "<br>";
|
||||||
FROM tmetaconsole_setup");
|
|
||||||
if ($servers === false)
|
|
||||||
$servers = array();
|
|
||||||
|
|
||||||
$total_agents = 0;
|
|
||||||
|
|
||||||
foreach ($servers as $server) {
|
|
||||||
// If connection was good then retrieve all data server
|
|
||||||
if (metaconsole_load_external_db ($server)) {
|
|
||||||
$connection = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$connection = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($connection)
|
|
||||||
$data = reporting_get_group_stats();
|
|
||||||
|
|
||||||
metaconsole_restore_db();
|
|
||||||
|
|
||||||
$total_agents += $data["total_agents"];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$total_agents = format_numeric($total_agents);
|
|
||||||
|
|
||||||
$summary .= $total_agents .
|
|
||||||
" x " . html_print_image($hack_metaconsole . 'images/bricks.png',true) .
|
|
||||||
' ' . __('Agents') . "<br>";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$summary .= count($stats['agents']) .
|
|
||||||
" x " . html_print_image($hack_metaconsole . 'images/bricks.png',true) .
|
|
||||||
' ' . __('Agents') . "<br>";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($stats['modules'])) {
|
if (isset($stats['modules'])) {
|
||||||
// TODO: GET STATUS OF THE MODULES AND ADD IT TO SUMMARY
|
// TODO: GET STATUS OF THE MODULES AND ADD IT TO SUMMARY
|
||||||
$summary .= count($stats['modules'])." x ".html_print_image('images/brick.png',true).' '.__('Modules')."<br>";
|
$summary .= count($stats['modules']) .
|
||||||
|
" x " . html_print_image($hack_metaconsole . 'images/brick.png',true) .
|
||||||
|
' ' . __('Modules') . "<br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<h3>'.__('Map summary').'</h3><strong>'.$summary.'</strong>';
|
echo '<h3>'.__('Map summary').'</h3><strong>'.$summary.'</strong>';
|
||||||
@ -120,46 +87,9 @@ switch($action) {
|
|||||||
$summary = '<br>';
|
$summary = '<br>';
|
||||||
|
|
||||||
if (isset($stats['agents'])) {
|
if (isset($stats['agents'])) {
|
||||||
if ($metaconsole) {
|
$summary .= count($stats['agents']) .
|
||||||
include_once ('include/functions_reporting.php');
|
" x " . html_print_image($hack_metaconsole . 'images/bricks.png',true) .
|
||||||
|
' ' . __('Agents') . "<br>";
|
||||||
$servers = db_get_all_rows_sql ("SELECT *
|
|
||||||
FROM tmetaconsole_setup
|
|
||||||
WHERE id = " . $id_server);
|
|
||||||
if ($servers === false)
|
|
||||||
$servers = array();
|
|
||||||
|
|
||||||
$total_agents = 0;
|
|
||||||
|
|
||||||
foreach ($servers as $server) {
|
|
||||||
// If connection was good then retrieve all data server
|
|
||||||
if (metaconsole_load_external_db ($server)) {
|
|
||||||
$connection = true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$connection = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($connection)
|
|
||||||
$data = reporting_get_group_stats();
|
|
||||||
|
|
||||||
metaconsole_restore_db();
|
|
||||||
|
|
||||||
$total_agents += $data["total_agents"];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$total_agents = format_numeric($total_agents);
|
|
||||||
|
|
||||||
$summary .= $total_agents .
|
|
||||||
" x " . html_print_image($hack_metaconsole . 'images/bricks.png',true) .
|
|
||||||
' ' . __('Agents') . "<br>";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$summary .= count($stats['agents']) .
|
|
||||||
" x " . html_print_image($hack_metaconsole . 'images/bricks.png',true) .
|
|
||||||
' ' . __('Agents') . "<br>";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
echo '<h3>'.__('Map summary').'</h3><strong>'.$summary.'</strong>';
|
echo '<h3>'.__('Map summary').'</h3><strong>'.$summary.'</strong>';
|
||||||
break;
|
break;
|
||||||
|
@ -438,6 +438,7 @@ if (is_ajax ()) {
|
|||||||
|
|
||||||
$server = null;
|
$server = null;
|
||||||
if ($metaconsole) {
|
if ($metaconsole) {
|
||||||
|
$strict_user = (bool) db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);
|
||||||
$server = db_get_row('tmetaconsole_setup', 'id', $id_server);
|
$server = db_get_row('tmetaconsole_setup', 'id', $id_server);
|
||||||
|
|
||||||
if (metaconsole_connect($server) != NOERR) {
|
if (metaconsole_connect($server) != NOERR) {
|
||||||
@ -527,7 +528,7 @@ if (is_ajax ()) {
|
|||||||
$size_bad_modules = sizeof ($bad_modules);
|
$size_bad_modules = sizeof ($bad_modules);
|
||||||
|
|
||||||
// Modules down
|
// Modules down
|
||||||
if ($size_bad_modules > 0) {
|
if ($size_bad_modules > 0 && (!$metaconsole || !$strict_user)) {
|
||||||
echo '<strong>'.__('Monitors down').':</strong> '.$size_bad_modules.' / '.$total_modules;
|
echo '<strong>'.__('Monitors down').':</strong> '.$size_bad_modules.' / '.$total_modules;
|
||||||
echo '<ul>';
|
echo '<ul>';
|
||||||
foreach ($bad_modules as $module) {
|
foreach ($bad_modules as $module) {
|
||||||
@ -561,7 +562,7 @@ if (is_ajax ()) {
|
|||||||
$alert_modules = db_get_sql ($sql);
|
$alert_modules = db_get_sql ($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($alert_modules > 0) {
|
if ($alert_modules > 0 && (!$metaconsole || !$strict_user)) {
|
||||||
$sql = sprintf ('SELECT tagente_modulo.nombre, talert_template_modules.last_fired
|
$sql = sprintf ('SELECT tagente_modulo.nombre, talert_template_modules.last_fired
|
||||||
FROM talert_template_modules, tagente_modulo, tagente
|
FROM talert_template_modules, tagente_modulo, tagente
|
||||||
WHERE tagente.id_agente = %d
|
WHERE tagente.id_agente = %d
|
||||||
|
Loading…
x
Reference in New Issue
Block a user