mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2014-02-07 Sergio Martin <sergio.martin@artica.es>
* include/functions_visual_map.php include/functions_modules.php include/functions_agents.php include/constants.php: Add code to new "status" Warning fired in visual maps * mobile/operation/agent.php: Fix first time charge of code that set same size to both boxes in agent view git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9413 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b2af235de5
commit
1e6b6b5776
@ -1,3 +1,14 @@
|
|||||||
|
2014-02-07 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
|
* include/functions_visual_map.php
|
||||||
|
include/functions_modules.php
|
||||||
|
include/functions_agents.php
|
||||||
|
include/constants.php: Add code to new "status"
|
||||||
|
Warning fired in visual maps
|
||||||
|
|
||||||
|
* mobile/operation/agent.php: Fix first time charge
|
||||||
|
of code that set same size to both boxes in agent view
|
||||||
|
|
||||||
2014-02-07 Sergio Martin <sergio.martin@artica.es>
|
2014-02-07 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* mobile/operation/networkmaps.php
|
* mobile/operation/networkmaps.php
|
||||||
|
@ -159,6 +159,7 @@ define('AGENT_MODULE_STATUS_NO_DATA', 4);
|
|||||||
define('AGENT_MODULE_STATUS_NORMAL', 0);
|
define('AGENT_MODULE_STATUS_NORMAL', 0);
|
||||||
define('AGENT_MODULE_STATUS_NOT_NORMAL', 6);
|
define('AGENT_MODULE_STATUS_NOT_NORMAL', 6);
|
||||||
define('AGENT_MODULE_STATUS_WARNING', 2);
|
define('AGENT_MODULE_STATUS_WARNING', 2);
|
||||||
|
define('AGENT_MODULE_STATUS_WARNING_ALERT', 200);
|
||||||
define('AGENT_MODULE_STATUS_UNKNOWN', 3);
|
define('AGENT_MODULE_STATUS_UNKNOWN', 3);
|
||||||
define('AGENT_MODULE_STATUS_NOT_INIT', 5);
|
define('AGENT_MODULE_STATUS_NOT_INIT', 5);
|
||||||
|
|
||||||
|
@ -1552,6 +1552,10 @@ function agents_get_status($id_agent = 0, $noACLs = false) {
|
|||||||
if (is_int(array_search(AGENT_MODULE_STATUS_CRITICAL_ALERT, $modules_status))) {
|
if (is_int(array_search(AGENT_MODULE_STATUS_CRITICAL_ALERT, $modules_status))) {
|
||||||
return AGENT_MODULE_STATUS_CRITICAL_ALERT;
|
return AGENT_MODULE_STATUS_CRITICAL_ALERT;
|
||||||
}
|
}
|
||||||
|
// Checking if any module has alert fired
|
||||||
|
elseif (is_int(array_search(AGENT_MODULE_STATUS_WARNING_ALERT, $modules_status))) {
|
||||||
|
return AGENT_MODULE_STATUS_WARNING_ALERT;
|
||||||
|
}
|
||||||
// Checking if any module has critical status
|
// Checking if any module has critical status
|
||||||
elseif (is_int(array_search(AGENT_MODULE_STATUS_CRITICAL_BAD, $modules_status))) {
|
elseif (is_int(array_search(AGENT_MODULE_STATUS_CRITICAL_BAD, $modules_status))) {
|
||||||
return AGENT_MODULE_STATUS_CRITICAL_BAD;
|
return AGENT_MODULE_STATUS_CRITICAL_BAD;
|
||||||
|
@ -1331,30 +1331,40 @@ function modules_get_agentmodule_status($id_agentmodule = 0, $without_alerts = f
|
|||||||
$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) {
|
||||||
|
$status_row = db_get_row ("tagente_estado", "id_agente_modulo", $id_agentmodule);
|
||||||
|
|
||||||
if (!$without_alerts) {
|
if (!$without_alerts) {
|
||||||
$times_fired = db_get_value ('SUM(times_fired)', 'talert_template_modules', 'id_agent_module', $id_agentmodule);
|
$times_fired = db_get_value ('SUM(times_fired)', 'talert_template_modules', 'id_agent_module', $id_agentmodule);
|
||||||
if ($times_fired > 0) {
|
if ($times_fired > 0) {
|
||||||
return AGENT_MODULE_STATUS_CRITICAL_ALERT; // Alert fired
|
switch($status_row['estado']) {
|
||||||
|
case AGENT_STATUS_WARNING:
|
||||||
|
return AGENT_MODULE_STATUS_WARNING_ALERT; // Alert fired in warning
|
||||||
|
break;
|
||||||
|
case AGENT_STATUS_CRITICAL:
|
||||||
|
return AGENT_MODULE_STATUS_CRITICAL_ALERT; // Alert fired in critical
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$status_row = db_get_row ("tagente_estado", "id_agente_modulo", $id_agentmodule);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$status_row = db_get_row ("tagente_estado", "id_agente_modulo", $id_agentmodule);
|
||||||
|
|
||||||
if (!$without_alerts) {
|
if (!$without_alerts) {
|
||||||
$times_fired = db_get_value ('SUM(times_fired)', 'talert_template_modules', 'id_agent_module', $id_agentmodule);
|
$times_fired = db_get_value ('SUM(times_fired)', 'talert_template_modules', 'id_agent_module', $id_agentmodule);
|
||||||
if ($times_fired > 0) {
|
if ($times_fired > 0) {
|
||||||
return AGENT_MODULE_STATUS_CRITICAL_ALERT; // Alert fired
|
switch($status_row['estado']) {
|
||||||
|
case AGENT_STATUS_WARNING:
|
||||||
|
return AGENT_MODULE_STATUS_WARNING_ALERT; // Alert fired in warning
|
||||||
|
break;
|
||||||
|
case AGENT_STATUS_CRITICAL:
|
||||||
|
return AGENT_MODULE_STATUS_CRITICAL_ALERT; // Alert fired in critical
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$status_row = db_get_row ("tagente_estado", "id_agente_modulo", $id_agentmodule);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $status_row['estado'];
|
return $status_row['estado'];
|
||||||
|
@ -882,8 +882,13 @@ function visual_map_get_status_element($layoutData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($status == AGENT_MODULE_STATUS_CRITICAL_ALERT) {
|
switch ($status) {
|
||||||
|
case AGENT_MODULE_STATUS_CRITICAL_ALERT:
|
||||||
$status = VISUAL_MAP_STATUS_CRITICAL_ALERT;
|
$status = VISUAL_MAP_STATUS_CRITICAL_ALERT;
|
||||||
|
break;
|
||||||
|
case AGENT_MODULE_STATUS_WARNING_ALERT:
|
||||||
|
$status = VISUAL_MAP_STATUS_WARNING_ALERT;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $status;
|
return $status;
|
||||||
|
@ -189,8 +189,6 @@ class Agent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set_same_heigth();
|
|
||||||
|
|
||||||
$( window ).resize(function() {
|
$( window ).resize(function() {
|
||||||
if ($('.ui-block-a').css('float') == 'none') {
|
if ($('.ui-block-a').css('float') == 'none') {
|
||||||
$('.agent_graphs').height('auto');
|
$('.agent_graphs').height('auto');
|
||||||
@ -200,7 +198,12 @@ class Agent {
|
|||||||
set_same_heigth();
|
set_same_heigth();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if ($('.ui-block-a').css('float') != 'none') {
|
||||||
|
set_same_heigth();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>");
|
</script>");
|
||||||
|
|
||||||
$ui->endContent();
|
$ui->endContent();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user