2012-04-12 18:49:33 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation; version 2
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
define('ALL', -1);
|
|
|
|
define('NORMAL', 0);
|
|
|
|
define('WARNING', 2);
|
|
|
|
define('CRITICAL', 1);
|
|
|
|
define('UNKNOWN', 3);
|
|
|
|
|
|
|
|
global $config;
|
|
|
|
|
2012-11-26 17:44:41 +01:00
|
|
|
require_once ($config['homedir'] . '/include/functions_treeview.php');
|
|
|
|
|
|
|
|
if (defined ('METACONSOLE')) {
|
|
|
|
// For each server defined:
|
|
|
|
$servers = db_get_all_rows_sql ("SELECT * FROM tmetaconsole_setup WHERE disabled = 0");
|
|
|
|
if ($servers === false) {
|
|
|
|
$servers = array();
|
|
|
|
}
|
|
|
|
}
|
2012-08-22 16:09:05 +02:00
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
if (is_ajax ())
|
|
|
|
{
|
2012-11-26 17:44:41 +01:00
|
|
|
require_once ($config['homedir'] . '/include/functions_reporting.php');
|
|
|
|
require_once ($config['homedir'] . '/include/functions_users.php');
|
|
|
|
require_once ($config['homedir'] . '/include/functions_servers.php');
|
2012-08-22 16:09:05 +02:00
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
global $config;
|
|
|
|
|
2012-04-16 12:18:41 +02:00
|
|
|
$enterpriseEnable = false;
|
|
|
|
if (enterprise_include_once('include/functions_policies.php') !== ENTERPRISE_NOT_HOOK) {
|
|
|
|
$enterpriseEnable = true;
|
|
|
|
require_once ('enterprise/include/functions_policies.php');
|
2012-12-06 13:52:01 +01:00
|
|
|
require_once ('enterprise/meta/include/functions_ui_meta.php');
|
2012-04-16 12:18:41 +02:00
|
|
|
}
|
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
$type = get_parameter('type');
|
|
|
|
$id = get_parameter('id');
|
|
|
|
$id_father = get_parameter('id_father');
|
|
|
|
$statusSel = get_parameter('status');
|
|
|
|
$search_free = get_parameter('search_free', '');
|
|
|
|
$printTable = get_parameter('printTable', 0);
|
2013-01-09 10:25:07 +01:00
|
|
|
$printAlertsTable = get_parameter('printAlertsTable', 0);
|
2013-01-29 11:22:59 +01:00
|
|
|
$printModuleTable = get_parameter('printModuleTable', 0);
|
2012-11-27 20:11:55 +01:00
|
|
|
$server_name = get_parameter('server_name', '');
|
2013-01-29 11:22:59 +01:00
|
|
|
$server = array();
|
2012-04-12 18:49:33 +02:00
|
|
|
if ($printTable) {
|
|
|
|
$id_agente = get_parameter('id_agente');
|
2012-11-27 20:11:55 +01:00
|
|
|
if (defined ('METACONSOLE')) {
|
|
|
|
$server = metaconsole_get_connection ($server_name);
|
|
|
|
metaconsole_connect($server);
|
|
|
|
}
|
2012-12-06 13:52:01 +01:00
|
|
|
|
2013-01-29 11:22:59 +01:00
|
|
|
treeview_printTable($id_agente, $server);
|
2012-11-27 20:11:55 +01:00
|
|
|
|
|
|
|
if (defined ('METACONSOLE')) {
|
|
|
|
metaconsole_restore_db();
|
|
|
|
}
|
2012-04-12 18:49:33 +02:00
|
|
|
}
|
2013-01-09 10:25:07 +01:00
|
|
|
if ($printAlertsTable) {
|
|
|
|
$id_module = get_parameter('id_module');
|
|
|
|
|
|
|
|
if (defined ('METACONSOLE')) {
|
|
|
|
$server = metaconsole_get_connection ($server_name);
|
|
|
|
metaconsole_connect($server);
|
|
|
|
}
|
2013-01-29 11:22:59 +01:00
|
|
|
|
|
|
|
treeview_printAlertsTable($id_module, $server);
|
|
|
|
|
|
|
|
if (defined ('METACONSOLE')) {
|
|
|
|
metaconsole_restore_db();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($printModuleTable) {
|
|
|
|
$id_module = get_parameter('id_module');
|
|
|
|
|
|
|
|
if (defined ('METACONSOLE')) {
|
|
|
|
$server = metaconsole_get_connection ($server_name);
|
|
|
|
metaconsole_connect($server);
|
2013-01-09 10:25:07 +01:00
|
|
|
}
|
|
|
|
|
2013-01-29 11:22:59 +01:00
|
|
|
treeview_printModuleTable($id_module, $server);
|
2013-01-09 10:25:07 +01:00
|
|
|
|
2013-01-29 11:22:59 +01:00
|
|
|
|
2013-01-09 10:25:07 +01:00
|
|
|
if (defined ('METACONSOLE')) {
|
|
|
|
metaconsole_restore_db();
|
|
|
|
}
|
|
|
|
}
|
2012-11-29 16:14:08 +01:00
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
/*
|
|
|
|
* It's a binary for branch (0 show - 1 hide)
|
|
|
|
* and there are 2 position
|
|
|
|
* 0 0 - show 2 branch
|
|
|
|
* 0 1 - hide the 2º branch
|
|
|
|
* 1 0 - hide the 1º branch
|
|
|
|
* 1 1 - hide 2 branch
|
2012-08-22 16:09:05 +02:00
|
|
|
*/
|
2012-04-12 18:49:33 +02:00
|
|
|
$lessBranchs = get_parameter('less_branchs');
|
|
|
|
switch ($type) {
|
|
|
|
case 'group':
|
|
|
|
case 'os':
|
|
|
|
case 'module_group':
|
|
|
|
case 'policies':
|
|
|
|
case 'module':
|
2012-11-26 17:44:41 +01:00
|
|
|
case 'tag':
|
2012-04-12 18:49:33 +02:00
|
|
|
|
|
|
|
$countRows = 0;
|
2012-11-26 17:44:41 +01:00
|
|
|
if (! defined ('METACONSOLE')) {
|
|
|
|
$avariableGroups = users_get_groups();
|
|
|
|
$avariableGroupsIds = array_keys($avariableGroups);
|
|
|
|
$sql = treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel, $search_free);
|
|
|
|
if ($sql === false) {
|
|
|
|
$rows = array ();
|
2013-03-05 11:34:29 +01:00
|
|
|
}
|
|
|
|
else {
|
2012-11-26 17:44:41 +01:00
|
|
|
$rows = db_get_all_rows_sql($sql);
|
2012-07-18 16:31:58 +02:00
|
|
|
}
|
2013-03-05 11:34:29 +01:00
|
|
|
}
|
|
|
|
else {
|
2012-11-26 17:44:41 +01:00
|
|
|
$rows = array ();
|
|
|
|
foreach ($servers as $server) {
|
|
|
|
if (metaconsole_connect($server) != NOERR) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$avariableGroups = users_get_groups();
|
|
|
|
$avariableGroupsIds = array_keys($avariableGroups);
|
|
|
|
$sql = treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel, $search_free);
|
|
|
|
if ($sql === false) {
|
|
|
|
$server_rows = array ();
|
2013-03-05 11:34:29 +01:00
|
|
|
}
|
|
|
|
else {
|
2012-11-26 17:44:41 +01:00
|
|
|
$server_rows = db_get_all_rows_sql($sql);
|
|
|
|
if ($server_rows === false) {
|
|
|
|
$server_rows = array ();
|
2012-07-16 15:48:59 +02:00
|
|
|
}
|
2012-11-26 17:44:41 +01:00
|
|
|
}
|
2012-11-27 20:11:55 +01:00
|
|
|
// Add the server name
|
|
|
|
foreach ($server_rows as $key => $row) {
|
|
|
|
$server_rows[$key]['server_name'] = $server['server_name'];
|
|
|
|
}
|
2012-11-26 17:44:41 +01:00
|
|
|
$rows = array_merge($rows, $server_rows);
|
2012-04-12 18:49:33 +02:00
|
|
|
}
|
2012-11-26 17:44:41 +01:00
|
|
|
metaconsole_restore_db();
|
2012-04-12 18:49:33 +02:00
|
|
|
}
|
2012-11-20 Ramon Novoa <rnovoa@artica.es>
* include/functions_groups.php,
include/functions_agents.php,
include/functions_modules.php,
include/functions_treeview.php,
include/functions_os.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
install.php,
pandoradb.oracle.sql,
operation/tree.php,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Improved tree
view performance.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7170 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-11-20 17:14:45 +01:00
|
|
|
$countRows = count ($rows);
|
2012-12-06 13:52:01 +01:00
|
|
|
|
2012-08-22 16:09:05 +02:00
|
|
|
//Empty Branch
|
2012-04-12 18:49:33 +02:00
|
|
|
if ($countRows === 0) {
|
|
|
|
echo "<ul style='margin: 0; padding: 0;'>\n";
|
|
|
|
echo "<li style='margin: 0; padding: 0;'>";
|
|
|
|
if ($lessBranchs == 1)
|
2012-04-16 19:26:01 +02:00
|
|
|
echo html_print_image ("operation/tree/no_branch.png", true, array ("style" => 'vertical-align: middle;'));
|
2012-04-12 18:49:33 +02:00
|
|
|
else
|
2012-04-16 19:26:01 +02:00
|
|
|
echo html_print_image ("operation/tree/branch.png", true, array ("style" => 'vertical-align: middle;'));
|
2012-04-12 18:49:33 +02:00
|
|
|
echo "<i>" . __("Empty") . "</i>";
|
|
|
|
echo "</li>";
|
|
|
|
echo "</ul>";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-08-22 16:09:05 +02:00
|
|
|
//Branch with items
|
2012-04-12 18:49:33 +02:00
|
|
|
$count = 0;
|
|
|
|
echo "<ul style='margin: 0; padding: 0;'>\n";
|
2012-06-12 13:02:36 +02:00
|
|
|
|
2012-11-20 Ramon Novoa <rnovoa@artica.es>
* include/functions_groups.php,
include/functions_agents.php,
include/functions_modules.php,
include/functions_treeview.php,
include/functions_os.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
install.php,
pandoradb.oracle.sql,
operation/tree.php,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Improved tree
view performance.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7170 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-11-20 17:14:45 +01:00
|
|
|
foreach ($rows as $row) {
|
2012-04-12 18:49:33 +02:00
|
|
|
$count++;
|
2012-12-06 13:52:01 +01:00
|
|
|
|
2012-11-20 Ramon Novoa <rnovoa@artica.es>
* include/functions_groups.php,
include/functions_agents.php,
include/functions_modules.php,
include/functions_treeview.php,
include/functions_os.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
install.php,
pandoradb.oracle.sql,
operation/tree.php,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Improved tree
view performance.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7170 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-11-20 17:14:45 +01:00
|
|
|
$agent_info["monitor_alertsfired"] = $row["fired_count"];
|
|
|
|
$agent_info["monitor_critical"] = $row["critical_count"];
|
|
|
|
$agent_info["monitor_warning"] = $row["warning_count"];
|
|
|
|
$agent_info["monitor_unknown"] = $row["unknown_count"];
|
|
|
|
$agent_info["monitor_normal"] = $row["normal_count"];
|
2013-05-28 17:18:41 +02:00
|
|
|
$agent_info["monitor_notinit"] = $row["notinit_count"];
|
2012-11-20 Ramon Novoa <rnovoa@artica.es>
* include/functions_groups.php,
include/functions_agents.php,
include/functions_modules.php,
include/functions_treeview.php,
include/functions_os.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
install.php,
pandoradb.oracle.sql,
operation/tree.php,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Improved tree
view performance.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7170 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-11-20 17:14:45 +01:00
|
|
|
$agent_info["modules"] = $row["total_count"];
|
|
|
|
|
|
|
|
$agent_info["alert_img"] = agents_tree_view_alert_img ($agent_info["monitor_alertsfired"]);
|
2013-05-28 17:18:41 +02:00
|
|
|
$agent_info["status_img"] = agents_tree_view_status_img ($agent_info["monitor_critical"], $agent_info["monitor_warning"], $agent_info["monitor_unknown"].
|
|
|
|
$agent_info["modules"], $agent_info["monitor_notinit"]);
|
2012-07-18 16:31:58 +02:00
|
|
|
|
2012-07-16 19:02:54 +02:00
|
|
|
// Filter by status (only in policy view)
|
|
|
|
if ($type == 'policies') {
|
|
|
|
|
|
|
|
if ($statusSel == NORMAL) {
|
|
|
|
if (strpos($agent_info["status_img"], 'ok') === false)
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
else if ($statusSel == WARNING) {
|
|
|
|
if (strpos($agent_info["status_img"], 'warning') === false)
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
else if ($statusSel == CRITICAL) {
|
|
|
|
if (strpos($agent_info["status_img"], 'critical') === false)
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
else if ($statusSel == UNKNOWN) {
|
|
|
|
if (strpos($agent_info["status_img"], 'down') === false)
|
|
|
|
continue;
|
2012-07-18 16:31:58 +02:00
|
|
|
}
|
2012-07-16 19:02:54 +02:00
|
|
|
}
|
2012-07-18 16:31:58 +02:00
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
$less = $lessBranchs;
|
|
|
|
if ($count != $countRows)
|
2012-04-16 19:26:01 +02:00
|
|
|
$img = html_print_image ("operation/tree/closed.png", true, array ("style" => 'vertical-align: middle;', "id" => "tree_image" . $id . "_agent_" . $type . "_" . $row["id_agente"], "pos_tree" => "2"));
|
2012-04-12 18:49:33 +02:00
|
|
|
else {
|
|
|
|
$less = $less + 2; // $less = $less or 0b10
|
2012-12-03 12:04:34 +01:00
|
|
|
$img = html_print_image ("operation/tree/last_closed.png", true, array ("style" => 'vertical-align: middle;', "id" => "tree_image" . $id . "_agent_" . $type . "_" . $row["id_agente"], "pos_tree" => "3"));
|
2012-04-12 18:49:33 +02:00
|
|
|
}
|
|
|
|
echo "<li style='margin: 0; padding: 0;'>";
|
|
|
|
echo "<a onfocus='JavaScript: this.blur()'
|
2012-11-27 20:11:55 +01:00
|
|
|
href='javascript: loadSubTree(\"agent_" . $type . "\"," . $row["id_agente"] . ", " . $less . ", \"" . $id . "\", \"" . $row["server_name"] . "\")'>";
|
2012-04-12 18:49:33 +02:00
|
|
|
|
|
|
|
if ($lessBranchs == 1)
|
2012-04-16 19:26:01 +02:00
|
|
|
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
2012-04-12 18:49:33 +02:00
|
|
|
else
|
2012-09-18 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.editor.js,
godmode/alerts/alert_list.builder.php,
godmode/alerts/alert_list.list.php,
godmode/gis_maps/configure_gis_map.php,
include/functions_visual_map_editor.php, include/functions_ui.php,
operation/tree.php, operation/agentes/exportdata.excel.php,
operation/agentes/exportdata.php, operation/agentes/ver_agente.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
operation/gis_maps/ajax.php, operation/events/events_validate.php,
operation/messages/message_edit.php,
operation/messages/message_list.php,
operation/reporting/reporting_viewer.php,
operation/netflow/nf_live_view.php,
operation/incidents/incident.php, operation/search_modules.php:
started to use the new function "ui_print_agent_autocomplete_input"
to make more easy (and standar) the autocomplete agent input.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6983 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-18 13:28:09 +02:00
|
|
|
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
2012-07-18 16:31:58 +02:00
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
echo $img;
|
|
|
|
echo "</a>";
|
|
|
|
echo " ";
|
|
|
|
echo str_replace('.png' ,'_ball.png',
|
|
|
|
str_replace('img', 'img style="vertical-align: middle;"', $agent_info["status_img"])
|
|
|
|
);
|
|
|
|
echo " ";
|
|
|
|
echo str_replace('.png' ,'_ball.png',
|
|
|
|
str_replace('img', 'img style="vertical-align: middle;"', $agent_info["alert_img"])
|
|
|
|
);
|
|
|
|
echo "<a onfocus='JavaScript: this.blur()'
|
2012-11-27 20:11:55 +01:00
|
|
|
href='javascript: loadTable(\"agent_" . $type . "\"," . $row["id_agente"] . ", " . $less . ", \"" . $id . "\", \"" . $row['server_name'] . "\")'>";
|
2012-04-12 18:49:33 +02:00
|
|
|
echo " ";
|
2012-07-18 16:31:58 +02:00
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
echo $row["nombre"];
|
2012-07-18 16:31:58 +02:00
|
|
|
|
2013-03-04 13:51:22 +01:00
|
|
|
echo " (" . reporting_tiny_stats($row, true) . ")";
|
2012-12-06 13:52:01 +01:00
|
|
|
|
2012-08-22 16:09:05 +02:00
|
|
|
if ($row['quiet']) {
|
|
|
|
echo " ";
|
|
|
|
html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
|
|
|
|
}
|
2012-04-12 18:49:33 +02:00
|
|
|
echo "</a>";
|
|
|
|
echo "<div hiddenDiv='1' loadDiv='0' style='margin: 0px; padding: 0px;' class='tree_view' id='tree_div" . $id . "_agent_" . $type . "_" . $row["id_agente"] . "'></div>";
|
|
|
|
echo "</li>";
|
2012-07-18 16:31:58 +02:00
|
|
|
}
|
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
echo "</ul>\n";
|
|
|
|
break;
|
2012-08-22 16:09:05 +02:00
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
//also aknolegment as second subtree/branch
|
|
|
|
case 'agent_group':
|
2012-06-08 14:11:58 +02:00
|
|
|
case 'agent_module_group':
|
2012-04-12 18:49:33 +02:00
|
|
|
case 'agent_os':
|
|
|
|
case 'agent_policies':
|
|
|
|
case 'agent_module':
|
2012-11-26 17:44:41 +01:00
|
|
|
case 'agent_tag':
|
2012-04-12 18:49:33 +02:00
|
|
|
$fatherType = str_replace('agent_', '', $type);
|
2012-12-06 13:52:01 +01:00
|
|
|
|
2012-11-27 20:11:55 +01:00
|
|
|
if (defined ('METACONSOLE')) {
|
|
|
|
$server = metaconsole_get_connection ($server_name);
|
|
|
|
if (metaconsole_connect($server) != NOERR) {
|
|
|
|
continue;
|
2012-11-26 17:44:41 +01:00
|
|
|
}
|
2012-04-12 18:49:33 +02:00
|
|
|
}
|
2012-11-27 20:11:55 +01:00
|
|
|
|
|
|
|
$sql = treeview_getSecondBranchSQL ($fatherType, $id, $id_father);
|
|
|
|
$rows = db_get_all_rows_sql($sql);
|
2013-03-07 13:38:11 +01:00
|
|
|
if (empty($rows)) {
|
|
|
|
$rows = array();
|
|
|
|
}
|
2012-11-20 Ramon Novoa <rnovoa@artica.es>
* include/functions_groups.php,
include/functions_agents.php,
include/functions_modules.php,
include/functions_treeview.php,
include/functions_os.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
install.php,
pandoradb.oracle.sql,
operation/tree.php,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Improved tree
view performance.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7170 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-11-20 17:14:45 +01:00
|
|
|
$countRows = count ($rows);
|
2012-12-06 13:52:01 +01:00
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
if ($countRows === 0) {
|
|
|
|
echo "<ul style='margin: 0; padding: 0;'>\n";
|
|
|
|
echo "<li style='margin: 0; padding: 0;'>";
|
|
|
|
switch ($lessBranchs) {
|
|
|
|
case 0:
|
2012-09-18 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.editor.js,
godmode/alerts/alert_list.builder.php,
godmode/alerts/alert_list.list.php,
godmode/gis_maps/configure_gis_map.php,
include/functions_visual_map_editor.php, include/functions_ui.php,
operation/tree.php, operation/agentes/exportdata.excel.php,
operation/agentes/exportdata.php, operation/agentes/ver_agente.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
operation/gis_maps/ajax.php, operation/events/events_validate.php,
operation/messages/message_edit.php,
operation/messages/message_list.php,
operation/reporting/reporting_viewer.php,
operation/netflow/nf_live_view.php,
operation/incidents/incident.php, operation/search_modules.php:
started to use the new function "ui_print_agent_autocomplete_input"
to make more easy (and standar) the autocomplete agent input.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6983 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-18 13:28:09 +02:00
|
|
|
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
|
|
|
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
2012-04-12 18:49:33 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
2012-09-18 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.editor.js,
godmode/alerts/alert_list.builder.php,
godmode/alerts/alert_list.list.php,
godmode/gis_maps/configure_gis_map.php,
include/functions_visual_map_editor.php, include/functions_ui.php,
operation/tree.php, operation/agentes/exportdata.excel.php,
operation/agentes/exportdata.php, operation/agentes/ver_agente.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
operation/gis_maps/ajax.php, operation/events/events_validate.php,
operation/messages/message_edit.php,
operation/messages/message_list.php,
operation/reporting/reporting_viewer.php,
operation/netflow/nf_live_view.php,
operation/incidents/incident.php, operation/search_modules.php:
started to use the new function "ui_print_agent_autocomplete_input"
to make more easy (and standar) the autocomplete agent input.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6983 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-18 13:28:09 +02:00
|
|
|
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
|
|
|
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
2012-04-12 18:49:33 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-09-18 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.editor.js,
godmode/alerts/alert_list.builder.php,
godmode/alerts/alert_list.list.php,
godmode/gis_maps/configure_gis_map.php,
include/functions_visual_map_editor.php, include/functions_ui.php,
operation/tree.php, operation/agentes/exportdata.excel.php,
operation/agentes/exportdata.php, operation/agentes/ver_agente.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
operation/gis_maps/ajax.php, operation/events/events_validate.php,
operation/messages/message_edit.php,
operation/messages/message_list.php,
operation/reporting/reporting_viewer.php,
operation/netflow/nf_live_view.php,
operation/incidents/incident.php, operation/search_modules.php:
started to use the new function "ui_print_agent_autocomplete_input"
to make more easy (and standar) the autocomplete agent input.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6983 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-18 13:28:09 +02:00
|
|
|
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
|
|
|
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
2012-04-12 18:49:33 +02:00
|
|
|
break;
|
|
|
|
case 3:
|
2012-09-18 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.editor.js,
godmode/alerts/alert_list.builder.php,
godmode/alerts/alert_list.list.php,
godmode/gis_maps/configure_gis_map.php,
include/functions_visual_map_editor.php, include/functions_ui.php,
operation/tree.php, operation/agentes/exportdata.excel.php,
operation/agentes/exportdata.php, operation/agentes/ver_agente.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
operation/gis_maps/ajax.php, operation/events/events_validate.php,
operation/messages/message_edit.php,
operation/messages/message_list.php,
operation/reporting/reporting_viewer.php,
operation/netflow/nf_live_view.php,
operation/incidents/incident.php, operation/search_modules.php:
started to use the new function "ui_print_agent_autocomplete_input"
to make more easy (and standar) the autocomplete agent input.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6983 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-18 13:28:09 +02:00
|
|
|
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
|
|
|
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
2012-04-12 18:49:33 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
echo "<i>" . __("Empty") . "</i>";
|
|
|
|
echo "</li>";
|
|
|
|
echo "</ul>";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
$count = 0;
|
|
|
|
echo "<ul style='margin: 0; padding: 0;'>\n";
|
2012-11-20 Ramon Novoa <rnovoa@artica.es>
* include/functions_groups.php,
include/functions_agents.php,
include/functions_modules.php,
include/functions_treeview.php,
include/functions_os.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
install.php,
pandoradb.oracle.sql,
operation/tree.php,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Improved tree
view performance.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7170 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-11-20 17:14:45 +01:00
|
|
|
foreach ($rows as $row) {
|
2012-04-12 18:49:33 +02:00
|
|
|
$count++;
|
|
|
|
echo "<li style='margin: 0; padding: 0;'><span style='min-width: 300px; display: inline-block;'>";
|
2012-07-18 16:31:58 +02:00
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
switch ($lessBranchs) {
|
|
|
|
case 0:
|
2012-09-21 13:24:16 +02:00
|
|
|
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
|
|
|
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
2012-04-12 18:49:33 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
2012-09-21 13:24:16 +02:00
|
|
|
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
|
|
|
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
2012-04-12 18:49:33 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-09-21 13:24:16 +02:00
|
|
|
html_print_image ("operation/tree/branch.png", false, array ("style" => 'vertical-align: middle;'));
|
|
|
|
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
2012-04-12 18:49:33 +02:00
|
|
|
break;
|
|
|
|
case 3:
|
2012-09-21 13:24:16 +02:00
|
|
|
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
|
|
|
html_print_image ("operation/tree/no_branch.png", false, array ("style" => 'vertical-align: middle;'));
|
2012-04-12 18:49:33 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($countRows != $count)
|
2012-04-16 19:26:01 +02:00
|
|
|
html_print_image ("operation/tree/leaf.png", false, array ("style" => 'vertical-align: middle;', "id" => "tree_image_os_" . $row["id_agente"], "pos_tree" => "1" ));
|
2012-04-12 18:49:33 +02:00
|
|
|
else
|
2012-04-16 19:26:01 +02:00
|
|
|
html_print_image ("operation/tree/last_leaf.png", false, array ("style" => 'vertical-align: middle;', "id" => "tree_image_os_" . $row["id_agente"], "pos_tree" => "2" ));
|
2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* install.php, operation/reporting/reporting_xml.php,
operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
operation/tree.php, operation/agentes/gis_view.php,
operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php,
operation/agentes/datos_agente.php,
operation/agentes/alerts_status.php, operation/menu.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/servers/manage_recontask.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_special_days.php, godmode/setup/links.php,
godmode/setup/os.php, godmode/users/configure_profile.php,
godmode/events/events.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/graph_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
include/functions_menu.php, include/functions_visual_map.php,
include/functions_db.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
// This line checks for (non-initialized) asyncronous modules
|
2013-04-25 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_alerts.php, extensions/snmp_explorer.php,
extensions/insert_data.php, extensions/net_tools.php,
extensions/resource_exportation.php, extensions/system_info.php,
extensions/pandora_logs.php, extensions/agents_modules.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/servers/manage_recontask_form.php,
godmode/setup/gis_step_2.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_add_alerts.php,
godmode/massive/massive_delete_agents.php,
godmode/massive/massive_delete_action_alerts.php,
operation/users/user_edit.php, operation/events/events_list.php,
operation/integria_incidents/incident.list.php,
operation/integria_incidents/incident.workunits.php,
operation/tree.php, general/shortcut_bar.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8054 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-04-25 11:08:54 +02:00
|
|
|
if ($row["estado"] == 0 AND $row["utimestamp"] == 0
|
|
|
|
AND ($row["id_tipo_modulo"] >= 21
|
|
|
|
AND $row["id_tipo_modulo"] <= 23)) {
|
2012-04-12 18:49:33 +02:00
|
|
|
$status = STATUS_MODULE_NO_DATA;
|
2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* install.php, operation/reporting/reporting_xml.php,
operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
operation/tree.php, operation/agentes/gis_view.php,
operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php,
operation/agentes/datos_agente.php,
operation/agentes/alerts_status.php, operation/menu.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/servers/manage_recontask.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_special_days.php, godmode/setup/links.php,
godmode/setup/os.php, godmode/users/configure_profile.php,
godmode/events/events.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/graph_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
include/functions_menu.php, include/functions_visual_map.php,
include/functions_db.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
|
|
|
$title = __('UNKNOWN');
|
|
|
|
} // Else checks module status
|
2012-04-12 18:49:33 +02:00
|
|
|
elseif ($row["estado"] == 1) {
|
|
|
|
$status = STATUS_MODULE_CRITICAL;
|
|
|
|
$title = __('CRITICAL');
|
|
|
|
}
|
|
|
|
elseif ($row["estado"] == 2) {
|
|
|
|
$status = STATUS_MODULE_WARNING;
|
|
|
|
$title = __('WARNING');
|
|
|
|
}
|
|
|
|
elseif ($row["estado"] == 3) {
|
|
|
|
$status = STATUS_MODULE_NO_DATA;
|
|
|
|
$title = __('UNKNOWN');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$status = STATUS_MODULE_OK;
|
|
|
|
$title = __('NORMAL');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_numeric($row["datos"])) {
|
|
|
|
$title .= " : " . format_for_graph($row["datos"]);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$title .= " : " . substr(io_safe_output($row["datos"]),0,42);
|
|
|
|
}
|
2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* install.php, operation/reporting/reporting_xml.php,
operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
operation/tree.php, operation/agentes/gis_view.php,
operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php,
operation/agentes/datos_agente.php,
operation/agentes/alerts_status.php, operation/menu.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/servers/manage_recontask.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_special_days.php, godmode/setup/links.php,
godmode/setup/os.php, godmode/users/configure_profile.php,
godmode/events/events.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/graph_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
include/functions_menu.php, include/functions_visual_map.php,
include/functions_db.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
echo str_replace('.png' ,'_ball.png',
|
|
|
|
str_replace('img', 'img style="vertical-align: middle;"', ui_print_status_image($status, $title,true))
|
|
|
|
);
|
2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* install.php, operation/reporting/reporting_xml.php,
operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
operation/tree.php, operation/agentes/gis_view.php,
operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php,
operation/agentes/datos_agente.php,
operation/agentes/alerts_status.php, operation/menu.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/servers/manage_recontask.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_special_days.php, godmode/setup/links.php,
godmode/setup/os.php, godmode/users/configure_profile.php,
godmode/events/events.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/graph_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
include/functions_menu.php, include/functions_visual_map.php,
include/functions_db.php: cleaned source code style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
|
|
|
echo " ";
|
2012-04-12 18:49:33 +02:00
|
|
|
echo str_replace('img', 'img style="vertical-align: middle;"', servers_show_type ($row['id_modulo']));
|
|
|
|
echo " ";
|
|
|
|
$graph_type = return_graphtype ($row["id_tipo_modulo"]);
|
|
|
|
$win_handle=dechex(crc32($row["id_agente_modulo"] . $row["nombre"]));
|
2012-11-27 20:11:55 +01:00
|
|
|
|
|
|
|
if (defined ('METACONSOLE')) {
|
|
|
|
$console_url = $server['server_url'] . '/';
|
2012-12-06 13:52:01 +01:00
|
|
|
}
|
|
|
|
else {
|
2012-11-27 20:11:55 +01:00
|
|
|
$console_url = '';
|
|
|
|
}
|
2012-12-06 13:52:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
//Icon and link to the Module graph.
|
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
$url_module_graph = ui_meta_get_url_console_child(
|
2013-01-23 15:20:54 +01:00
|
|
|
$server, null, null, null, null,
|
2012-12-06 13:52:01 +01:00
|
|
|
"operation/agentes/stat_win.php?" .
|
|
|
|
"type=$graph_type&" .
|
|
|
|
"period=86400&" .
|
|
|
|
"id=" . $row["id_agente_modulo"] . "&" .
|
|
|
|
"label=" . base64_encode($row["nombre"]) . "&" .
|
|
|
|
"refresh=600");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$url_module_graph = $console_url .
|
|
|
|
"operation/agentes/stat_win.php?" .
|
|
|
|
"type=$graph_type&" .
|
|
|
|
"period=86400&" .
|
|
|
|
"id=" . $row["id_agente_modulo"] . "&" .
|
|
|
|
"label=" . base64_encode($row["nombre"]) . "&" .
|
|
|
|
"refresh=600";
|
|
|
|
}
|
|
|
|
$link ="winopeng('" . $url_module_graph . "','day_".$win_handle."')";
|
|
|
|
echo '<a href="javascript: '.$link.'">' . html_print_image ("images/chart_curve.png", true, array ("style" => 'vertical-align: middle;', "border" => "0" )) . '</a>';
|
|
|
|
|
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
echo " ";
|
2012-12-06 13:52:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
//Icon and link to the Module data.
|
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
|
|
|
|
$url_module_data = ui_meta_get_url_console_child(
|
2013-01-23 15:20:54 +01:00
|
|
|
$server,
|
2012-12-06 13:52:01 +01:00
|
|
|
"estado", "operation/agentes/ver_agente",
|
|
|
|
"id_agente=" . $row['id_agente'] . "&" .
|
|
|
|
"tab=data_view&" .
|
|
|
|
"period=86400&" .
|
|
|
|
"id=" . $row["id_agente_modulo"]);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$url_module_data = $console_url .
|
|
|
|
"index.php?" .
|
|
|
|
"sec=estado&" .
|
|
|
|
"sec2=operation/agentes/ver_agente&" .
|
|
|
|
"id_agente=" . $row['id_agente'] . "&" .
|
|
|
|
"tab=data_view&" .
|
|
|
|
"period=86400&" .
|
|
|
|
"id=" . $row["id_agente_modulo"];
|
|
|
|
}
|
2013-03-15 10:30:46 +01:00
|
|
|
echo "<a href='javascript: show_module_detail_dialog(" . $row["id_agente_modulo"] . ", ". $row['id_agente'].", \"" . $server_name . "\", 0, 86400)'>". html_print_image ("images/binary.png", true, array ("style" => 'vertical-align: middle;', "border" => "0" )) . "</a>";
|
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
echo " ";
|
2012-12-06 13:52:01 +01:00
|
|
|
|
2013-01-09 10:25:07 +01:00
|
|
|
$nmodule_alerts = db_get_value_sql(sprintf("SELECT count(*) FROM talert_template_modules WHERE id_agent_module = %s", $row["id_agente_modulo"]));
|
|
|
|
|
|
|
|
if($nmodule_alerts > 0) {
|
2013-01-29 11:22:59 +01:00
|
|
|
echo "<a onfocus='JavaScript: this.blur()' href='javascript: loadAlertsTable(" . $row["id_agente_modulo"] . ", \"" . $server_name . "\")'>";
|
|
|
|
echo html_print_image ("images/bell.png", true, array ("style" => 'vertical-align: middle;', "border" => "0", "title" => __('Module alerts') ));
|
|
|
|
echo "</a>";
|
2013-01-09 10:25:07 +01:00
|
|
|
|
|
|
|
echo " ";
|
|
|
|
}
|
|
|
|
|
2013-05-30 17:48:22 +02:00
|
|
|
echo "<a style='vertical-align: middle;' onfocus='JavaScript: this.blur()' href='javascript: loadModuleTable(" . $row["id_agente_modulo"] . ", \"" . $server_name . "\")'>";
|
2012-04-12 18:49:33 +02:00
|
|
|
echo io_safe_output($row['nombre']);
|
2013-01-29 11:22:59 +01:00
|
|
|
echo "</a>";
|
2012-08-22 16:09:05 +02:00
|
|
|
if ($row['quiet']) {
|
|
|
|
echo " ";
|
|
|
|
html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
|
|
|
|
}
|
2012-04-12 18:49:33 +02:00
|
|
|
|
2013-05-30 17:48:22 +02:00
|
|
|
/*
|
2012-04-12 18:49:33 +02:00
|
|
|
if (is_numeric($row["datos"]))
|
|
|
|
$data = format_numeric($row["datos"]);
|
|
|
|
else
|
|
|
|
$data = "<span title='".$row['datos']."' style='white-space: nowrap;'>".substr(io_safe_output($row["datos"]),0,12)."</span>";
|
|
|
|
|
|
|
|
echo "</span><span style='margin-left: 20px;'>";
|
2013-05-28 17:18:41 +02:00
|
|
|
if ($row['utimestamp'] != '') {
|
|
|
|
ui_print_help_tip ($row["timestamp"], '', 'images/clock2.png');
|
|
|
|
echo " ";
|
|
|
|
}
|
2012-04-12 18:49:33 +02:00
|
|
|
echo $data;
|
2012-04-24 18:53:11 +02:00
|
|
|
if ($row['unit'] != '') {
|
|
|
|
echo " ";
|
|
|
|
echo '('.$row['unit'].')';
|
|
|
|
}
|
2013-05-30 17:48:22 +02:00
|
|
|
* */
|
2012-04-12 18:49:33 +02:00
|
|
|
echo "</span></li>";
|
|
|
|
}
|
|
|
|
echo "</ul>\n";
|
2013-01-09 10:25:07 +01:00
|
|
|
if (defined ('METACONSOLE')) {
|
|
|
|
metaconsole_restore_db_force();
|
|
|
|
}
|
2012-04-12 18:49:33 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2012-08-22 16:09:05 +02:00
|
|
|
//End of AJAX code.
|
2012-04-16 09:46:13 +02:00
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
include_once($config['homedir'] . "/include/functions_groups.php");
|
2012-06-07 13:44:08 +02:00
|
|
|
include_once($config['homedir'] . "/include/functions_os.php");
|
2012-06-07 16:29:00 +02:00
|
|
|
include_once($config['homedir'] . "/include/functions_modules.php");
|
2012-04-12 18:49:33 +02:00
|
|
|
include_once($config['homedir'] . "/include/functions_servers.php");
|
|
|
|
include_once($config['homedir'] . "/include/functions_reporting.php");
|
2012-04-16 12:18:41 +02:00
|
|
|
include_once($config['homedir'] . "/include/functions_ui.php");
|
2012-04-12 18:49:33 +02:00
|
|
|
|
2012-04-16 19:26:01 +02:00
|
|
|
global $config;
|
2012-11-28 10:58:42 +01:00
|
|
|
$pure = get_parameter('pure', 0);
|
2012-04-16 19:26:01 +02:00
|
|
|
|
|
|
|
$enterpriseEnable = false;
|
|
|
|
if (enterprise_include_once('include/functions_policies.php') !== ENTERPRISE_NOT_HOOK) {
|
|
|
|
$enterpriseEnable = true;
|
|
|
|
}
|
|
|
|
|
2012-08-22 16:09:05 +02:00
|
|
|
///////// INI MENU AND TABS /////////////
|
2012-04-16 19:26:01 +02:00
|
|
|
$img_style = array ("class" => "top", "width" => 16);
|
|
|
|
$activeTab = get_parameter('sort_by','group');
|
|
|
|
|
|
|
|
$os_tab = array('text' => "<a href='index.php?sec=estado&sec2=operation/tree&refr=0&sort_by=os'>"
|
2013-04-10 09:57:54 +02:00
|
|
|
. html_print_image ("images/operating_system.png", true, array ("title" => __('OS'))) . "</a>", 'active' => $activeTab == "os");
|
2012-04-16 19:26:01 +02:00
|
|
|
|
|
|
|
$group_tab = array('text' => "<a href='index.php?sec=estado&sec2=operation/tree&refr=0&sort_by=group'>"
|
2012-07-18 16:31:58 +02:00
|
|
|
. html_print_image ("images/group.png", true, array ("title" => __('Groups'))) . "</a>", 'active' => $activeTab == "group");
|
2012-04-16 19:26:01 +02:00
|
|
|
|
|
|
|
$module_group_tab = array('text' => "<a href='index.php?sec=estado&sec2=operation/tree&refr=0&sort_by=module_group'>"
|
2013-04-10 09:57:54 +02:00
|
|
|
. html_print_image ("images/module_group.png", true, array ("title" => __('Module groups'))) . "</a>", 'active' => $activeTab == "module_group");
|
2012-04-16 19:26:01 +02:00
|
|
|
|
|
|
|
if ($enterpriseEnable) {
|
|
|
|
$policies_tab = array('text' => "<a href='index.php?sec=estado&sec2=operation/tree&refr=0&sort_by=policies'>"
|
2013-04-10 09:57:54 +02:00
|
|
|
. html_print_image ("images/policies_mc.png", true, array ("title" => __('Policies'))) . "</a>", 'active' => $activeTab == "policies");
|
2012-07-18 16:31:58 +02:00
|
|
|
}
|
|
|
|
else {
|
2012-04-16 19:26:01 +02:00
|
|
|
$policies_tab = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
$module_tab = array('text' => "<a href='index.php?extension_in_menu=estado&sec=estado&sec2=operation/tree&refr=0&sort_by=module'>"
|
2012-07-18 16:31:58 +02:00
|
|
|
. html_print_image ("images/brick.png", true, array ("title" => __('Modules'))) . "</a>", 'active' => $activeTab == "module");
|
2012-04-16 19:26:01 +02:00
|
|
|
|
2013-01-09 10:25:07 +01:00
|
|
|
$tags_tab = array('text' => "<a href='index.php?&sec=monitoring&sec2=operation/tree&refr=0&sort_by=tag&pure=$pure'>"
|
2013-04-10 09:57:54 +02:00
|
|
|
. html_print_image ("images/tag.png", true, array ("title" => __('Tags'))) . "</a>", 'active' => $activeTab == "tag");
|
2013-01-09 10:25:07 +01:00
|
|
|
|
2012-06-20 17:50:15 +02:00
|
|
|
switch ($activeTab) {
|
|
|
|
case 'group':
|
|
|
|
$order = __('groups');
|
|
|
|
break;
|
|
|
|
case 'module_group':
|
|
|
|
$order = __('module groups');
|
|
|
|
break;
|
|
|
|
case 'policies':
|
|
|
|
$order = __('policies');
|
|
|
|
break;
|
|
|
|
case 'module':
|
|
|
|
$order = __('modules');
|
|
|
|
break;
|
|
|
|
case 'os':
|
|
|
|
$order = __('OS');
|
|
|
|
break;
|
2012-11-26 17:44:41 +01:00
|
|
|
case 'tag':
|
|
|
|
$order = __('tags');
|
|
|
|
break;
|
2012-06-20 17:50:15 +02:00
|
|
|
}
|
2012-04-16 19:26:01 +02:00
|
|
|
|
2012-11-26 17:44:41 +01:00
|
|
|
if (! defined ('METACONSOLE')) {
|
2013-01-09 10:25:07 +01:00
|
|
|
$onheader = array('tag' => $tags_tab, 'os' => $os_tab, 'group' => $group_tab, 'module_group' => $module_group_tab, 'policies' => $policies_tab, 'module' => $module_tab);
|
2012-11-26 17:44:41 +01:00
|
|
|
ui_print_page_header (__('Tree view')." - ".__('Sort the agents by ') .$order, "images/extensions.png", false, "", false, $onheader);
|
2013-03-05 11:34:29 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
|
2012-11-26 17:44:41 +01:00
|
|
|
ui_meta_add_breadcrumb(array('link' => 'index.php?sec=monitoring&sec2=operation/tree', 'text' => __('Tree View')));
|
|
|
|
ui_meta_print_page_header($nav_bar);
|
|
|
|
|
|
|
|
$img_style = array ("class" => "top", "width" => 16);
|
|
|
|
$activeTab = get_parameter('tab','group');
|
2012-11-28 10:58:42 +01:00
|
|
|
$group_tab = array('text' => "<a href='index.php?sec=monitoring&sec2=operation/tree&refr=0&tab=group&pure=$pure'>"
|
2013-01-30 14:53:02 +01:00
|
|
|
. html_print_image ("images/group.png", true, array ("title" => __('Groups'))) . "</a>",
|
|
|
|
'active' => $activeTab == "group");
|
2012-11-28 10:58:42 +01:00
|
|
|
$tags_tab = array('text' => "<a href='index.php?&sec=monitoring&sec2=operation/tree&refr=0&tab=tag&pure=$pure'>"
|
2013-04-10 09:57:54 +02:00
|
|
|
. html_print_image ("images/tag.png", true, array ("title" => __('Tags'))) . "</a>", 'active' => $activeTab == "tag");
|
2012-11-26 17:44:41 +01:00
|
|
|
$subsections = array('group' => $group_tab, 'tag' => $tags_tab);
|
|
|
|
switch ($activeTab) {
|
|
|
|
case 'group':
|
|
|
|
$subsection = __('Groups');
|
|
|
|
$tab = 'group';
|
|
|
|
break;
|
|
|
|
case 'tag':
|
|
|
|
$subsection = __('Tags');
|
|
|
|
$tab = 'tag';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
ui_meta_print_header(__("Tree view"), $subsection, $subsections);
|
|
|
|
}
|
2012-04-16 19:26:01 +02:00
|
|
|
|
2013-01-10 17:00:30 +01:00
|
|
|
if(tags_has_user_acl_tags()) {
|
|
|
|
ui_print_tags_warning();
|
|
|
|
}
|
|
|
|
|
2012-04-16 19:26:01 +02:00
|
|
|
echo "<br>";
|
2012-11-28 14:04:11 +01:00
|
|
|
if (! defined ('METACONSOLE')) {
|
|
|
|
echo '<form id="tree_search" method="post" action="index.php?extension_in_menu=estado&sec=estado&sec2=operation/tree&refr=0&sort_by='.$activeTab.'&pure='.$pure.'">';
|
2013-01-30 14:53:02 +01:00
|
|
|
}
|
|
|
|
else {
|
2012-11-28 14:04:11 +01:00
|
|
|
echo '<form id="tree_search" method="post" action="index.php?sec=monitoring&sec2=operation/tree&refr=0&tab='.$activeTab.'&pure='.$pure.'">';
|
|
|
|
}
|
2013-05-20 10:42:02 +02:00
|
|
|
|
|
|
|
enterprise_hook('open_meta_frame');
|
|
|
|
|
2012-07-12 20:10:44 +02:00
|
|
|
echo "<b>" . __('Agent status') . "</b>";
|
2012-04-16 19:26:01 +02:00
|
|
|
|
|
|
|
$search_free = get_parameter('search_free', '');
|
|
|
|
$select_status = get_parameter('status', -1);
|
|
|
|
|
|
|
|
$fields = array ();
|
|
|
|
$fields[ALL] = __('All'); //default
|
|
|
|
$fields[NORMAL] = __('Normal');
|
|
|
|
$fields[WARNING] = __('Warning');
|
|
|
|
$fields[CRITICAL] = __('Critical');
|
|
|
|
$fields[UNKNOWN] = __('Unknown');
|
|
|
|
|
|
|
|
html_print_select ($fields, "status", $select_status);
|
|
|
|
|
|
|
|
echo " ";
|
2012-07-12 20:10:44 +02:00
|
|
|
echo "<b>" . __('Search agent') . "</b>";
|
2012-04-16 19:26:01 +02:00
|
|
|
echo " ";
|
|
|
|
html_print_input_text ("search_free", $search_free, '', 40,30, false);
|
|
|
|
echo " ";
|
|
|
|
html_print_submit_button (__('Show'), "uptbutton", false, 'class="sub search"');
|
|
|
|
echo "</form>";
|
|
|
|
echo "<div class='pepito' id='a'></div>";
|
|
|
|
echo "<div class='pepito' id='b'></div>";
|
|
|
|
echo "<div class='pepito' id='c'></div>";
|
2012-08-22 16:09:05 +02:00
|
|
|
///////// END MENU AND TABS /////////////
|
|
|
|
|
2013-03-15 10:30:46 +01:00
|
|
|
echo "<div id='module_details_window'></div>";
|
|
|
|
ui_require_javascript_file('pandora_modules');
|
2012-04-16 19:26:01 +02:00
|
|
|
|
2012-08-22 16:09:05 +02:00
|
|
|
treeview_printTree($activeTab);
|
2013-05-20 10:42:02 +02:00
|
|
|
|
|
|
|
enterprise_hook('close_meta_frame');
|
|
|
|
|
2012-04-16 19:26:01 +02:00
|
|
|
?>
|
|
|
|
|
|
|
|
<script language="javascript" type="text/javascript">
|
2012-04-12 18:49:33 +02:00
|
|
|
|
2012-06-20 10:28:34 +02:00
|
|
|
var status = $('#status').val();
|
|
|
|
var search_free = $('#text-search_free').val();
|
2012-07-18 16:31:58 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* loadSubTree asincronous load ajax the agents or modules (pass type, id to search and binary structure of branch),
|
|
|
|
* change the [+] or [-] image (with same more or less div id) of tree and anime (for show or hide)
|
|
|
|
* the div with id "div[id_father]_[type]_[div_id]"
|
|
|
|
*
|
|
|
|
* type string use in js and ajax php
|
|
|
|
* div_id int use in js and ajax php
|
|
|
|
* less_branchs int use in ajax php as binary structure 0b00, 0b01, 0b10 and 0b11
|
|
|
|
* id_father int use in js and ajax php, its useful when you have a two subtrees with same agent for diferent each one
|
|
|
|
*/
|
2013-01-30 14:53:02 +01:00
|
|
|
function loadSubTree(type, div_id, less_branchs, id_father, server_name) {
|
2012-07-18 16:31:58 +02:00
|
|
|
hiddenDiv = $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('hiddenDiv');
|
|
|
|
loadDiv = $('#tree_div'+id_father+'_'+type+'_'+div_id).attr('loadDiv');
|
2012-09-21 13:24:16 +02:00
|
|
|
pos = parseInt($('#tree_image'+id_father+'_'+type+'_'+div_id).attr('pos_tree'));
|
2012-07-18 16:31:58 +02:00
|
|
|
|
|
|
|
//If has yet ajax request running
|
|
|
|
if (loadDiv == 2)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (loadDiv == 0) {
|
2012-04-12 18:49:33 +02:00
|
|
|
|
2012-07-18 16:31:58 +02:00
|
|
|
//Put an spinner to simulate loading process
|
|
|
|
$('#tree_div'+id_father+'_'+type+'_'+div_id).html("<img style='padding-top:10px;padding-bottom:10px;padding-left:20px;' src=images/spinner.gif>");
|
|
|
|
$('#tree_div'+id_father+'_'+type+'_'+div_id).show('normal');
|
2012-04-12 18:49:33 +02:00
|
|
|
|
2012-07-18 16:31:58 +02:00
|
|
|
$('#tree_div'+id_father+'_'+type+'_'+div_id).attr('loadDiv', 2);
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
2012-11-26 17:44:41 +01:00
|
|
|
url: <?php echo '"' . ui_get_full_url("ajax.php", false, false, false) . '"'; ?>,
|
2012-07-18 16:31:58 +02:00
|
|
|
data: "page=<?php echo $_GET['sec2']; ?>&ajax_treeview=1&type=" +
|
2012-11-27 20:11:55 +01:00
|
|
|
type + "&id=" + div_id + "&less_branchs=" + less_branchs + "&id_father=" + id_father + "&status=" + status + "&search_free=" + search_free + "&server_name=" + server_name,
|
2013-04-25 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_alerts.php, extensions/snmp_explorer.php,
extensions/insert_data.php, extensions/net_tools.php,
extensions/resource_exportation.php, extensions/system_info.php,
extensions/pandora_logs.php, extensions/agents_modules.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/servers/manage_recontask_form.php,
godmode/setup/gis_step_2.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_add_alerts.php,
godmode/massive/massive_delete_agents.php,
godmode/massive/massive_delete_action_alerts.php,
operation/users/user_edit.php, operation/events/events_list.php,
operation/integria_incidents/incident.list.php,
operation/integria_incidents/incident.workunits.php,
operation/tree.php, general/shortcut_bar.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8054 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-04-25 11:08:54 +02:00
|
|
|
success: function(msg) {
|
2012-07-18 16:31:58 +02:00
|
|
|
if (msg.length != 0) {
|
|
|
|
$('#tree_div'+id_father+'_'+type+'_'+div_id).hide();
|
|
|
|
$('#tree_div'+id_father+'_'+type+'_'+div_id).html(msg);
|
|
|
|
$('#tree_div'+id_father+'_'+type+'_'+div_id).show('normal');
|
|
|
|
|
|
|
|
//change image of tree [+] to [-]
|
2012-11-26 17:44:41 +01:00
|
|
|
<?php if (! defined ('METACONSOLE')) {
|
|
|
|
echo 'var icon_path = \'operation/tree\';';
|
2013-03-05 11:34:29 +01:00
|
|
|
}
|
|
|
|
else {
|
2012-11-26 17:44:41 +01:00
|
|
|
echo 'var icon_path = \'../../operation/tree\';';
|
|
|
|
}
|
|
|
|
?>
|
2012-07-18 16:31:58 +02:00
|
|
|
switch (pos) {
|
|
|
|
case 0:
|
2012-11-26 17:44:41 +01:00
|
|
|
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/first_expanded.png');
|
2012-07-18 16:31:58 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
2012-11-26 17:44:41 +01:00
|
|
|
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/one_expanded.png');
|
2012-07-18 16:31:58 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-11-26 17:44:41 +01:00
|
|
|
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/expanded.png');
|
2012-07-18 16:31:58 +02:00
|
|
|
break;
|
|
|
|
case 3:
|
2012-11-26 17:44:41 +01:00
|
|
|
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/last_expanded.png');
|
2012-07-18 16:31:58 +02:00
|
|
|
break;
|
2012-04-12 18:49:33 +02:00
|
|
|
}
|
2012-07-18 16:31:58 +02:00
|
|
|
$('#tree_div'+id_father+'_'+type+'_'+div_id).attr('hiddendiv',0);
|
|
|
|
$('#tree_div'+id_father+'_'+type+'_'+div_id).attr('loadDiv', 1);
|
2012-04-12 18:49:33 +02:00
|
|
|
}
|
2013-03-04 13:51:22 +01:00
|
|
|
|
|
|
|
// Refresh forced title callback to work with html code created dinamicly
|
|
|
|
forced_title_callback();
|
2012-04-12 18:49:33 +02:00
|
|
|
}
|
2012-07-18 16:31:58 +02:00
|
|
|
});
|
2012-04-12 18:49:33 +02:00
|
|
|
}
|
2012-07-18 16:31:58 +02:00
|
|
|
else {
|
2013-01-30 14:53:02 +01:00
|
|
|
<?php
|
|
|
|
if (! defined ('METACONSOLE')) {
|
2012-11-26 17:44:41 +01:00
|
|
|
echo 'var icon_path = \'operation/tree\';';
|
2013-01-30 14:53:02 +01:00
|
|
|
}
|
|
|
|
else {
|
2012-11-26 17:44:41 +01:00
|
|
|
echo 'var icon_path = \'../../operation/tree\';';
|
|
|
|
}
|
|
|
|
?>
|
2012-07-18 16:31:58 +02:00
|
|
|
if (hiddenDiv == 0) {
|
|
|
|
$('#tree_div'+id_father+'_'+type+'_'+div_id).hide('normal');
|
|
|
|
$('#tree_div'+id_father+'_'+type+'_'+div_id).attr('hiddenDiv',1);
|
|
|
|
|
|
|
|
//change image of tree [-] to [+]
|
|
|
|
switch (pos) {
|
|
|
|
case 0:
|
2012-11-26 17:44:41 +01:00
|
|
|
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/first_closed.png');
|
2012-07-18 16:31:58 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
2012-11-26 17:44:41 +01:00
|
|
|
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/one_closed.png');
|
2012-07-18 16:31:58 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-11-26 17:44:41 +01:00
|
|
|
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/closed.png');
|
2012-07-18 16:31:58 +02:00
|
|
|
break;
|
|
|
|
case 3:
|
2012-11-26 17:44:41 +01:00
|
|
|
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/last_closed.png');
|
2012-07-18 16:31:58 +02:00
|
|
|
break;
|
2012-04-12 18:49:33 +02:00
|
|
|
}
|
2012-07-18 16:31:58 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
//change image of tree [+] to [-]
|
|
|
|
switch (pos) {
|
|
|
|
case 0:
|
2012-11-26 17:44:41 +01:00
|
|
|
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/first_expanded.png');
|
2012-07-18 16:31:58 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
2012-11-26 17:44:41 +01:00
|
|
|
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/one_expanded.png');
|
2012-07-18 16:31:58 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-11-26 17:44:41 +01:00
|
|
|
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/expanded.png');
|
2012-07-18 16:31:58 +02:00
|
|
|
break;
|
|
|
|
case 3:
|
2012-11-26 17:44:41 +01:00
|
|
|
$('#tree_image'+id_father+'_'+type+'_'+div_id).attr('src',icon_path+'/last_expanded.png');
|
2012-07-18 16:31:58 +02:00
|
|
|
break;
|
2012-04-12 18:49:33 +02:00
|
|
|
}
|
2012-07-18 16:31:58 +02:00
|
|
|
|
|
|
|
$('#tree_div'+id_father+'_'+type+'_'+div_id).show('normal');
|
|
|
|
$('#tree_div'+id_father+'_'+type+'_'+div_id).attr('hiddenDiv',0);
|
|
|
|
}
|
2012-04-12 18:49:33 +02:00
|
|
|
}
|
2012-07-18 16:31:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function changeStatus(newStatus) {
|
|
|
|
status = newStatus;
|
2012-04-12 18:49:33 +02:00
|
|
|
|
2012-07-18 16:31:58 +02:00
|
|
|
//reset all subtree
|
|
|
|
$(".tree_view").each(
|
|
|
|
function(i) {
|
|
|
|
$(this).attr('loadDiv', 0);
|
|
|
|
$(this).attr('hiddenDiv',1);
|
|
|
|
$(this).hide();
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
//clean all subtree
|
|
|
|
$(".tree_view").each(
|
|
|
|
function(i) {
|
|
|
|
$(this).html('');
|
|
|
|
}
|
|
|
|
);
|
2012-04-12 18:49:33 +02:00
|
|
|
}
|
2012-07-18 16:31:58 +02:00
|
|
|
|
2012-11-27 20:11:55 +01:00
|
|
|
function loadTable(type, div_id, less_branchs, id_father, server_name) {
|
2012-07-18 16:31:58 +02:00
|
|
|
id_agent = div_id;
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
2012-11-26 17:44:41 +01:00
|
|
|
url: <?php echo '"' . ui_get_full_url("ajax.php", false, false, false) . '"'; ?>,
|
2012-11-27 20:11:55 +01:00
|
|
|
data: "page=<?php echo $_GET['sec2']; ?>&printTable=1&id_agente=" + id_agent + "&server_name=" + server_name,
|
2013-04-25 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_alerts.php, extensions/snmp_explorer.php,
extensions/insert_data.php, extensions/net_tools.php,
extensions/resource_exportation.php, extensions/system_info.php,
extensions/pandora_logs.php, extensions/agents_modules.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/servers/manage_recontask_form.php,
godmode/setup/gis_step_2.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_add_alerts.php,
godmode/massive/massive_delete_agents.php,
godmode/massive/massive_delete_action_alerts.php,
operation/users/user_edit.php, operation/events/events_list.php,
operation/integria_incidents/incident.list.php,
operation/integria_incidents/incident.workunits.php,
operation/tree.php, general/shortcut_bar.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8054 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-04-25 11:08:54 +02:00
|
|
|
success: function(data) {
|
2012-08-22 16:09:05 +02:00
|
|
|
$('#cont').html(data);
|
2013-05-28 17:18:41 +02:00
|
|
|
forced_title_callback();
|
2012-07-18 16:31:58 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2012-11-27 20:11:55 +01:00
|
|
|
loadSubTree(type, div_id, less_branchs, id_father, server_name);
|
2012-07-18 16:31:58 +02:00
|
|
|
}
|
2013-01-09 10:25:07 +01:00
|
|
|
|
|
|
|
function loadAlertsTable(id_module, server_name) {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: <?php echo '"' . ui_get_full_url("ajax.php", false, false, false) . '"'; ?>,
|
|
|
|
data: "page=<?php echo $_GET['sec2']; ?>&printAlertsTable=1&id_module=" + id_module + "&server_name=" + server_name,
|
2013-04-25 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_alerts.php, extensions/snmp_explorer.php,
extensions/insert_data.php, extensions/net_tools.php,
extensions/resource_exportation.php, extensions/system_info.php,
extensions/pandora_logs.php, extensions/agents_modules.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/servers/manage_recontask_form.php,
godmode/setup/gis_step_2.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_add_alerts.php,
godmode/massive/massive_delete_agents.php,
godmode/massive/massive_delete_action_alerts.php,
operation/users/user_edit.php, operation/events/events_list.php,
operation/integria_incidents/incident.list.php,
operation/integria_incidents/incident.workunits.php,
operation/tree.php, general/shortcut_bar.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8054 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-04-25 11:08:54 +02:00
|
|
|
success: function(data) {
|
2013-01-09 10:25:07 +01:00
|
|
|
$('#cont').html(data);
|
2013-05-28 17:18:41 +02:00
|
|
|
forced_title_callback();
|
2013-01-09 10:25:07 +01:00
|
|
|
}
|
2013-01-30 14:53:02 +01:00
|
|
|
});
|
2013-01-09 10:25:07 +01:00
|
|
|
}
|
2013-01-29 11:22:59 +01:00
|
|
|
|
|
|
|
function loadModuleTable(id_module, server_name) {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: <?php echo '"' . ui_get_full_url("ajax.php", false, false, false) . '"'; ?>,
|
|
|
|
data: "page=<?php echo $_GET['sec2']; ?>&printModuleTable=1&id_module=" + id_module + "&server_name=" + server_name,
|
2013-04-25 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_alerts.php, extensions/snmp_explorer.php,
extensions/insert_data.php, extensions/net_tools.php,
extensions/resource_exportation.php, extensions/system_info.php,
extensions/pandora_logs.php, extensions/agents_modules.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/servers/manage_recontask_form.php,
godmode/setup/gis_step_2.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_add_alerts.php,
godmode/massive/massive_delete_agents.php,
godmode/massive/massive_delete_action_alerts.php,
operation/users/user_edit.php, operation/events/events_list.php,
operation/integria_incidents/incident.list.php,
operation/integria_incidents/incident.workunits.php,
operation/tree.php, general/shortcut_bar.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8054 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-04-25 11:08:54 +02:00
|
|
|
success: function(data) {
|
2013-01-29 11:22:59 +01:00
|
|
|
$('#cont').html(data);
|
2013-05-28 17:18:41 +02:00
|
|
|
forced_title_callback();
|
2013-01-29 11:22:59 +01:00
|
|
|
}
|
2013-01-30 14:53:02 +01:00
|
|
|
});
|
2013-01-29 11:22:59 +01:00
|
|
|
}
|
2013-03-15 10:30:46 +01:00
|
|
|
|
|
|
|
// Show the modal window of an module
|
|
|
|
function show_module_detail_dialog(module_id, id_agent, server_name, offset, period) {
|
|
|
|
if (period == -1) {
|
|
|
|
period = $('#period').val();
|
|
|
|
}
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
|
|
|
data: "page=include/ajax/module&get_module_detail=1&server_name="+server_name+"&id_agent="+id_agent+"&id_module=" + module_id+"&offset="+offset+"&period="+period,
|
|
|
|
dataType: "html",
|
2013-04-25 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_alerts.php, extensions/snmp_explorer.php,
extensions/insert_data.php, extensions/net_tools.php,
extensions/resource_exportation.php, extensions/system_info.php,
extensions/pandora_logs.php, extensions/agents_modules.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/servers/manage_recontask_form.php,
godmode/setup/gis_step_2.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_add_alerts.php,
godmode/massive/massive_delete_agents.php,
godmode/massive/massive_delete_action_alerts.php,
operation/users/user_edit.php, operation/events/events_list.php,
operation/integria_incidents/incident.list.php,
operation/integria_incidents/incident.workunits.php,
operation/tree.php, general/shortcut_bar.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8054 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-04-25 11:08:54 +02:00
|
|
|
success: function(data) {
|
2013-03-15 10:30:46 +01:00
|
|
|
$("#module_details_window").hide ()
|
|
|
|
.empty ()
|
|
|
|
.append (data)
|
|
|
|
.dialog ({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 620,
|
|
|
|
height: 500
|
|
|
|
})
|
|
|
|
.show ();
|
|
|
|
refresh_pagination_callback (module_id, id_agent, server_name);
|
2013-05-28 17:18:41 +02:00
|
|
|
forced_title_callback();
|
2013-03-15 10:30:46 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function refresh_pagination_callback (module_id, id_agent, server_name) {
|
|
|
|
$(".pagination").click( function() {
|
|
|
|
var classes = $(this).attr('class');
|
|
|
|
classes = classes.split(' ');
|
|
|
|
var offset_class = classes[1];
|
|
|
|
offset_class = offset_class.split('_');
|
|
|
|
var offset = offset_class[1];
|
|
|
|
|
|
|
|
var period = $('#period').val();
|
|
|
|
|
|
|
|
show_module_detail_dialog(module_id, id_agent, server_name, offset, period);
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
}
|
2012-11-26 17:44:41 +01:00
|
|
|
</script>
|