2011-03-02 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: added the call to "get_agentmodule_status" without check the alerts status for the color. * include/functions_db.php: in function "get_agentmodule_status" added new parameter "$without_alerts" flag for check without alerts. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4049 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
71e2b2500b
commit
b1318b3e18
|
@ -1,3 +1,11 @@
|
|||
2011-03-02 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_reporting.php: added the call to
|
||||
"get_agentmodule_status" without check the alerts status for the color.
|
||||
|
||||
* include/functions_db.php: in function "get_agentmodule_status" added new
|
||||
parameter "$without_alerts" flag for check without alerts.
|
||||
|
||||
2011-03-02 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/db/postgresql.php, include/db/mysql.php, include/functions.php:
|
||||
|
|
|
@ -2594,16 +2594,19 @@ function format_array_to_where_clause_sql ($values, $join = 'AND', $prefix = fal
|
|||
* Get the status of an agent module.
|
||||
*
|
||||
* @param int Id agent module to check.
|
||||
* @param bool $without_alerts The flag to check only the module, by default false.
|
||||
*
|
||||
* @return int Module status. Value 4 means that some alerts assigned to the
|
||||
* module were fired.
|
||||
*/
|
||||
function get_agentmodule_status($id_agentmodule = 0) {
|
||||
function get_agentmodule_status($id_agentmodule = 0, $without_alerts = false) {
|
||||
$current_timestamp = get_system_time ();
|
||||
|
||||
$times_fired = get_db_value ('SUM(times_fired)', 'talert_template_modules', 'id_agent_module', $id_agentmodule);
|
||||
if ($times_fired > 0) {
|
||||
return 4; // Alert fired
|
||||
if (!$without_alerts) {
|
||||
$times_fired = get_db_value ('SUM(times_fired)', 'talert_template_modules', 'id_agent_module', $id_agentmodule);
|
||||
if ($times_fired > 0) {
|
||||
return 4; // Alert fired
|
||||
}
|
||||
}
|
||||
|
||||
$status_row = get_db_row ("tagente_estado", "id_agente_modulo", $id_agentmodule);
|
||||
|
|
|
@ -1549,9 +1549,9 @@ function get_agent_module_info ($id_agent, $filter = false) {
|
|||
foreach ($modules as $key => $module) {
|
||||
$return["modules"]++;
|
||||
|
||||
$module_status = get_agentmodule_status($key);
|
||||
$module_status = get_agentmodule_status($key, true);
|
||||
|
||||
switch($module_status){
|
||||
switch ($module_status) {
|
||||
case 0:
|
||||
$return["monitor_normal"]++;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue