2011-07-07 Ramon Novoa <rnovoa@artica.es>

* include/functions_network_components.php,
	  include/functions_api.php,
	  include/functions_ui.php,
	  pandoradb.sql,
	  pandoradb.postgreSQL.sql,
	  pandoradb.oracle.sql,
	  extensions/resource_registration.php,
	  extensions/plugin_registration.php,
	  operation/agentes/status_monitor.php,
	  operation/agentes/estado_monitores.php,
	  extras/pandoradb_migrate_v3.2_to_v4.0.sql,
	  godmode/agentes/module_manager_editor_common.php,
	  godmode/agentes/module_manager.php,
	  godmode/agentes/configurar_agente.php,
	  godmode/agentes/module_manager_editor.php,
	  godmode/massive/massive_edit_modules.php,
	  godmode/modules/manage_network_components_form.php,
	  godmode/modules/manage_network_templates.php,
	  godmode/modules/manage_network_components_form_common.php,
	  godmode/modules/manage_network_components.php: Added support for
	  warning/critical status regexp (works with both numeric and string
	  data types).



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4524 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2011-07-07 11:12:15 +00:00
parent 0daa70e4b7
commit acfcbbe49a
21 changed files with 147 additions and 32 deletions

View File

@ -1,3 +1,28 @@
2011-07-07 Ramon Novoa <rnovoa@artica.es>
* include/functions_network_components.php,
include/functions_api.php,
include/functions_ui.php,
pandoradb.sql,
pandoradb.postgreSQL.sql,
pandoradb.oracle.sql,
extensions/resource_registration.php,
extensions/plugin_registration.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_monitores.php,
extras/pandoradb_migrate_v3.2_to_v4.0.sql,
godmode/agentes/module_manager_editor_common.php,
godmode/agentes/module_manager.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/module_manager_editor.php,
godmode/massive/massive_edit_modules.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/manage_network_components_form_common.php,
godmode/modules/manage_network_components.php: Added support for
warning/critical status regexp (works with both numeric and string
data types).
2011-07-07 Sergio Martin <sergio.martin@artica.es> 2011-07-07 Sergio Martin <sergio.martin@artica.es>
* pandoradb.sql * pandoradb.sql
@ -39,6 +64,7 @@
pandoradb.data.oracle.sql: Default skin applied to all groups pandoradb.data.oracle.sql: Default skin applied to all groups
by default. by default.
>>>>>>> .r4523
2011-07-06 Juan Manuel Ramon <juanmanuel.ramon@artica.es> 2011-07-06 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/styles/pandora.css * include/styles/pandora.css

View File

@ -146,7 +146,11 @@ function pluginreg_extension_main () {
'max_timeout' => $ini_array[$label]["max_timeout"], 'max_timeout' => $ini_array[$label]["max_timeout"],
'history_data' => $ini_array[$label]["history_data"], 'history_data' => $ini_array[$label]["history_data"],
'min_warning' => $ini_array[$label]["min_warning"], 'min_warning' => $ini_array[$label]["min_warning"],
'max_warning' => $ini_array[$label]["max_warning"],
'str_warning' => $ini_array[$label]["str_warning"],
'min_critical' => $ini_array[$label]["min_critical"], 'min_critical' => $ini_array[$label]["min_critical"],
'max_critical' => $ini_array[$label]["max_critical"],
'str_critical' => $ini_array[$label]["str_critical"],
'min_ff_event' => $ini_array[$label]["min_ff_event"], 'min_ff_event' => $ini_array[$label]["min_ff_event"],
'tcp_port' => $ini_array[$label]["tcp_port"], 'tcp_port' => $ini_array[$label]["tcp_port"],
'id_plugin' => $create_id); 'id_plugin' => $create_id);

View File

