2012-11-28 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* include/functions_groups.php
	 include/functions_reporting.php: Added functionality for tactical
	 view of metaconsole.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7198 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2012-11-28 17:29:25 +00:00
parent 1fd479f66e
commit ae78f30fff
3 changed files with 51 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2012-11-28 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_groups.php
include/functions_reporting.php: Added functionality for tactical
view of metaconsole.
2012-11-28 Dario Rodriguez <dario.rodriguez@artica.es>
* godmode/netflow/nf_edit.php,

View File

@ -850,6 +850,25 @@ function groups_create_group($group_name, $rest_values){
return $result;
}
// Get agents NOT INIT
function groups_agent_not_init ($group_array) {
// If there are not groups to query, we jump to nextone
if (empty ($group_array)) {
return 0;
} else if (!is_array ($group_array)){
$group_array = array($group_array);
}
$group_clause = implode (",", $group_array);
$group_clause = "(" . $group_clause . ")";
return db_get_sql ("SELECT COUNT(*) FROM tagente WHERE disabled=0 AND critical_count=0 AND warning_count=0 AND unknown_count=0 AND notinit_count>0 AND id_grupo IN $group_clause");
}
// Get unknown agents by using the status code in modules.

View File

@ -893,6 +893,11 @@ function reporting_get_group_stats ($id_group = 0) {
$data["server_sanity"] = 100;
$data["total_not_init"] = 0;
$data["monitor_non_init"] = 0;
$data["agent_ok"] = 0;
$data["agent_warning"] = 0;
$data["agent_critical"] = 0;
$data["agent_unknown"] = 0;
$data["agent_not_init"] = 0;
$cur_time = get_system_time ();
@ -951,12 +956,12 @@ function reporting_get_group_stats ($id_group = 0) {
// Store the groups where we are quering
$covered_groups = array();
$group_array = array();
foreach ($id_group as $group){
$children = groups_get_childrens($group);
//Show empty groups only if they have children with agents
$group_array = array();
//$group_array = array();
foreach($children as $sub) {
// If the group is quering previously, we ingore it
@ -979,6 +984,9 @@ function reporting_get_group_stats ($id_group = 0) {
if (empty($group_array)) {
continue;
}
}
if (!empty($group_array)) {
// Get unknown agents by using the status code in modules.
@ -1021,6 +1029,21 @@ function reporting_get_group_stats ($id_group = 0) {
$data["total_not_init"] += $data["monitor_not_init"];
// Get Agents OK
$data["agent_ok"] += groups_agent_ok($group_array);
// Get Agents Warning
$data["agent_warning"] += groups_agent_warning($group_array);
// Get Agents Critical
$data["agent_critical"] += groups_agent_critical($group_array);
// Get Agents Unknown
$data["agent_unknown"] += groups_agent_unknown($group_array);
// Get Agents Not init
$data["agent_not_init"] += groups_agent_not_init($group_array);
// Get total count of monitors for this group, except disabled.
$data["monitor_checks"] = $data["monitor_not_init"] + $data["monitor_unknown"] + $data["monitor_warning"] + $data["monitor_critical"] + $data["monitor_ok"];