2012-08-21 Miguel de Dios <miguel.dedios@artica.es>

* pandoradb.oracle.sql, operation/agentes/estado_generalagente.php,
	operation/agentes/estado_agente.php,
	operation/agentes/ver_agente.php,
	extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
	extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
	extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
	godmode/agentes/agent_manager.php,
	godmode/agentes/modificar_agente.php,
	godmode/agentes/configurar_agente.php, pandoradb.sql,
	pandoradb.postgreSQL.sql: added the feature to set a agent in
	"Quiet" mode.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6896 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-08-21 17:12:02 +00:00
parent 431f1bbe76
commit 6eeda98886
13 changed files with 255 additions and 188 deletions

View File

@ -1,3 +1,17 @@
2012-08-21 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.oracle.sql, operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php,
operation/agentes/ver_agente.php,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
godmode/agentes/agent_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php, pandoradb.sql,
pandoradb.postgreSQL.sql: added the feature to set a agent in
"Quiet" mode.
2012-08-21 Dario Rodriguez <dario.rodriguez@artica.es> 2012-08-21 Dario Rodriguez <dario.rodriguez@artica.es>
* operation/agentes/ver_agente.php: Added code to support new * operation/agentes/ver_agente.php: Added code to support new

View File

@ -55,6 +55,7 @@ ALTER TABLE `tincidencia` ADD COLUMN `id_agent` int(10) unsigned NULL default 0;
-- Table `tagente` -- Table `tagente`
-- ----------------------------------------------------- -- -----------------------------------------------------
ALTER TABLE `tagente` ADD COLUMN `url_address` mediumtext NULL; ALTER TABLE `tagente` ADD COLUMN `url_address` mediumtext NULL;
ALTER TABLE `tagente` ADD COLUMN `quiet` tinyint(1) NOT NULL DEFAULT '0';
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `talert_special_days` -- Table `talert_special_days`
@ -100,6 +101,8 @@ ALTER TABLE `talert_snmp` ADD COLUMN (`_snmp_f1_` text, `_snmp_f2_` text, `_snmp
-- ----------------------------------------------------- -- -----------------------------------------------------
ALTER TABLE `tagente_modulo` ADD COLUMN `module_ff_interval` int(4) unsigned default '0'; ALTER TABLE `tagente_modulo` ADD COLUMN `module_ff_interval` int(4) unsigned default '0';
ALTER TABLE `tagente_modulo` CHANGE COLUMN `post_process` `post_process` double(18,5) default NULL; ALTER TABLE `tagente_modulo` CHANGE COLUMN `post_process` `post_process` double(18,5) default NULL;
ALTER TABLE `tagente_modulo` ADD COLUMN `wizard_level` enum('basic','advanced','custom','nowizard') default 'nowizard';
ALTER TABLE `tagente_modulo` ADD COLUMN `macros` text;
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `tnetwork_component` -- Table `tnetwork_component`
@ -244,12 +247,6 @@ ALTER TABLE tnetwork_component ADD `wizard_level` enum('basic','advanced','custo
ALTER TABLE tnetwork_component ADD `only_metaconsole` tinyint(1) unsigned default '0'; ALTER TABLE tnetwork_component ADD `only_metaconsole` tinyint(1) unsigned default '0';
ALTER TABLE tnetwork_component ADD `macros` text; ALTER TABLE tnetwork_component ADD `macros` text;
-- -----------------------------------------------------
-- Table `tagente_modulo`
-- -----------------------------------------------------
ALTER TABLE tagente_modulo ADD `wizard_level` enum('basic','advanced','custom','nowizard') default 'nowizard';
ALTER TABLE tagente_modulo ADD `macros` text;
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `tplugin` -- Table `tplugin`
-- ----------------------------------------------------- -- -----------------------------------------------------

View File

@ -74,6 +74,7 @@ alter table tincidencia add (id_agent NUMBER(10,0) default 0 NULL);
-- Table `tagente` -- Table `tagente`
-- ----------------------------------------------------- -- -----------------------------------------------------
alter table tagente add (url_address CLOB default '' NULL); alter table tagente add (url_address CLOB default '' NULL);
alter table tagente add (quiet NUMBER(5, 0) default 0 NOT NULL);
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `talert_special_days` -- Table `talert_special_days`

View File

@ -62,14 +62,13 @@ CREATE TABLE "tnetflow_report_content" (
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `tincidencia` -- Table `tincidencia`
-- ----------------------------------------------------- -- -----------------------------------------------------
ALTER TABLE "tincidencia" ADD COLUMN "id_agent" INTEGER NULL DEFAULT 0; ALTER TABLE "tincidencia" ADD COLUMN "id_agent" INTEGER NULL DEFAULT 0;
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `tagente` -- Table `tagente`
-- ----------------------------------------------------- -- -----------------------------------------------------
ALTER TABLE "tagente" ADD COLUMN "url_address" text NULL default ''; ALTER TABLE "tagente" ADD COLUMN "url_address" text NULL default '';
ALTER TABLE "tagente" ADD COLUMN "quiet" SMALLINT NOT NULL default 0;
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `talert_special_days` -- Table `talert_special_days`

View File

@ -14,7 +14,6 @@
// GNU General Public License for more details. // GNU General Public License for more details.
if (is_ajax ()) { if (is_ajax ()) {
global $config; global $config;
$search_parents = (bool) get_parameter ('search_parents'); $search_parents = (bool) get_parameter ('search_parents');
@ -341,9 +340,13 @@ if ($config['activate_gis']) {
$update_gis_data, false, '', 'style="margin-right: 40px;"', true); $update_gis_data, false, '', 'style="margin-right: 40px;"', true);
} }
$table->data[6][0] = __('Url address:'); $table->data[6][0] = __('Url address');
$table->data[6][1] = html_print_input_text ('url_description', $url_description, '', 45, 255, true); $table->data[6][1] = html_print_input_text ('url_description', $url_description, '', 45, 255, true);
$table->data[7][0] = __('Quiet');
$table->data[7][0] .= ui_print_help_tip(__('The agent still runs but the alerts and events will be stop'), true);
$table->data[7][1] = html_print_checkbox('quiet', 1, $quiet, true);
ui_toggle(html_print_table ($table, true), __('Advanced options')); ui_toggle(html_print_table ($table, true), __('Advanced options'));
unset($table); unset($table);

View File

@ -124,6 +124,7 @@ $unit = "";
$id_tag = array(); $id_tag = array();
$tab_description = ''; $tab_description = '';
$url_description = ''; $url_description = '';
$quiet = 0;
$macros = ''; $macros = '';
$create_agent = (bool) get_parameter ('create_agent'); $create_agent = (bool) get_parameter ('create_agent');
@ -146,6 +147,7 @@ if ($create_agent) {
$icon_path = (string) get_parameter_post ("icon_path",''); $icon_path = (string) get_parameter_post ("icon_path",'');
$update_gis_data = (int) get_parameter_post("update_gis_data", 0); $update_gis_data = (int) get_parameter_post("update_gis_data", 0);
$url_description = (string) get_parameter("url_description"); $url_description = (string) get_parameter("url_description");
$quiet = (int) get_parameter("quiet", 0);
$fields = db_get_all_fields_in_table('tagent_custom_fields'); $fields = db_get_all_fields_in_table('tagent_custom_fields');
@ -179,7 +181,8 @@ if ($create_agent) {
'id_parent' => $id_parent, 'custom_id' => $custom_id, 'id_parent' => $id_parent, 'custom_id' => $custom_id,
'icon_path' => $icon_path, 'icon_path' => $icon_path,
'update_gis_data' => $update_gis_data, 'update_gis_data' => $update_gis_data,
'url_address' => $url_description)); 'url_address' => $url_description,
'quiet' => $quiet));
enterprise_hook ('update_agent', array ($id_agente)); enterprise_hook ('update_agent', array ($id_agente));
if ($id_agente !== false) { if ($id_agente !== false) {
// Create custom fields for this agent // Create custom fields for this agent
@ -197,9 +200,12 @@ if ($create_agent) {
' Comments: ' . $comentarios . ' Mode: ' . $modo . ' Comments: ' . $comentarios . ' Mode: ' . $modo .
' ID_parent: ' . $id_parent . ' Server: ' . $server_name . ' ID_parent: ' . $id_parent . ' Server: ' . $server_name .
' ID os: ' . $id_os . ' Disabled: ' . $disabled . ' ID os: ' . $id_os . ' Disabled: ' . $disabled .
' Custom ID: ' . $custom_id . ' Cascade protection: ' . $cascade_protection . ' Custom ID: ' . $custom_id .
' Icon path: ' . $icon_path . ' Update GIS data: ' . $update_gis_data . ' Cascade protection: ' . $cascade_protection .
' Url description: ' . $url_description; ' Icon path: ' . $icon_path .
' Update GIS data: ' . $update_gis_data .
' Url description: ' . $url_description .
' Quiet: ' . (int)$quiet;
db_pandora_audit("Agent management", db_pandora_audit("Agent management",
"Created agent $nombre_agente", false, false, $info); "Created agent $nombre_agente", false, false, $info);
@ -497,13 +503,14 @@ if ($update_agent) { // if modified some agent paramenter
$id_os = (int) get_parameter_post ("id_os"); $id_os = (int) get_parameter_post ("id_os");
$disabled = (bool) get_parameter_post ("disabled"); $disabled = (bool) get_parameter_post ("disabled");
$server_name = (string) get_parameter_post ("server_name", ""); $server_name = (string) get_parameter_post ("server_name", "");
$id_parent = (string) get_parameter_post ("id_parent"); $parent_name = (string) get_parameter_post ("id_parent");
$id_parent = (int) agents_get_agent_id ($id_parent); $id_parent = (int) agents_get_agent_id ($parent_name);
$custom_id = (string) get_parameter_post ("custom_id", ""); $custom_id = (string) get_parameter_post ("custom_id", "");
$cascade_protection = (int) get_parameter_post ("cascade_protection", 0); $cascade_protection = (int) get_parameter_post ("cascade_protection", 0);
$icon_path = (string) get_parameter_post ("icon_path",''); $icon_path = (string) get_parameter_post ("icon_path",'');
$update_gis_data = (int) get_parameter_post("update_gis_data", 0); $update_gis_data = (int) get_parameter_post("update_gis_data", 0);
$url_description = (string) get_parameter("url_description"); $url_description = (string) get_parameter("url_description");
$quiet = (int) get_parameter("quiet", 0);
$fields = db_get_all_fields_in_table('tagent_custom_fields'); $fields = db_get_all_fields_in_table('tagent_custom_fields');
@ -568,7 +575,8 @@ if ($update_agent) { // if modified some agent paramenter
'custom_id' => $custom_id, 'custom_id' => $custom_id,
'icon_path' => $icon_path, 'icon_path' => $icon_path,
'update_gis_data' => $update_gis_data, 'update_gis_data' => $update_gis_data,
'url_address' => $url_description), 'url_address' => $url_description,
'quiet' => $quiet),
array ('id_agente' => $id_agente)); array ('id_agente' => $id_agente));
if ($result === false) { if ($result === false) {
@ -582,7 +590,8 @@ if ($update_agent) { // if modified some agent paramenter
' Server Name: ' . $server_name . ' ID parent: ' . $id_parent . ' Server Name: ' . $server_name . ' ID parent: ' . $id_parent .
' Custom ID: ' . $custom_id . ' Cascade Protection: ' . $cascade_protection . ' Custom ID: ' . $custom_id . ' Cascade Protection: ' . $cascade_protection .
' Icon Path: ' . $icon_path . 'Update GIS data: ' .$update_gis_data . ' Icon Path: ' . $icon_path . 'Update GIS data: ' .$update_gis_data .
' Url description: ' . $url_description; ' Url description: ' . $url_description .
' Quiet: ' . (int)$quiet;
enterprise_hook ('update_agent', array ($id_agente)); enterprise_hook ('update_agent', array ($id_agente));
ui_print_success_message (__('Successfully updated')); ui_print_success_message (__('Successfully updated'));
@ -631,6 +640,7 @@ if ($id_agente) {
$icon_path = $agent["icon_path"]; $icon_path = $agent["icon_path"];
$update_gis_data = $agent["update_gis_data"]; $update_gis_data = $agent["update_gis_data"];
$url_description = $agent["url_address"]; $url_description = $agent["url_address"];
$quiet = $agent["quiet"];
} }
$update_module = (bool) get_parameter ('update_module'); $update_module = (bool) get_parameter ('update_module');

View File

@ -394,11 +394,17 @@ if ($agents !== false) {
echo "<em>"; echo "<em>";
} }
echo '<span class="left">'; echo '<span class="left">';
echo "<strong><a href='index.php?sec=gagente& echo "<strong>";
if ($agent['quiet']) {
html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
echo "&nbsp;";
}
echo "<a href='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&tab=main& sec2=godmode/agentes/configurar_agente&tab=main&
id_agente=" . $agent["id_agente"] . "'>" . id_agente=" . $agent["id_agente"] . "'>" .
ui_print_truncate_text($agent["nombre"], 'agent_medium', true, true, true, '[&hellip;]', 'font-size: 7pt') . ui_print_truncate_text($agent["nombre"], 'agent_medium', true, true, true, '[&hellip;]', 'font-size: 7pt') .
"</a></strong>"; "</a>";
echo "</strong>";
if ($agent["disabled"]) { if ($agent["disabled"]) {
ui_print_help_tip(__('Disabled')); ui_print_help_tip(__('Disabled'));
echo "</em>"; echo "</em>";

View File

@ -367,7 +367,7 @@ $agents = agents_get_agents(array (
'id_os', 'id_os',
'ultimo_contacto', 'ultimo_contacto',
'intervalo', 'intervalo',
'comentarios description'), 'comentarios description', 'quiet'),
'AR', 'AR',
$order); $order);
@ -457,6 +457,9 @@ foreach ($agents as $agent) {
$data[0] = ''; $data[0] = '';
$data[0] .= '<span class="left">'; $data[0] .= '<span class="left">';
if ($agent['quiet']) {
$data[0] .= html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . "&nbsp;";
}
$data[0] .= ui_print_agent_name($agent["id_agente"], true, 60, 'font-size:6.5pt !important;', true); $data[0] .= ui_print_agent_name($agent["id_agente"], true, 60, 'font-size:6.5pt !important;', true);
$data[0] .= '</span>'; $data[0] .= '</span>';
$data[0] .= '<div class="left actions" style="visibility: hidden; clear: left">'; $data[0] .= '<div class="left actions" style="visibility: hidden; clear: left">';

View File

@ -78,9 +78,14 @@ echo '<tr><td class="datos"><b>'.__('Agent name').'</b></td>';
if ($agent['disabled']) { if ($agent['disabled']) {
$cellName = "<em>" . ui_print_agent_name ($agent["id_agente"], true, 500, "text-transform: uppercase;", true) . ui_print_help_tip(__('Disabled'), true) . "</em>"; $cellName = "<em>" . ui_print_agent_name ($agent["id_agente"], true, 500, "text-transform: uppercase;", true) . ui_print_help_tip(__('Disabled'), true) . "</em>";
} }
else if ($agent['quiet']) {
$cellName = "<em>" . ui_print_agent_name ($agent["id_agente"], true, 500, "text-transform: uppercase;", true) .
"&nbsp;" . html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . "</em>";
}
else { else {
$cellName = ui_print_agent_name ($agent["id_agente"], true, 500, "text-transform: uppercase;", true); $cellName = ui_print_agent_name ($agent["id_agente"], true, 500, "text-transform: uppercase;", true);
} }
echo '<td class="datos"><b>'.$cellName.'</b></td>'; echo '<td class="datos"><b>'.$cellName.'</b></td>';
echo '<td class="datos" width="40"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;refr=60">' . html_print_image("images/refresh.png", true, array("border" => '0', "title" => __('Refresh data'), "alt" => "")) . '</a>&nbsp;'; echo '<td class="datos" width="40"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;refr=60">' . html_print_image("images/refresh.png", true, array("border" => '0', "title" => __('Refresh data'), "alt" => "")) . '</a>&nbsp;';
echo '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;flag_agent=1&amp;id_agente='.$id_agente.'">' . html_print_image("images/target.png", true, array("border" => '0', "title" => __('Force'), "alt" => "")) . '</a></td></tr>'; echo '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;flag_agent=1&amp;id_agente='.$id_agente.'">' . html_print_image("images/target.png", true, array("border" => '0', "title" => __('Force'), "alt" => "")) . '</a></td></tr>';

View File

@ -518,12 +518,11 @@ else {
} }
///-------------Code for the tabs in the header of agent page-----------
$tab = get_parameter ("tab", "main"); $tab = get_parameter ("tab", "main");
/* Manage tab */ /* Manage tab */
$managetab = ""; $managetab = "";
if (check_acl ($config['id_user'],$id_grupo, "AW") || $is_extra) { if (check_acl ($config['id_user'],$id_grupo, "AW") || $is_extra) {
$managetab['text'] ='<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'">' $managetab['text'] ='<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'">'
. html_print_image("images/setup.png", true, array ("title" => __('Manage'))) . html_print_image("images/setup.png", true, array ("title" => __('Manage')))
@ -535,16 +534,17 @@ if (check_acl ($config['id_user'],$id_grupo, "AW") || $is_extra) {
$managetab['active'] = false; $managetab['active'] = false;
} }
/* Main tab */ /* Main tab */
$maintab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">' $maintab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">'
. html_print_image("images/monitor.png", true, array("title" => __('Main'))) . html_print_image("images/monitor.png", true, array("title" => __('Main')))
. '</a>'; . '</a>';
if ($tab == 'main') if ($tab == 'main')
$maintab['active'] = true; $maintab['active'] = true;
else else
$maintab['active'] = false; $maintab['active'] = false;
/* Data */ /* Data */
$datatab['text']= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'&tab=data">' $datatab['text']= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'&tab=data">'
. html_print_image("images/lightbulb.png", true, array("title" => __('Data'))) . html_print_image("images/lightbulb.png", true, array("title" => __('Data')))
@ -555,21 +555,21 @@ if (($tab == 'data') OR ($tab == 'data_view'))
else else
$datatab['active'] = false; $datatab['active'] = false;
/* Alert tab */ /* Alert tab */
$alerttab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'&tab=alert">' $alerttab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'&tab=alert">'
. html_print_image("images/bell.png", true, array("title" => __('Alerts'))) . html_print_image("images/bell.png", true, array("title" => __('Alerts')))
. '</a>'; . '</a>';
if ($tab == 'alert') if ($tab == 'alert')
$alerttab['active'] = true; $alerttab['active'] = true;
else else
$alerttab['active'] = false; $alerttab['active'] = false;
/* SLA view */ /* SLA view */
$slatab['text']= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=sla&id_agente='.$id_agente.'">' $slatab['text']= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=sla&id_agente='.$id_agente.'">'
. html_print_image("images/images.png", true, array("title" => __('S.L.A.'))) . html_print_image("images/images.png", true, array("title" => __('S.L.A.')))
. '</a>'; . '</a>';
if ($tab == 'sla') { if ($tab == 'sla') {
$slatab['active'] = true; $slatab['active'] = true;
} }
@ -577,35 +577,35 @@ else {
$slatab['active'] = false; $slatab['active'] = false;
} }
/* Inventory */ /* Inventory */
$inventorytab = enterprise_hook ('inventory_tab'); $inventorytab = enterprise_hook ('inventory_tab');
if ($inventorytab == -1) if ($inventorytab == -1)
$inventorytab = ""; $inventorytab = "";
/* Collection */ /* Collection */
$collectiontab = enterprise_hook('collection_tab'); $collectiontab = enterprise_hook('collection_tab');
if ($collectiontab == -1) if ($collectiontab == -1)
$collectiontab = ""; $collectiontab = "";
/* Policy */ /* Policy */
$policyTab = enterprise_hook('policy_tab'); $policyTab = enterprise_hook('policy_tab');
if ($policyTab == -1) if ($policyTab == -1)
$policyTab = ""; $policyTab = "";
/* Group tab */
/* Group tab */
$grouptab['text']= '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id='.$id_grupo.'">' $grouptab['text']= '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id='.$id_grupo.'">'
. html_print_image("images/agents_group.png", true, array( "title" => __('Group'))) . html_print_image("images/agents_group.png", true, array( "title" => __('Group')))
. '</a>'; . '</a>';
$grouptab['active']=false; $grouptab['active']=false;
/* GIS tab */ /* GIS tab */
$gistab=""; $gistab="";
if ($config['activate_gis']) { if ($config['activate_gis']) {
$gistab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=gis&id_agente='.$id_agente.'">' $gistab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=gis&id_agente='.$id_agente.'">'
.html_print_image("images/world.png", true, array( "title" => __('GIS data'))) .html_print_image("images/world.png", true, array( "title" => __('GIS data')))
.'</a>'; .'</a>';
@ -616,9 +616,9 @@ if ($config['activate_gis']) {
$gistab['active'] = false; $gistab['active'] = false;
} }
$total_incidents = agents_get_count_incidents($id_agente);
/* Incident tab */ /* Incident tab */
$total_incidents = agents_get_count_incidents($id_agente);
if ($config['integria_enabled'] == 0 and $total_incidents > 0) { if ($config['integria_enabled'] == 0 and $total_incidents > 0) {
$incidenttab['text'] = '<a href="index.php?sec=gagente&amp;sec2=operation/agentes/ver_agente&tab=incident&id_agente='.$id_agente.'">' $incidenttab['text'] = '<a href="index.php?sec=gagente&amp;sec2=operation/agentes/ver_agente&tab=incident&id_agente='.$id_agente.'">'
. html_print_image ("images/book_edit.png", true, array ("title" =>__('Incidents'))) . html_print_image ("images/book_edit.png", true, array ("title" =>__('Incidents')))
@ -630,9 +630,6 @@ if ($config['integria_enabled'] == 0 and $total_incidents > 0){
$incidenttab['active'] = false; $incidenttab['active'] = false;
} }
$custom_fields['text']= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=custom_fields&id_agente='.$id_agente.'">'
. html_print_image("images/note.png", true, array("title" => __('Custom fields')))
. '</a>';
/* Url address tab */ /* Url address tab */
if ($agent['url_address'] != '') { if ($agent['url_address'] != '') {
@ -640,17 +637,16 @@ if ($agent['url_address'] != ''){
. html_print_image ("images/link2.png", true, array ("title" =>__('Url address'))) . html_print_image ("images/link2.png", true, array ("title" =>__('Url address')))
. '</a>'; . '</a>';
} }
if ($tab == 'url_address') if ($tab == 'url_address')
$urladdresstab['active'] = true; $urladdresstab['active'] = true;
else else
$urladdresstab['active'] = false; $urladdresstab['active'] = false;
/* Custom fields tab */
$custom_fields['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=custom_fields&id_agente='.$id_agente.'">' $custom_fields['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=custom_fields&id_agente='.$id_agente.'">'
. html_print_image("images/note.png", true, array("title" => __('Custom fields'))) . html_print_image("images/note.png", true, array("title" => __('Custom fields')))
. '</a>'; . '</a>';
if ($tab == 'custom_fields') { if ($tab == 'custom_fields') {
$custom_fields['active'] = true; $custom_fields['active'] = true;
} }
@ -658,6 +654,8 @@ else {
$custom_fields['active'] = false; $custom_fields['active'] = false;
} }
/* Graphs tab */
$graphs['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=graphs&id_agente='.$id_agente.'">' $graphs['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=graphs&id_agente='.$id_agente.'">'
. html_print_image("images/chart_curve.png", true, array("title" => __('Graphs'))) . html_print_image("images/chart_curve.png", true, array("title" => __('Graphs')))
. '</a>'; . '</a>';
@ -669,20 +667,30 @@ else {
} }
$onheader = array('manage' => $managetab, 'separator' => "", 'main' => $maintab, $onheader = array('manage' => $managetab,
'data' => $datatab, 'alert' => $alerttab, 'sla' => $slatab, 'separator' => "",
'inventory' => $inventorytab, 'collection' => $collectiontab, 'main' => $maintab,
'group' => $grouptab, 'gis' => $gistab, 'custom' => $custom_fields, 'graphs' => $graphs, 'policy' => $policyTab); 'data' => $datatab,
'alert' => $alerttab,
'sla' => $slatab,
'inventory' => $inventorytab,
'collection' => $collectiontab,
'group' => $grouptab,
'gis' => $gistab,
'custom' => $custom_fields,
'graphs' => $graphs,
'policy' => $policyTab);
//Added after it exists
// If the agent has incidents associated // If the agent has incidents associated
if ($total_incidents) { if ($total_incidents) {
$onheader['incident'] = $incidenttab; $onheader['incident'] = $incidenttab;
} }
if ($agent['url_address'] != '') { if ($agent['url_address'] != '') {
$onheader['url_address'] = $urladdresstab; $onheader['url_address'] = $urladdresstab;
} }
//Tabs for extensions
foreach($config['extensions'] as $extension) { foreach($config['extensions'] as $extension) {
if (isset($extension['extension_ope_tab'])) { if (isset($extension['extension_ope_tab'])) {
@ -849,5 +857,4 @@ switch ($tab) {
} }
break; break;
} }
?> ?>

View File

@ -78,7 +78,8 @@ CREATE TABLE tagente (
icon_path VARCHAR2(127) DEFAULT NULL NULL , icon_path VARCHAR2(127) DEFAULT NULL NULL ,
--set it to one to update the position data (altitude, longitude, latitude) when getting information from the agent or to 0 to keep the last value and don\'t update it --set it to one to update the position data (altitude, longitude, latitude) when getting information from the agent or to 0 to keep the last value and don\'t update it
update_gis_data NUMBER(5, 0) DEFAULT 1 NOT NULL, update_gis_data NUMBER(5, 0) DEFAULT 1 NOT NULL,
url_address CLOB DEFAULT '' NULL url_address CLOB DEFAULT '' NULL,
quiet NUMBER(5, 0) default 0 NOT NULL
); );
CREATE INDEX tagente_nombre_idx ON tagente(nombre); CREATE INDEX tagente_nombre_idx ON tagente(nombre);
CREATE INDEX tagente_direccion_idx ON tagente(direccion); CREATE INDEX tagente_direccion_idx ON tagente(direccion);

View File

@ -76,7 +76,8 @@ CREATE TABLE "tagente" (
"icon_path" VARCHAR(127) NULL DEFAULT NULL, "icon_path" VARCHAR(127) NULL DEFAULT NULL,
--set it to one to update the position data (altitude, longitude, latitude) when getting information from the agent or to 0 to keep the last value and don\'t update it --set it to one to update the position data (altitude, longitude, latitude) when getting information from the agent or to 0 to keep the last value and don\'t update it
"update_gis_data" SMALLINT NOT NULL DEFAULT 1, "update_gis_data" SMALLINT NOT NULL DEFAULT 1,
"url_address" TEXT NULL default '' "url_address" TEXT NULL default '',
"quiet" SMALLINT NOT NULL default 0
); );
CREATE INDEX "tagente_nombre_idx" ON "tagente"("nombre"); CREATE INDEX "tagente_nombre_idx" ON "tagente"("nombre");
CREATE INDEX "tagente_direccion_idx" ON "tagente"("direccion"); CREATE INDEX "tagente_direccion_idx" ON "tagente"("direccion");

View File

@ -18,6 +18,12 @@
-- Because Pandora Installer don't understand them -- Because Pandora Installer don't understand them
-- and fails creating database !!! -- and fails creating database !!!
-- Priority : 0 - Maintance (grey)
-- Priority : 1 - Low (green)
-- Priority : 2 - Normal (blue)
-- Priority : 3 - Warning (yellow)
-- Priority : 4 - Critical (red)
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `taddress` -- Table `taddress`
-- ----------------------------------------------------- -- -----------------------------------------------------
@ -64,6 +70,7 @@ CREATE TABLE IF NOT EXISTS `tagente` (
`icon_path` VARCHAR(127) NULL DEFAULT NULL COMMENT 'path in the server to the image of the icon representing the agent' , `icon_path` VARCHAR(127) NULL DEFAULT NULL COMMENT 'path in the server to the image of the icon representing the agent' ,
`update_gis_data` TINYINT(1) NOT NULL DEFAULT '1' COMMENT 'set it to one to update the position data (altitude, longitude, latitude) when getting information from the agent or to 0 to keep the last value and do not update it' , `update_gis_data` TINYINT(1) NOT NULL DEFAULT '1' COMMENT 'set it to one to update the position data (altitude, longitude, latitude) when getting information from the agent or to 0 to keep the last value and do not update it' ,
`url_address` mediumtext NULL, `url_address` mediumtext NULL,
`quiet` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id_agente`), PRIMARY KEY (`id_agente`),
KEY `nombre` (`nombre`), KEY `nombre` (`nombre`),
KEY `direccion` (`direccion`), KEY `direccion` (`direccion`),
@ -146,13 +153,11 @@ CREATE TABLE `tagente_estado` (
KEY `running_by` (`running_by`), KEY `running_by` (`running_by`),
KEY `last_execution_try` (`last_execution_try`) KEY `last_execution_try` (`last_execution_try`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Probably last_execution_try index is not useful and loads more than benefits -- Probably last_execution_try index is not useful and loads more than benefits
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `tagente_modulo` -- Table `tagente_modulo`
-- ----------------------------------------------------- -- -----------------------------------------------------
-- id_modulo now uses tmodule -- id_modulo now uses tmodule
-- --------------------------- -- ---------------------------
-- 1 - Data server modules (agent related modules) -- 1 - Data server modules (agent related modules)
@ -416,6 +421,9 @@ CREATE TABLE IF NOT EXISTS `talert_compound` (
ON DELETE CASCADE ON UPDATE CASCADE ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `talert_compound_elements`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `talert_compound_elements` ( CREATE TABLE IF NOT EXISTS `talert_compound_elements` (
`id_alert_compound` int(10) unsigned NOT NULL, `id_alert_compound` int(10) unsigned NOT NULL,
`id_alert_template_module` int(10) unsigned NOT NULL, `id_alert_template_module` int(10) unsigned NOT NULL,
@ -428,6 +436,9 @@ CREATE TABLE IF NOT EXISTS `talert_compound_elements` (
ON DELETE CASCADE ON UPDATE CASCADE ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `talert_compound_actions`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `talert_compound_actions` ( CREATE TABLE IF NOT EXISTS `talert_compound_actions` (
`id` int(10) unsigned NOT NULL auto_increment, `id` int(10) unsigned NOT NULL auto_increment,
`id_alert_compound` int(10) unsigned NOT NULL, `id_alert_compound` int(10) unsigned NOT NULL,
@ -441,6 +452,9 @@ CREATE TABLE IF NOT EXISTS `talert_compound_actions` (
ON DELETE CASCADE ON UPDATE CASCADE ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `talert_special_days`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `talert_special_days` ( CREATE TABLE IF NOT EXISTS `talert_special_days` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`date` date NOT NULL DEFAULT '0000-00-00', `date` date NOT NULL DEFAULT '0000-00-00',
@ -449,12 +463,9 @@ CREATE TABLE IF NOT EXISTS `talert_special_days` (
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Priority : 0 - Maintance (grey) -- -----------------------------------------------------
-- Priority : 1 - Low (green) -- Table `tattachment`
-- Priority : 2 - Normal (blue) -- -----------------------------------------------------
-- Priority : 3 - Warning (yellow)
-- Priority : 4 - Critical (red)
CREATE TABLE IF NOT EXISTS `tattachment` ( CREATE TABLE IF NOT EXISTS `tattachment` (
`id_attachment` int(10) unsigned NOT NULL auto_increment, `id_attachment` int(10) unsigned NOT NULL auto_increment,
`id_incidencia` int(10) unsigned NOT NULL default '0', `id_incidencia` int(10) unsigned NOT NULL default '0',
@ -465,6 +476,9 @@ CREATE TABLE IF NOT EXISTS `tattachment` (
PRIMARY KEY (`id_attachment`) PRIMARY KEY (`id_attachment`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `tconfig`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `tconfig` ( CREATE TABLE IF NOT EXISTS `tconfig` (
`id_config` int(10) unsigned NOT NULL auto_increment, `id_config` int(10) unsigned NOT NULL auto_increment,
`token` varchar(100) NOT NULL default '', `token` varchar(100) NOT NULL default '',
@ -472,7 +486,9 @@ CREATE TABLE IF NOT EXISTS `tconfig` (
PRIMARY KEY (`id_config`) PRIMARY KEY (`id_config`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `tconfig_os`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `tconfig_os` ( CREATE TABLE IF NOT EXISTS `tconfig_os` (
`id_os` int(10) unsigned NOT NULL auto_increment, `id_os` int(10) unsigned NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '', `name` varchar(100) NOT NULL default '',
@ -481,7 +497,9 @@ CREATE TABLE IF NOT EXISTS `tconfig_os` (
PRIMARY KEY (`id_os`) PRIMARY KEY (`id_os`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -----------------------------------------------------
-- Table `tevento`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `tevento` ( CREATE TABLE IF NOT EXISTS `tevento` (
`id_evento` bigint(20) unsigned NOT NULL auto_increment, `id_evento` bigint(20) unsigned NOT NULL auto_increment,
`id_agente` int(10) NOT NULL default '0', `id_agente` int(10) NOT NULL default '0',
@ -506,13 +524,15 @@ CREATE TABLE IF NOT EXISTS `tevento` (
INDEX criticity (`criticity`), INDEX criticity (`criticity`),
INDEX estado (`estado`) INDEX estado (`estado`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Criticity: 0 - Maintance (grey) -- Criticity: 0 - Maintance (grey)
-- Criticity: 1 - Informational (blue) -- Criticity: 1 - Informational (blue)
-- Criticity: 2 - Normal (green) (status 0) -- Criticity: 2 - Normal (green) (status 0)
-- Criticity: 3 - Warning (yellow) (status 2) -- Criticity: 3 - Warning (yellow) (status 2)
-- Criticity: 4 - Critical (red) (status 1) -- Criticity: 4 - Critical (red) (status 1)
-- -----------------------------------------------------
-- Table `tgrupo`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `tgrupo` ( CREATE TABLE IF NOT EXISTS `tgrupo` (
`id_grupo` mediumint(4) unsigned NOT NULL auto_increment, `id_grupo` mediumint(4) unsigned NOT NULL auto_increment,
`nombre` varchar(100) NOT NULL default '', `nombre` varchar(100) NOT NULL default '',