@ -607,8 +607,10 @@ function process_upload_xml_component($xml) {
$historical_data = (int)$componentElement->historical_data; $historical_data = (int)$componentElement->historical_data;
$min_war = (float)$componentElement->min_war; $min_war = (float)$componentElement->min_war;
$max_war = (float)$componentElement->max_war; $max_war = (float)$componentElement->max_war;
$str_war = (string)$componentElement->str_war;
$min_cri = (float)$componentElement->min_cri; $min_cri = (float)$componentElement->min_cri;
$max_cri = (float)$componentElement->max_cri; $max_cri = (float)$componentElement->max_cri;
$str_cri = (string)$componentElement->str_cri;
$ff_treshold = (int)$componentElement->ff_treshold; $ff_treshold = (int)$componentElement->ff_treshold;
$snmp_version = (int)$componentElement->snmp_version; $snmp_version = (int)$componentElement->snmp_version;
$auth_user = io_safe_input((string)$componentElement->auth_user); $auth_user = io_safe_input((string)$componentElement->auth_user);
@ -676,8 +678,10 @@ function process_upload_xml_component($xml) {
'history_data' => $historical_data, 'history_data' => $historical_data,
'min_warning' => $min_war, 'min_warning' => $min_war,
'max_warning' => $max_war, 'max_warning' => $max_war,
'str_warning' => $str_war,
'min_critical' => $min_cri, 'min_critical' => $min_cri,
'max_critical' => $max_cri, 'max_critical' => $max_cri,
'str_critical' => $str_cri,
'min_ff_event' => $ff_treshold, 'min_ff_event' => $ff_treshold,
'custom_string_1' => $custom_string_1, 'custom_string_1' => $custom_string_1,
'custom_string_2' => $custom_string_2, 'custom_string_2' => $custom_string_2,
@ -709,8 +713,10 @@ function process_upload_xml_component($xml) {
'history_data' => $historical_data, 'history_data' => $historical_data,
'min_warning' => $min_war, 'min_warning' => $min_war,
'max_warning' => $max_war, 'max_warning' => $max_war,
'str_warning' => $str_war,
'min_critical' => $min_cri, 'min_critical' => $min_cri,
'max_critical' => $max_cri, 'max_critical' => $max_cri,
'str_critical' => $str_cri,
'min_ff_event' => $ff_treshold, 'min_ff_event' => $ff_treshold,
'custom_string_1' => $custom_string_1, 'custom_string_1' => $custom_string_1,
'custom_string_2' => $custom_string_2, 'custom_string_2' => $custom_string_2,
@ -744,8 +750,10 @@ function process_upload_xml_component($xml) {
'history_data' => $historical_data, 'history_data' => $historical_data,
'min_warning' => $min_war, 'min_warning' => $min_war,
'max_warning' => $max_war, 'max_warning' => $max_war,
'str_warning' => $str_war,
'min_critical' => $min_cri, 'min_critical' => $min_cri,
'max_critical' => $max_cri, 'max_critical' => $max_cri,
'str_critical' => $str_cri,
'min_ff_event' => $ff_treshold, 'min_ff_event' => $ff_treshold,
'custom_string_1' => $custom_string_1, 'custom_string_1' => $custom_string_1,
'custom_string_2' => $custom_string_2, 'custom_string_2' => $custom_string_2,

View File

@ -181,6 +181,8 @@ CREATE TABLE IF NOT EXISTS `ttag_event` (
-- ----------------------------------------------------- -- -----------------------------------------------------
ALTER TABLE `tagente_modulo` ADD COLUMN (`unit` text DEFAULT ''); ALTER TABLE `tagente_modulo` ADD COLUMN (`unit` text DEFAULT '');
ALTER TABLE `tagente_modulo` ADD COLUMN (`str_warning` text DEFAULT '');
ALTER TABLE `tagente_modulo` ADD COLUMN (`str_critical` text DEFAULT '');
ALTER TABLE `tagente_modulo` ADD INDEX module(id_modulo); ALTER TABLE `tagente_modulo` ADD INDEX module(id_modulo);
-- ----------------------------------------------------- -- -----------------------------------------------------

View File

@ -643,8 +643,10 @@ if ($update_module || $create_module) {
$history_data = (int) get_parameter('history_data'); $history_data = (int) get_parameter('history_data');
$min_warning = (float) get_parameter ('min_warning'); $min_warning = (float) get_parameter ('min_warning');
$max_warning = (float) get_parameter ('max_warning'); $max_warning = (float) get_parameter ('max_warning');
$str_warning = (string) get_parameter ('str_warning');
$min_critical = (float) get_parameter ('min_critical'); $min_critical = (float) get_parameter ('min_critical');
$max_critical = (float) get_parameter ('max_critical'); $max_critical = (float) get_parameter ('max_critical');
$str_critical = (string) get_parameter ('str_critical');
$ff_event = (int) get_parameter ('ff_event'); $ff_event = (int) get_parameter ('ff_event');
$unit = (string) get_parameter('unit'); $unit = (string) get_parameter('unit');
$id_tag = (array) get_parameter('id_tag_selected'); $id_tag = (array) get_parameter('id_tag_selected');
@ -689,8 +691,10 @@ if ($update_module) {
'history_data' => $history_data, 'history_data' => $history_data,
'min_warning' => $min_warning, 'min_warning' => $min_warning,
'max_warning' => $max_warning, 'max_warning' => $max_warning,
'str_warning' => $str_warning,
'min_critical' => $min_critical, 'min_critical' => $min_critical,
'max_critical' => $max_critical, 'max_critical' => $max_critical,
'str_critical' => $str_critical,
'custom_string_1' => $custom_string_1, 'custom_string_1' => $custom_string_1,
'custom_string_2' => $custom_string_2, 'custom_string_2' => $custom_string_2,
'custom_string_3' => $custom_string_3, 'custom_string_3' => $custom_string_3,
@ -767,8 +771,10 @@ if ($create_module) {
'history_data' => $history_data, 'history_data' => $history_data,
'min_warning' => $min_warning, 'min_warning' => $min_warning,
'max_warning' => $max_warning, 'max_warning' => $max_warning,
'str_warning' => $str_warning,
'min_critical' => $min_critical, 'min_critical' => $min_critical,
'max_critical' => $max_critical, 'max_critical' => $max_critical,
'str_critical' => $str_critical,
'custom_string_1' => $custom_string_1, 'custom_string_1' => $custom_string_1,
'custom_string_2' => $custom_string_2, 'custom_string_2' => $custom_string_2,
'custom_string_3' => $custom_string_3, 'custom_string_3' => $custom_string_3,

View File

@ -260,7 +260,8 @@ $modules = db_get_all_rows_filter ('tagente_modulo',
'order' => $order), 'order' => $order),
array ('id_agente_modulo', 'id_tipo_modulo', 'descripcion', 'nombre', array ('id_agente_modulo', 'id_tipo_modulo', 'descripcion', 'nombre',
'max', 'min', 'module_interval', 'id_modulo', 'id_module_group', 'max', 'min', 'module_interval', 'id_modulo', 'id_module_group',
'disabled','max_warning', 'min_warning', 'max_critical', 'min_critical')); 'disabled','max_warning', 'min_warning', 'str_warning',
'max_critical', 'min_critical', 'str_critical'));
if ($modules === false) { if ($modules === false) {
echo "<div class='nf'>".__('No available data to show')."</div>"; echo "<div class='nf'>".__('No available data to show')."</div>";
@ -414,7 +415,7 @@ foreach ($modules as $module) {
$data[5] = ui_print_truncate_text($module['descripcion'], 25, false); $data[5] = ui_print_truncate_text($module['descripcion'], 25, false);
// MAX / MIN values // MAX / MIN values
$data[6] = ui_print_module_warn_value ($module["max_warning"], $module["min_warning"], $module["max_critical"], $module["min_critical"]); $data[6] = ui_print_module_warn_value ($module["max_warning"], $module["min_warning"], $module["str_warning"], $module["max_critical"], $module["min_critical"], $module["str_critical"]);
// Delete module // Delete module
$data[7] = html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true); $data[7] = html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true);

View File

@ -172,8 +172,10 @@ if ($id_agent_module) {
$history_data = $module['history_data']; $history_data = $module['history_data'];
$min_warning = $module['min_warning']; $min_warning = $module['min_warning'];
$max_warning = $module['max_warning']; $max_warning = $module['max_warning'];
$str_warning = $module['str_warning'];
$min_critical = $module['min_critical']; $min_critical = $module['min_critical'];
$max_critical = $module['max_critical']; $max_critical = $module['max_critical'];
$str_critical = $module['str_critical'];
$ff_event = $module['min_ff_event']; $ff_event = $module['min_ff_event'];
// Select tag info. // Select tag info.
$id_tag = tags_get_module_tags ($id_agent_module); $id_tag = tags_get_module_tags ($id_agent_module);
@ -215,8 +217,10 @@ else {
$history_data = 1; $history_data = 1;
$min_warning = 0; $min_warning = 0;
$max_warning = 0; $max_warning = 0;
$str_warning = '';
$min_critical = 0; $min_critical = 0;
$max_critical = 0; $max_critical = 0;
$str_critical = '';
$ff_event = 0; $ff_event = 0;
// New support for snmp v3 // New support for snmp v3

View File

@ -175,6 +175,9 @@ $table_simple->data[2][1] .= html_print_input_text ('min_warning', $min_warning,
$table_simple->data[2][1] .= '<br /><em>'.__('Max.').'</em>'; $table_simple->data[2][1] .= '<br /><em>'.__('Max.').'</em>';
$table_simple->data[2][1] .= html_print_input_text ('max_warning', $max_warning, $table_simple->data[2][1] .= html_print_input_text ('max_warning', $max_warning,
'', 10, 255, true, $disabledBecauseInPolicy); '', 10, 255, true, $disabledBecauseInPolicy);
$table_simple->data[2][1] .= '<br /><em>'.__('Str.').'</em>';
$table_simple->data[2][1] .= html_print_input_text ('str_warning', $str_warning,
'', 10, 255, true, $disabledBecauseInPolicy);
$table_simple->data[2][2] = __('Critical status').' ' . ui_print_help_icon ('critical_status', true); $table_simple->data[2][2] = __('Critical status').' ' . ui_print_help_icon ('critical_status', true);
$table_simple->data[2][3] = '<em>'.__('Min. ').'</em>'; $table_simple->data[2][3] = '<em>'.__('Min. ').'</em>';
$table_simple->data[2][3] .= html_print_input_text ('min_critical', $min_critical, $table_simple->data[2][3] .= html_print_input_text ('min_critical', $min_critical,
@ -182,6 +185,9 @@ $table_simple->data[2][3] .= html_print_input_text ('min_critical', $min_critica
$table_simple->data[2][3] .= '<br /><em>'.__('Max.').'</em>'; $table_simple->data[2][3] .= '<br /><em>'.__('Max.').'</em>';
$table_simple->data[2][3] .= html_print_input_text ('max_critical', $max_critical, $table_simple->data[2][3] .= html_print_input_text ('max_critical', $max_critical,
'', 10, 255, true, $disabledBecauseInPolicy); '', 10, 255, true, $disabledBecauseInPolicy);
$table_simple->data[2][3] .= '<br /><em>'.__('Str.').'</em>';
$table_simple->data[2][3] .= html_print_input_text ('str_critical', $str_critical,
'', 10, 255, true, $disabledBecauseInPolicy);
/* FF stands for Flip-flop */ /* FF stands for Flip-flop */
$table_simple->data[3][0] = __('FF threshold').' ' . ui_print_help_icon ('ff_threshold', true); $table_simple->data[3][0] = __('FF threshold').' ' . ui_print_help_icon ('ff_threshold', true);

View File

@ -35,7 +35,7 @@ function process_manage_edit ($module_name, $agents_select = null) {
} }
/* List of fields which can be updated */ /* List of fields which can be updated */
$fields = array ('min_warning', 'max_warning', 'min_critical', 'max_critical', 'min_ff_event', 'module_interval', $fields = array ('min_warning', 'max_warning', 'str_warning', 'min_critical', 'max_critical', 'str_critical', 'min_ff_event', 'module_interval',
'disabled', 'post_process', 'snmp_community', 'tcp_send', 'min', 'max', 'id_module_group', 'plugin_user', 'plugin_pass', 'id_export', 'history_data'); 'disabled', 'post_process', 'snmp_community', 'tcp_send', 'min', 'max', 'id_module_group', 'plugin_user', 'plugin_pass', 'id_export', 'history_data');
$values = array (); $values = array ();
foreach ($fields as $field) { foreach ($fields as $field) {
@ -298,11 +298,15 @@ $table->data['edit1'][1] = '<em>'.__('Min.').'</em>';
$table->data['edit1'][1] .= html_print_input_text ('min_warning', '', '', 5, 15, true); $table->data['edit1'][1] .= html_print_input_text ('min_warning', '', '', 5, 15, true);
$table->data['edit1'][1] .= '<br /><em>'.__('Max.').'</em>'; $table->data['edit1'][1] .= '<br /><em>'.__('Max.').'</em>';
$table->data['edit1'][1] .= html_print_input_text ('max_warning', '', '', 5, 15, true); $table->data['edit1'][1] .= html_print_input_text ('max_warning', '', '', 5, 15, true);
$table->data['edit1'][1] .= '<br /><em>'.__('Str.').'</em>';
$table->data['edit1'][1] .= html_print_input_text ('str_warning', '', '', 5, 15, true);
$table->data['edit1'][2] = __('Critical status'); $table->data['edit1'][2] = __('Critical status');
$table->data['edit1'][3] = '<em>'.__('Min.').'</em>'; $table->data['edit1'][3] = '<em>'.__('Min.').'</em>';
$table->data['edit1'][3] .= html_print_input_text ('min_critical', '', '', 5, 15, true); $table->data['edit1'][3] .= html_print_input_text ('min_critical', '', '', 5, 15, true);
$table->data['edit1'][3] .= '<br /><em>'.__('Max.').'</em>'; $table->data['edit1'][3] .= '<br /><em>'.__('Max.').'</em>';
$table->data['edit1'][3] .= html_print_input_text ('max_critical', '', '', 5, 15, true); $table->data['edit1'][3] .= html_print_input_text ('max_critical', '', '', 5, 15, true);
$table->data['edit1'][3] .= '<br /><em>'.__('Str.').'</em>';
$table->data['edit1'][3] .= html_print_input_text ('str_critical', '', '', 5, 15, true);
$table->data['edit2'][0] = __('Interval'); $table->data['edit2'][0] = __('Interval');
$table->data['edit2'][1] = html_print_input_text ('module_interval', '', '', 5, 15, true); $table->data['edit2'][1] = html_print_input_text ('module_interval', '', '', 5, 15, true);

View File

@ -51,8 +51,10 @@ $id_modulo = (int) get_parameter ('id_component_type');
$id_plugin = (int) get_parameter ('id_plugin'); $id_plugin = (int) get_parameter ('id_plugin');
$min_warning = (int) get_parameter ('min_warning'); $min_warning = (int) get_parameter ('min_warning');
$max_warning = (int) get_parameter ('max_warning'); $max_warning = (int) get_parameter ('max_warning');
$str_warning = (string) get_parameter ('str_warning');
$min_critical = (int) get_parameter ('min_critical'); $min_critical = (int) get_parameter ('min_critical');
$max_critical = (int) get_parameter ('max_critical'); $max_critical = (int) get_parameter ('max_critical');
$str_critical = (string) get_parameter ('str_critical');
$ff_event = (int) get_parameter ('ff_event'); $ff_event = (int) get_parameter ('ff_event');
$history_data = (bool) get_parameter ('history_data'); $history_data = (bool) get_parameter ('history_data');
$post_process = (float) get_parameter('post_process'); $post_process = (float) get_parameter('post_process');
@ -124,8 +126,10 @@ if ($create_component) {
'history_data' => $history_data, 'history_data' => $history_data,
'min_warning' => $min_warning, 'min_warning' => $min_warning,
'max_warning' => $max_warning, 'max_warning' => $max_warning,
'str_warning' => $str_warning,
'min_critical' => $min_critical, 'min_critical' => $min_critical,
'max_critical' => $max_critical, 'max_critical' => $max_critical,
'str_critical' => $str_critical,
'min_ff_event' => $ff_event, 'min_ff_event' => $ff_event,
'custom_string_1' => $custom_string_1, 'custom_string_1' => $custom_string_1,
'custom_string_2' => $custom_string_2, 'custom_string_2' => $custom_string_2,
@ -180,8 +184,10 @@ if ($update_component) {
'history_data' => $history_data, 'history_data' => $history_data,
'min_warning' => $min_warning, 'min_warning' => $min_warning,
'max_warning' => $max_warning, 'max_warning' => $max_warning,
'str_warning' => $str_warning,
'min_critical' => $min_critical, 'min_critical' => $min_critical,
'max_critical' => $max_critical, 'max_critical' => $max_critical,
'str_critical' => $str_critical,
'min_ff_event' => $ff_event, 'min_ff_event' => $ff_event,
'custom_string_1' => $custom_string_1, 'custom_string_1' => $custom_string_1,
'custom_string_2' => $custom_string_2, 'custom_string_2' => $custom_string_2,
@ -243,8 +249,10 @@ $url = ui_get_url_refresh (array ('offset' => false,
'history_data' => false, 'history_data' => false,
'min_warning' => false, 'min_warning' => false,
'max_warning' => false, 'max_warning' => false,
'str_warning' => false,
'min_critical' => false, 'min_critical' => false,
'max_critical' => false, 'max_critical' => false,
'str_critical' => false,
'ff_event' => false, 'ff_event' => false,
'id_component_type' => false)); 'id_component_type' => false));

View File

@ -50,8 +50,10 @@ if (isset ($id)) {
$max_timeout = $component["max_timeout"]; $max_timeout = $component["max_timeout"];
$min_warning = $component["min_warning"]; $min_warning = $component["min_warning"];
$max_warning = $component["max_warning"]; $max_warning = $component["max_warning"];
$str_warning = $component["str_warning"];
$max_critical = $component["max_critical"]; $max_critical = $component["max_critical"];
$min_critical = $component["min_critical"]; $min_critical = $component["min_critical"];
$str_critical = $component["str_critical"];
$ff_event = $component["min_ff_event"]; $ff_event = $component["min_ff_event"];
$history_data = $component["history_data"]; $history_data = $component["history_data"];
$post_process = $component["post_process"]; $post_process = $component["post_process"];
@ -87,8 +89,10 @@ if (isset ($id)) {
$type = 0; $type = 0;
$min_warning = 0; $min_warning = 0;
$max_warning = 0; $max_warning = 0;
$str_warning = '';
$max_critical = 0; $max_critical = 0;
$min_critical = 0; $min_critical = 0;
$str_critical = '';
$ff_event = 0; $ff_event = 0;
$history_data = true; $history_data = true;
$post_process = 0; $post_process = 0;

View File

@ -75,6 +75,9 @@ $table->data[3][1] .= html_print_input_text ('min_warning', $min_warning,
$table->data[3][1] .= '<br /><em>'.__('Max.').'</em>'; $table->data[3][1] .= '<br /><em>'.__('Max.').'</em>';
$table->data[3][1] .= html_print_input_text ('max_warning', $max_warning, $table->data[3][1] .= html_print_input_text ('max_warning', $max_warning,
'', 5, 15, true); '', 5, 15, true);
$table->data[3][1] .= '<br /><em>'.__('Str.').'</em>';
$table->data[3][1] .= html_print_input_text ('str_warning', $str_warning,
'', 5, 15, true);
$table->data[3][2] = __('Critical status'); $table->data[3][2] = __('Critical status');
$table->data[3][3] = '<em>'.__('Min.').'</em>'; $table->data[3][3] = '<em>'.__('Min.').'</em>';
$table->data[3][3] .= html_print_input_text ('min_critical', $min_critical, $table->data[3][3] .= html_print_input_text ('min_critical', $min_critical,
@ -82,6 +85,9 @@ $table->data[3][3] .= html_print_input_text ('min_critical', $min_critical,
$table->data[3][3] .= '<br /><em>'.__('Max.').'</em>'; $table->data[3][3] .= '<br /><em>'.__('Max.').'</em>';
$table->data[3][3] .= html_print_input_text ('max_critical', $max_critical, $table->data[3][3] .= html_print_input_text ('max_critical', $max_critical,
'', 5, 15, true); '', 5, 15, true);
$table->data[3][3] .= '<br /><em>'.__('Str.').'</em>';
$table->data[3][3] .= html_print_input_text ('str_critical', $str_critical,
'', 5, 15, true);
$table->data[4][0] = __('FF threshold') . ' ' . ui_print_help_icon ('ff_threshold', true); $table->data[4][0] = __('FF threshold') . ' ' . ui_print_help_icon ('ff_threshold', true);
$table->data[4][1] = html_print_input_text ('ff_event', $ff_event, $table->data[4][1] = html_print_input_text ('ff_event', $ff_event,

View File

@ -60,8 +60,8 @@ if ($export_profile) {
SELECT components.name, components.description, components.type, components.max, components.min, components.module_interval, SELECT components.name, components.description, components.type, components.max, components.min, components.module_interval,
components.tcp_port, components.tcp_send, components.tcp_rcv, components.snmp_community, components.snmp_oid, components.tcp_port, components.tcp_send, components.tcp_rcv, components.snmp_community, components.snmp_oid,
components.id_module_group, components.id_modulo, components.plugin_user, components.plugin_pass, components.plugin_parameter, components.id_module_group, components.id_modulo, components.plugin_user, components.plugin_pass, components.plugin_parameter,
components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.min_critical, components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.str_warning, components.min_critical,
components.max_critical, components.min_ff_event, comp_group.name AS group_name components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name
FROM `tnetwork_component` AS components, tnetwork_profile_component AS tpc, tnetwork_component_group AS comp_group FROM `tnetwork_component` AS components, tnetwork_profile_component AS tpc, tnetwork_component_group AS comp_group
WHERE tpc.id_nc = components.id_nc WHERE tpc.id_nc = components.id_nc
AND components.id_group = comp_group.id_sg AND components.id_group = comp_group.id_sg
@ -72,8 +72,8 @@ if ($export_profile) {
SELECT components.name, components.description, components.type, components.max, components.min, components.module_interval, SELECT components.name, components.description, components.type, components.max, components.min, components.module_interval,
components.tcp_port, components.tcp_send, components.tcp_rcv, components.snmp_community, components.snmp_oid, components.tcp_port, components.tcp_send, components.tcp_rcv, components.snmp_community, components.snmp_oid,
components.id_module_group, components.id_modulo, components.plugin_user, components.plugin_pass, components.plugin_parameter, components.id_module_group, components.id_modulo, components.plugin_user, components.plugin_pass, components.plugin_parameter,
components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.min_critical, components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.str_warning, components.min_critical,
components.max_critical, components.min_ff_event, comp_group.name AS group_name components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name
FROM \"tnetwork_component\" AS components, tnetwork_profile_component AS tpc, tnetwork_component_group AS comp_group FROM \"tnetwork_component\" AS components, tnetwork_profile_component AS tpc, tnetwork_component_group AS comp_group
WHERE tpc.id_nc = components.id_nc WHERE tpc.id_nc = components.id_nc
AND components.id_group = comp_group.id_sg AND components.id_group = comp_group.id_sg
@ -84,8 +84,8 @@ if ($export_profile) {
SELECT components.name, components.description, components.type, components.max, components.min, components.module_interval, SELECT components.name, components.description, components.type, components.max, components.min, components.module_interval,
components.tcp_port, components.tcp_send, components.tcp_rcv, components.snmp_community, components.snmp_oid, components.tcp_port, components.tcp_send, components.tcp_rcv, components.snmp_community, components.snmp_oid,
components.id_module_group, components.id_modulo, components.plugin_user, components.plugin_pass, components.plugin_parameter, components.id_module_group, components.id_modulo, components.plugin_user, components.plugin_pass, components.plugin_parameter,
components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.min_critical, components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.str_warning, components.min_critical,
components.max_critical, components.min_ff_event, comp_group.name AS group_name components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name
FROM tnetwork_component AS components, tnetwork_profile_component AS tpc, tnetwork_component_group AS comp_group FROM tnetwork_component AS components, tnetwork_profile_component AS tpc, tnetwork_component_group AS comp_group
WHERE tpc.id_nc = components.id_nc WHERE tpc.id_nc = components.id_nc
AND components.id_group = comp_group.id_sg AND components.id_group = comp_group.id_sg

View File

@ -348,8 +348,10 @@ function get_tree_agents($trash1, $trahs2, $other, $returnType)
'module_history_data' => $module['history_data'], 'module_history_data' => $module['history_data'],
'module_min_warning' => $module['min_warning'], 'module_min_warning' => $module['min_warning'],
'module_max_warning' => $module['max_warning'], 'module_max_warning' => $module['max_warning'],
'module_str_warning' => $module['str_warning'],
'module_min_critical' => $module['min_critical'], 'module_min_critical' => $module['min_critical'],
'module_max_critical' => $module['max_critical'], 'module_max_critical' => $module['max_critical'],
'module_str_critical' => $module['str_critical'],
'module_min_ff_event' => $module['min_ff_event'], 'module_min_ff_event' => $module['min_ff_event'],
'module_delete_pending' => $module['delete_pending'], 'module_delete_pending' => $module['delete_pending'],
'module_id_agent_state' => $module['id_agente_estado'], 'module_id_agent_state' => $module['id_agente_estado'],
@ -533,8 +535,10 @@ function get_tree_agents($trash1, $trahs2, $other, $returnType)
'module_history_data', 'module_history_data',
'module_min_warning', 'module_min_warning',
'module_max_warning', 'module_max_warning',
'module_str_warning',
'module_min_critical', 'module_min_critical',
'module_max_critical', 'module_max_critical',
'module_str_critical',
'module_min_ff_event', 'module_min_ff_event',
'module_delete_pending', 'module_delete_pending',
'module_id_agent_state', 'module_id_agent_state',
@ -706,7 +710,7 @@ function set_delete_agent($id, $thrash1, $thrast2, $thrash3) {
* @param string $id Name of agent to add the module. * @param string $id Name of agent to add the module.
* @param $thrash1 Don't use. * @param $thrash1 Don't use.
* @param array $other it's array, $other as param is <name_module>;<disabled>;<id_module_type>; * @param array $other it's array, $other as param is <name_module>;<disabled>;<id_module_type>;
* <id_module_group>;<min_warning>;<max_warning>;<min_critical>;<max_critical>;<ff_threshold>; * <id_module_group>;<min_warning>;<max_warning>;<str_warning>;<min_critical>;<max_critical>;<str_critical>;<ff_threshold>;
* <history_data>;<ip_target>;<tcp_port>;<snmp_community>;<snmp_oid>;<module_interval>;<post_process>; * <history_data>;<ip_target>;<tcp_port>;<snmp_community>;<snmp_oid>;<module_interval>;<post_process>;
* <min>;<max>;<custom_id>;<description> in this order * <min>;<max>;<custom_id>;<description> in this order
* and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_<separator>) * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_<separator>)
@ -729,20 +733,22 @@ function set_create_network_module($id, $thrash1, $other, $thrash3) {
'id_module_group' => $other['data'][3], 'id_module_group' => $other['data'][3],
'min_warning' => $other['data'][4], 'min_warning' => $other['data'][4],
'max_warning' => $other['data'][5], 'max_warning' => $other['data'][5],
'min_critical' => $other['data'][6], 'str_warning' => $other['data'][6],
'max_critical' => $other['data'][7], 'min_critical' => $other['data'][7],
'min_ff_event' => $other['data'][8], 'max_critical' => $other['data'][8],
'history_data' => $other['data'][9], 'str_critical' => $other['data'][9],
'ip_target' => $other['data'][10], 'min_ff_event' => $other['data'][10],
'tcp_port' => $other['data'][11], 'history_data' => $other['data'][11],
'snmp_community' => $other['data'][12], 'ip_target' => $other['data'][12],
'snmp_oid' => $other['data'][13], 'tcp_port' => $other['data'][13],
'module_interval' => $other['data'][14], 'snmp_community' => $other['data'][14],
'post_process' => $other['data'][15], 'snmp_oid' => $other['data'][15],
'min' => $other['data'][16], 'module_interval' => $other['data'][16],
'max' => $other['data'][17], 'post_process' => $other['data'][17],
'custom_id' => $other['data'][18], 'min' => $other['data'][18],
'descripcion' => $other['data'][19], 'max' => $other['data'][19],
'custom_id' => $other['data'][20],
'descripcion' => $other['data'][21],
); );
$idModule = modules_create_agent_module($idAgent, $name, $values, true); $idModule = modules_create_agent_module($idAgent, $name, $values, true);
@ -1072,15 +1078,23 @@ function set_new_module($id, $id2, $other, $trash1) {
} }
if ($other['data'][10] != '') { if ($other['data'][10] != '') {
$values['min_critical'] = $other['data'][10]; $values['str_warning'] = $other['data'][10];
} }
if ($other['data'][11] != '') { if ($other['data'][11] != '') {
$values['max_critical'] = $other['data'][11]; $values['min_critical'] = $other['data'][11];
} }
if ($other['data'][12] != '') { if ($other['data'][12] != '') {
$values['history_data'] = $other['data'][12]; $values['max_critical'] = $other['data'][12];
}
if ($other['data'][13] != '') {
$values['str_critical'] = $other['data'][13];
}
if ($other['data'][14] != '') {
$values['history_data'] = $other['data'][14];
} }
$values['id_modulo'] = 2; $values['id_modulo'] = 2;

View File

@ -332,8 +332,10 @@ function network_components_create_module_from_network_component ($id_network_co
'history_data', 'history_data',
'min_warning', 'min_warning',
'max_warning', 'max_warning',
'str_warning',
'min_critical', 'min_critical',
'max_critical', 'max_critical',
'str_critical',
'min_ff_event')); 'min_ff_event'));
if (empty ($component)) if (empty ($component))
return false; return false;
@ -392,8 +394,10 @@ function network_components_duplicate_network_component ($id_local_component) {
$networkCopy['history_data'] = $network['history_data']; $networkCopy['history_data'] = $network['history_data'];
$networkCopy['min_warning'] = $network['min_warning']; $networkCopy['min_warning'] = $network['min_warning'];
$networkCopy['max_warning'] = $network['max_warning']; $networkCopy['max_warning'] = $network['max_warning'];
$networkCopy['str_warning'] = $network['str_warning'];
$networkCopy['min_critical'] = $network['min_critical']; $networkCopy['min_critical'] = $network['min_critical'];
$networkCopy['max_critical'] = $network['max_critical']; $networkCopy['max_critical'] = $network['max_critical'];
$networkCopy['str_critical'] = $network['str_critical'];
$networkCopy['min_ff_event'] = $network['min_ff_event']; $networkCopy['min_ff_event'] = $network['min_ff_event'];
return network_components_create_network_component ($name, $network['type'], $network['id_group'], $networkCopy); return network_components_create_network_component ($name, $network['type'], $network['id_group'], $networkCopy);

View File

@ -1313,7 +1313,7 @@ function ui_print_moduletype_icon ($id_moduletype, $return = false) {
* *
* @return string HTML string * @return string HTML string
*/ */
function ui_print_module_warn_value ($max_warning, $min_warning, $max_critical, $min_critical) { function ui_print_module_warn_value ($max_warning, $min_warning, $str_warning, $max_critical, $min_critical, $str_critical) {
$data = "<span style='font-size: 8px' title='" . __("Warning") . ": " . __("Max") . $max_warning . "/" . __("Min") . $min_warning . " - " . __("Critical") . ": " . __("Max") . $max_critical . "/" . __("Min") . $min_critical . "'>"; $data = "<span style='font-size: 8px' title='" . __("Warning") . ": " . __("Max") . $max_warning . "/" . __("Min") . $min_warning . " - " . __("Critical") . ": " . __("Max") . $max_critical . "/" . __("Min") . $min_critical . "'>";
if ($max_warning != $min_warning) { if ($max_warning != $min_warning) {

View File

@ -399,7 +399,7 @@ foreach ($modules as $module) {
} }
} }
$data[6] = ui_print_module_warn_value ($module["max_warning"], $module["min_warning"], $module["max_critical"], $module["min_critical"]); $data[6] = ui_print_module_warn_value ($module["max_warning"], $module["min_warning"], $module["str_warning"], $module["max_critical"], $module["min_critical"], $module["str_critical"]);
$data[7] = $salida; $data[7] = $salida;
$graph_type = return_graphtype ($module["id_tipo_modulo"]); $graph_type = return_graphtype ($module["id_tipo_modulo"]);

View File

@ -262,8 +262,10 @@ switch ($config["dbtype"]) {
tagente_estado.estado, tagente_estado.estado,
tagente_modulo.min_warning, tagente_modulo.min_warning,
tagente_modulo.max_warning, tagente_modulo.max_warning,
tagente_modulo.str_warning,
tagente_modulo.min_critical, tagente_modulo.min_critical,
tagente_modulo.max_critical, tagente_modulo.max_critical,
tagente_modulo.str_critical,
tagente_estado.utimestamp AS utimestamp".$sql." LIMIT ".$offset.",".$config["block_size"]; tagente_estado.utimestamp AS utimestamp".$sql." LIMIT ".$offset.",".$config["block_size"];
break; break;
case "postgresql": case "postgresql":
@ -282,8 +284,10 @@ switch ($config["dbtype"]) {
tagente_estado.estado, tagente_estado.estado,
tagente_modulo.min_warning, tagente_modulo.min_warning,
tagente_modulo.max_warning, tagente_modulo.max_warning,
tagente_modulo.str_warning,
tagente_modulo.min_critical, tagente_modulo.min_critical,
tagente_modulo.max_critical, tagente_modulo.max_critical,
tagente_modulo.str_critical,
tagente_estado.utimestamp AS utimestamp".$sql." LIMIT " . $config["block_size"] . " OFFSET " . $offset; tagente_estado.utimestamp AS utimestamp".$sql." LIMIT " . $config["block_size"] . " OFFSET " . $offset;
break; break;
case "oracle": case "oracle":
@ -304,8 +308,10 @@ switch ($config["dbtype"]) {
tagente_estado.estado, tagente_estado.estado,
tagente_modulo.min_warning, tagente_modulo.min_warning,
tagente_modulo.max_warning, tagente_modulo.max_warning,
tagente_modulo.str_warning,
tagente_modulo.min_critical, tagente_modulo.min_critical,
tagente_modulo.max_critical, tagente_modulo.max_critical,
tagente_modulo.str_critical,
tagente_estado.utimestamp AS utimestamp".$sql; tagente_estado.utimestamp AS utimestamp".$sql;
$sql = oracle_recode_query ($sql, $set); $sql = oracle_recode_query ($sql, $set);
break; break;
@ -469,7 +475,7 @@ foreach ($result as $row) {
$data[6] .= "&nbsp;<a href='index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=".$row["id_agent"]."&amp;tab=data_view&period=86400&amp;id=".$row["id_agente_modulo"]."'>" . html_print_image('images/binary.png', true, array("style" => '0', "alt" => '')) . "</a>"; $data[6] .= "&nbsp;<a href='index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=".$row["id_agent"]."&amp;tab=data_view&period=86400&amp;id=".$row["id_agente_modulo"]."'>" . html_print_image('images/binary.png', true, array("style" => '0', "alt" => '')) . "</a>";
} }
$data[7] = ui_print_module_warn_value($row['max_warning'], $row['min_warning'], $row['max_critical'], $row['min_critical']); $data[7] = ui_print_module_warn_value($row['max_warning'], $row['min_warning'], $row['str_warning'], $row['max_critical'], $row['min_critical'], $row['str_critical']);
if (is_numeric($row["datos"])) if (is_numeric($row["datos"]))
$data[8] = format_numeric($row["datos"]); $data[8] = format_numeric($row["datos"]);

View File

@ -193,8 +193,10 @@ CREATE TABLE tagente_modulo (
history_data NUMBER(5, 0) default 1, history_data NUMBER(5, 0) default 1,
min_warning BINARY_DOUBLE default 0, min_warning BINARY_DOUBLE default 0,
max_warning BINARY_DOUBLE default 0, max_warning BINARY_DOUBLE default 0,
str_warning CLOB default '',
min_critical BINARY_DOUBLE default 0, min_critical BINARY_DOUBLE default 0,
max_critical BINARY_DOUBLE default 0, max_critical BINARY_DOUBLE default 0,
str_critical CLOB default '',
min_ff_event INTEGER default 0, min_ff_event INTEGER default 0,
delete_pending NUMBER(5, 0) default 0 NOT NULL, delete_pending NUMBER(5, 0) default 0 NOT NULL,
policy_linked NUMBER(5, 0) default 0 NOT NULL, policy_linked NUMBER(5, 0) default 0 NOT NULL,
@ -603,8 +605,10 @@ CREATE TABLE tnetwork_component (
history_data NUMBER(5, 0) default 1, history_data NUMBER(5, 0) default 1,
min_warning BINARY_DOUBLE default 0, min_warning BINARY_DOUBLE default 0,
max_warning BINARY_DOUBLE default 0, max_warning BINARY_DOUBLE default 0,
str_warning CLOB default '',
min_critical BINARY_DOUBLE default 0, min_critical BINARY_DOUBLE default 0,
max_critical BINARY_DOUBLE default 0, max_critical BINARY_DOUBLE default 0,
str_critical CLOB default '',
min_ff_event NUMBER(10, 0) default 0, min_ff_event NUMBER(10, 0) default 0,
custom_string_1 CLOB default '', custom_string_1 CLOB default '',
custom_string_2 CLOB default '', custom_string_2 CLOB default '',

View File

@ -179,8 +179,10 @@ CREATE TABLE "tagente_modulo" (
"history_data" SMALLINT default 1, "history_data" SMALLINT default 1,
"min_warning" DOUBLE PRECISION default 0, "min_warning" DOUBLE PRECISION default 0,
"max_warning" DOUBLE PRECISION default 0, "max_warning" DOUBLE PRECISION default 0,
"str_warning" text,
"min_critical" DOUBLE PRECISION default 0, "min_critical" DOUBLE PRECISION default 0,
"max_critical" DOUBLE PRECISION default 0, "max_critical" DOUBLE PRECISION default 0,
"str_critical" text,
"min_ff_event" INTEGER default 0, "min_ff_event" INTEGER default 0,
"delete_pending" SMALLINT NOT NULL default 0, "delete_pending" SMALLINT NOT NULL default 0,
"policy_linked" SMALLINT NOT NULL default 0, "policy_linked" SMALLINT NOT NULL default 0,
@ -484,8 +486,10 @@ CREATE TABLE "tnetwork_component" (
"history_data" SMALLINT default 1, "history_data" SMALLINT default 1,
"min_warning" DOUBLE PRECISION default 0, "min_warning" DOUBLE PRECISION default 0,
"max_warning" DOUBLE PRECISION default 0, "max_warning" DOUBLE PRECISION default 0,
"str_warning" text,
"min_critical" DOUBLE PRECISION default 0, "min_critical" DOUBLE PRECISION default 0,
"max_critical" DOUBLE PRECISION default 0, "max_critical" DOUBLE PRECISION default 0,
"str_critical" text,
"min_ff_event" INTEGER default 0, "min_ff_event" INTEGER default 0,
"custom_string_1" text default '', "custom_string_1" text default '',
"custom_string_2" text default '', "custom_string_2" text default '',

View File

@ -173,8 +173,10 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` (
`history_data` tinyint(1) unsigned default '1', `history_data` tinyint(1) unsigned default '1',
`min_warning` double(18,2) default 0, `min_warning` double(18,2) default 0,
`max_warning` double(18,2) default 0, `max_warning` double(18,2) default 0,
`str_warning` text default '',
`min_critical` double(18,2) default 0, `min_critical` double(18,2) default 0,
`max_critical` double(18,2) default 0, `max_critical` double(18,2) default 0,
`str_critical` text default '',
`min_ff_event` int(4) unsigned default '0', `min_ff_event` int(4) unsigned default '0',
`delete_pending` int(1) unsigned default 0, `delete_pending` int(1) unsigned default 0,
`policy_linked` tinyint(1) unsigned not null default 0, `policy_linked` tinyint(1) unsigned not null default 0,
@ -525,8 +527,10 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` (
`history_data` tinyint(1) unsigned default '1', `history_data` tinyint(1) unsigned default '1',
`min_warning` double(18,2) default 0, `min_warning` double(18,2) default 0,
`max_warning` double(18,2) default 0, `max_warning` double(18,2) default 0,
`str_warning` text default '',
`min_critical` double(18,2) default 0, `min_critical` double(18,2) default 0,
`max_critical` double(18,2) default 0, `max_critical` double(18,2) default 0,
`str_critical` text default '',
`min_ff_event` int(4) unsigned default '0', `min_ff_event` int(4) unsigned default '0',
`custom_string_1` text default '', `custom_string_1` text default '',
`custom_string_2` text default '', `custom_string_2` text default '',