2012-08-21 Miguel de Dios <miguel.dedios@artica.es>
* 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/module_manager_editor_common.php, godmode/agentes/module_manager.php, godmode/agentes/configurar_agente.php, godmode/agentes/module_manager_editor.php, pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql, operation/agentes/estado_ultimopaquete.php, operation/agentes/estado_monitores.php, operation/agentes/ver_agente.php: added in the modules the same feature to set agent in "Quiet" mode. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6898 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
02854636b3
commit
42e86caa45
|
@ -1,3 +1,18 @@
|
|||
2012-08-21 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* 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/module_manager_editor_common.php,
|
||||
godmode/agentes/module_manager.php,
|
||||
godmode/agentes/configurar_agente.php,
|
||||
godmode/agentes/module_manager_editor.php, pandoradb.sql,
|
||||
pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
|
||||
operation/agentes/estado_ultimopaquete.php,
|
||||
operation/agentes/estado_monitores.php,
|
||||
operation/agentes/ver_agente.php: added in the modules the same
|
||||
feature to set agent in "Quiet" mode.
|
||||
|
||||
2012-08-21 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* pandoradb.oracle.sql, operation/agentes/estado_generalagente.php,
|
||||
|
|
|
@ -103,6 +103,7 @@ ALTER TABLE `tagente_modulo` ADD COLUMN `module_ff_interval` int(4) unsigned def
|
|||
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;
|
||||
ALTER TABLE `tagente_modulo` ADD COLUMN `quiet` tinyint(1) NOT NULL DEFAULT '0';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tnetwork_component`
|
||||
|
|
|
@ -242,7 +242,6 @@ WHERE token='prominent_time';
|
|||
-- -----------------------------------------------------
|
||||
-- Table `tnetwork_component`
|
||||
-- -----------------------------------------------------
|
||||
|
||||
ALTER TABLE tnetwork_component ADD (wizard_level VARCHAR2(100) default 'custom' NOT NULL);
|
||||
ALTER TABLE tnetwork_component ADD CONSTRAINT t_network_component_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom','nowizard'));
|
||||
ALTER TABLE tnetwork_component ADD (only_metaconsole NUMBER(5, 0) default 0 NOT NULL);
|
||||
|
@ -252,15 +251,14 @@ ALTER TABLE tnetwork_component ADD (macros CLOB default '');
|
|||
-- -----------------------------------------------------
|
||||
-- Table `tagente_modulo`
|
||||
-- -----------------------------------------------------
|
||||
|
||||
ALTER TABLE tagente_modulo ADD (wizard_level VARCHAR2(100) default 'nowizard' NOT NULL);
|
||||
ALTER TABLE tagente_modulo ADD CONSTRAINT t_agente_modulo_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom','nowizard'));
|
||||
ALTER TABLE tagente_modulo ADD (macros CLOB default '');
|
||||
ALTER TABLE tagente_modulo ADD (quiet NUMBER(5, 0) default 0 NOT NULL);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tplugin`
|
||||
-- -----------------------------------------------------
|
||||
|
||||
ALTER TABLE tplugin ADD (macros CLOB default '');
|
||||
ALTER TABLE tplugin ADD (parameters CLOB default '');
|
||||
|
||||
|
|
|
@ -123,6 +123,7 @@ ALTER TABLE "talert_snmp" ADD COLUMN "single_value" varchar(255) DEFAULT '';
|
|||
-- Table `tagente_modulo`
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE "tagente_modulo" ADD COLUMN "module_ff_interval" INTEGER NOT NULL default 0;
|
||||
ALTER TABLE "tagente_modulo" ADD COLUMN "quiet" SMALLINT NOT NULL default 0;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tevent_filter`
|
||||
|
|
|
@ -65,6 +65,7 @@ $nombre_agente = "";
|
|||
$direccion_agente = get_parameter ('direccion', '');
|
||||
$intervalo = SECONDS_5MINUTES;
|
||||
$ff_interval = 0;
|
||||
$quiet_module = 0;
|
||||
$id_server = "";
|
||||
$max_alerts = 0;
|
||||
$modo = 1;
|
||||
|
@ -683,6 +684,7 @@ if ($update_module || $create_module) {
|
|||
$max = (int) get_parameter ('max');
|
||||
$interval = (int) get_parameter ('module_interval', $intervalo);
|
||||
$ff_interval = (int) get_parameter ('module_ff_interval');
|
||||
$quiet_module = (int) get_parameter ('quiet_module');
|
||||
$id_plugin = (int) get_parameter ('id_plugin');
|
||||
$id_export = (int) get_parameter ('id_export');
|
||||
$disabled = (bool) get_parameter ('disabled');
|
||||
|
@ -818,7 +820,8 @@ if ($update_module) {
|
|||
'custom_integer_2' => $custom_integer_2,
|
||||
'min_ff_event' => $ff_event,
|
||||
'unit' => $unit,
|
||||
'macros' => $macros);
|
||||
'macros' => $macros,
|
||||
'quiet' => $quiet_module);
|
||||
|
||||
if ($prediction_module == 3 && $serialize_ops == '') {
|
||||
$result = false;
|
||||
|
@ -926,7 +929,8 @@ if ($create_module) {
|
|||
'custom_integer_2' => $custom_integer_2,
|
||||
'min_ff_event' => $ff_event,
|
||||
'unit' => $unit,
|
||||
'macros' => $macros);
|
||||
'macros' => $macros,
|
||||
'quiet' => $quiet_module);
|
||||
|
||||
if ($prediction_module == 3 && $serialize_ops == '') {
|
||||
$id_agent_module = false;
|
||||
|
|
|
@ -218,9 +218,9 @@ if ($multiple_delete) {
|
|||
}
|
||||
|
||||
|
||||
// ==========================
|
||||
// MODULE VISUALIZATION TABLE
|
||||
// ==========================
|
||||
// ==================
|
||||
// TABLE LIST MODULES
|
||||
// ==================
|
||||
|
||||
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente=' . $id_agente;
|
||||
$selectNameUp = '';
|
||||
|
@ -350,8 +350,8 @@ $params = implode(',', array ('id_agente_modulo', 'id_tipo_modulo',
|
|||
'descripcion', 'nombre', 'max', 'min', 'module_interval',
|
||||
'id_modulo', 'id_module_group', 'disabled','max_warning',
|
||||
'min_warning', 'str_warning', 'max_critical', 'min_critical',
|
||||
'str_critical'));
|
||||
|
||||
'str_critical', 'quiet'));
|
||||
|
||||
$where = sprintf("delete_pending = 0 AND id_agente = %s", $id_agente);
|
||||
|
||||
$search_string_entities = io_safe_input($search_string);
|
||||
|
@ -480,8 +480,12 @@ foreach ($modules as $module) {
|
|||
|
||||
$data = array ();
|
||||
}
|
||||
|
||||
$data[0] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=' . $id_agente . '&tab=module&edit_module=1&id_agent_module='.$module['id_agente_modulo'].'">';
|
||||
$data[0] = "";
|
||||
if ($module['quiet']) {
|
||||
$data[0] .= html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => ""))
|
||||
. " ";
|
||||
}
|
||||
$data[0] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=' . $id_agente . '&tab=module&edit_module=1&id_agent_module='.$module['id_agente_modulo'].'">';
|
||||
if ($module["disabled"])
|
||||
$data[0] .= '<em class="disabled_module">' .
|
||||
ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '[…]', 'font-size: 7.2pt').'</em>';
|
||||
|
|
|
@ -153,6 +153,7 @@ if ($id_agent_module) {
|
|||
$interval = agents_get_interval ($id_agente);
|
||||
}
|
||||
$ff_interval = $module['module_ff_interval'];
|
||||
$quiet_module = $module['quiet'];
|
||||
$unit = $module['unit'];
|
||||
$tcp_port = $module['tcp_port'];
|
||||
$tcp_send = $module['tcp_send'];
|
||||
|
|
|
@ -264,7 +264,7 @@ $none_text = __('None');
|
|||
$disabled_export = false;
|
||||
// If code comes from policies disable export select
|
||||
global $__code_from;
|
||||
if ($__code_from == 'policies'){
|
||||
if ($__code_from == 'policies') {
|
||||
$none_text = __('Not needed');
|
||||
$disabled_export = true;
|
||||
}
|
||||
|
@ -314,6 +314,10 @@ $table_advanced->data[6][4] = html_print_select_from_sql (
|
|||
ORDER BY name",
|
||||
'id_tag_selected[]', $id_tag, '','','', true, true, false,
|
||||
false, 'width: 200px', '5');
|
||||
$table_advanced->data[7][0] = __('Quiet');
|
||||
$table_advanced->data[7][0] .= ui_print_help_tip(__('The module still stores data but the alerts and events will be stop'), true);
|
||||
$table_advanced->colspan[7][1] = 4;
|
||||
$table_advanced->data[7][1] = html_print_checkbox('quiet_module', 1, $quiet_module, true);
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -29,11 +29,11 @@ if (is_ajax ()) {
|
|||
if ($tags === false)
|
||||
$tags = array();
|
||||
|
||||
echo '<h3> Tag\'s information </h3>';
|
||||
echo '<h3> Tag\'s information </h3>';
|
||||
foreach ($tags as $tag) {
|
||||
echo tags_get_name($tag).'<br>';
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
|
@ -42,7 +42,7 @@ if (is_ajax ()) {
|
|||
if (!isset ($id_agente)) {
|
||||
//This page is included, $id_agente should be passed to it.
|
||||
db_pandora_audit("HACK Attempt",
|
||||
"Trying to get to monitor list without id_agent passed");
|
||||
"Trying to get to monitor list without id_agent passed");
|
||||
include ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ switch ($config["dbtype"]) {
|
|||
$fields_tagente_estado = oracle_list_all_field_table('tagente_estado', 'string');
|
||||
$fields_tagente_modulo = oracle_list_all_field_table('tagente_modulo', 'string');
|
||||
$fields_tmodule_group = oracle_list_all_field_table('tmodule_group', 'string');
|
||||
|
||||
|
||||
$sql = sprintf ("
|
||||
SELECT " . $fields_tagente_estado . ', ' . $fields_tagente_modulo . ', ' . $fields_tmodule_group .
|
||||
" FROM tagente_estado, tagente_modulo
|
||||
|
@ -306,15 +306,20 @@ foreach ($modules as $module) {
|
|||
$data[2] = servers_show_type ($module['id_modulo']) . ' ';
|
||||
|
||||
if (check_acl ($config['id_user'], $id_grupo, "AW"))
|
||||
$data[2] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&id_agent_module='.$module["id_agente_modulo"].'&edit_module='.$module["id_modulo"].'">' . html_print_image("images/config.png", true, array("alt" => '0', "border" => "")) . '</a>';
|
||||
|
||||
$data[3] = ui_print_string_substr ($module["nombre"], 30, true);
|
||||
$data[2] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&id_agent_module='.$module["id_agente_modulo"].'&edit_module='.$module["id_modulo"].'">' . html_print_image("images/config.png", true, array("alt" => '0', "border" => "")) . '</a>';
|
||||
|
||||
$data[3] = "";
|
||||
if ($module['quiet']) {
|
||||
$data[3] .= html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => ""))
|
||||
. " ";
|
||||
}
|
||||
$data[3] .= ui_print_string_substr ($module["nombre"], 30, true);
|
||||
if (!empty($module["extended_info"])) {
|
||||
if ($module["extended_info"] != "") {
|
||||
$data[3] .= ui_print_help_tip ($module["extended_info"], true, '/images/comments.png');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Adds tag context information
|
||||
if (tags_get_modules_tag_count($module['id_agente_modulo']) > 0) {
|
||||
$data[3] .= ' <a class="tag_details" href="ajax.php?page=operation/agentes/estado_monitores&get_tag_tooltip=1&id_agente_modulo='.$module['id_agente_modulo'].'">' .
|
||||
|
@ -323,9 +328,9 @@ foreach ($modules as $module) {
|
|||
$data[4] = ui_print_string_substr ($module["descripcion"], 60, true, 8);
|
||||
|
||||
modules_get_status($module['id_agente_modulo'], $module['estado'], $module['datos'], $status, $title);
|
||||
|
||||
|
||||
$data[5] = ui_print_status_image($status, $title, true);
|
||||
|
||||
|
||||
if ($module["id_tipo_modulo"] == 24) { // log4x
|
||||
switch($module["datos"]) {
|
||||
case 10: $salida = "TRACE"; $style="font-weight:bold; color:darkgreen;"; break;
|
||||
|
@ -400,7 +405,7 @@ function toggle_full_value(id) {
|
|||
value_title = $("#value_module_" + id).attr('title');
|
||||
|
||||
$("#value_module_" + id).attr('title', $("#value_module_text_" + id).html());
|
||||
|
||||
|
||||
$("#value_module_text_" + id).html(value_title);
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -340,8 +340,12 @@ foreach ($modules as $module) {
|
|||
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
||||
if ($module["id_policy_module"] != 0) {
|
||||
$linked = policies_is_module_linked($module['id_agente_modulo']);
|
||||
$id_policy = db_get_value_sql('SELECT id_policy FROM tpolicy_modules WHERE id = '.$module["id_policy_module"]);
|
||||
$name_policy = db_get_value_sql('SELECT name FROM tpolicies WHERE id = '.$id_policy);
|
||||
$id_policy = db_get_value_sql('SELECT id_policy
|
||||
FROM tpolicy_modules
|
||||
WHERE id = '.$module["id_policy_module"]);
|
||||
$name_policy = db_get_value_sql('SELECT name
|
||||
FROM tpolicies
|
||||
WHERE id = '.$id_policy);
|
||||
$policyInfo = policies_info_module_policy($module["id_policy_module"]);
|
||||
|
||||
$adopt = false;
|
||||
|
@ -393,6 +397,10 @@ foreach ($modules as $module) {
|
|||
}
|
||||
$nombre_tipo_modulo = modules_get_moduletype_name ($module["id_tipo_modulo"]);
|
||||
echo "<td class='".$tdcolor."_id' title='".io_safe_output($module["nombre"])."'>";
|
||||
if ($module['quiet']) {
|
||||
html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
|
||||
echo " ";
|
||||
}
|
||||
ui_print_string_substr ($module["nombre"], 35, false, 10);
|
||||
echo "</td><td class='".$tdcolor."'> ";
|
||||
|
||||
|
|
|
@ -709,22 +709,21 @@ foreach($config['extensions'] as $extension) {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
//RHEV extension is only available for RHEV Virtual Machines
|
||||
if ($extension['extension_ope_tab']['id'] === "rhev_manager") {
|
||||
|
||||
//Get id for remote field "rhev_type"
|
||||
|
||||
//RHEV extension is only available for RHEV Virtual Machines
|
||||
if ($extension['extension_ope_tab']['id'] === "rhev_manager") {
|
||||
//Get id for remote field "rhev_type"
|
||||
$id_remote_field = db_get_value("id_field", "tagent_custom_fields", "name", "rhev_type");
|
||||
|
||||
|
||||
//Get rhev type for this agent
|
||||
$rhev_type = db_get_value_filter ("description", "tagent_custom_data", array ("id_field" => $id_remote_field, "id_agent" => $agent['id_agente']));
|
||||
|
||||
|
||||
//Check if rhev type is a vm
|
||||
if ($rhev_type != "vm") {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ($rhev_type != "vm") {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$image = $extension['extension_ope_tab']['icon'];
|
||||
$name = $extension['extension_ope_tab']['name'];
|
||||
|
|
|
@ -226,8 +226,9 @@ CREATE TABLE tagente_modulo (
|
|||
wizard_level VARCHAR2(100) default 'nowizard' NOT NULL,
|
||||
macros CLOB default '',
|
||||
critical_instructions CLOB default '',
|
||||
warning_instructions CLOB default '',
|
||||
unknown_instructions CLOB default '',
|
||||
warning_instructions CLOB default '',
|
||||
unknown_instructions CLOB default '',
|
||||
quiet NUMBER(5, 0) default 0 NOT NULL,
|
||||
CONSTRAINT t_agente_modulo_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom','nowizard'))
|
||||
);
|
||||
CREATE INDEX tagente_modulo_id_agente_idx ON tagente_modulo(id_agente);
|
||||
|
|
|
@ -219,7 +219,8 @@ CREATE TABLE "tagente_modulo" (
|
|||
"macros" TEXT default '',
|
||||
"critical_instructions" TEXT default '',
|
||||
"warning_instructions" TEXT default '',
|
||||
"unknown_instructions" TEXT default ''
|
||||
"unknown_instructions" TEXT default '',
|
||||
"quiet" SMALLINT NOT NULL default 0
|
||||
);
|
||||
CREATE INDEX "tagente_modulo_id_agente_idx" ON "tagente_modulo"("id_agente");
|
||||
CREATE INDEX "tagente_modulo_id_tipo_modulo_idx" ON "tagente_modulo"("id_tipo_modulo");
|
||||
|
|
|
@ -220,6 +220,7 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` (
|
|||
`critical_instructions` text,
|
||||
`warning_instructions` text,
|
||||
`unknown_instructions` text,
|
||||
`quiet` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (`id_agente_modulo`),
|
||||
KEY `main_idx` (`id_agente_modulo`,`id_agente`),
|
||||
KEY `tam_agente` (`id_agente`),
|
||||
|
|
Loading…
Reference in New Issue