2014-05-25 Junichi Satoh <junichi@rworks.jp>

* godmode/modules/manage_network_components.php,
	godmode/modules/manage_network_components_form.php
	godmode/modules/manage_network_components_form_common.php,
	pandoradb.sql, pandoradb.oracle.sql, pandoradb.postgreSQL.sql,
	extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
	extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
	extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql: Improved
	'FF threshold' to be able to define each state changing for
	network components.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10003 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2014-05-25 07:55:26 +00:00
parent ec13cbfe49
commit e8210d82b8
10 changed files with 115 additions and 26 deletions

View File

@ -1,3 +1,15 @@
2014-05-25 Junichi Satoh <junichi@rworks.jp>
* godmode/modules/manage_network_components.php,
godmode/modules/manage_network_components_form.php
godmode/modules/manage_network_components_form_common.php,
pandoradb.sql, pandoradb.oracle.sql, pandoradb.postgreSQL.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql: Improved
'FF threshold' to be able to define each state changing for
network components.
2014-05-25 Junichi Satoh <junichi@rworks.jp>
* godmode/massive/massive_edit_modules.php: Improved to support

View File

@ -199,3 +199,12 @@ DELETE FROM `tnetwork_profile_component` WHERE `id_np`=4;
DELETE FROM `tnetwork_profile_component` WHERE `id_np`=5;
DELETE FROM `tnetwork_profile_component` WHERE `id_np`=6;
DELETE FROM `tnetwork_profile_component` WHERE `id_nc`=24 AND `id_np`=3;
/* 2014/05/25 */
-- ---------------------------------------------------------------------
-- Table `tnetwork_component`
-- ---------------------------------------------------------------------
ALTER TABLE `tnetwork_component` ADD COLUMN `min_ff_event_normal` int(4) unsigned default '0';
ALTER TABLE `tnetwork_component` ADD COLUMN `min_ff_event_warning` int(4) unsigned default '0';
ALTER TABLE `tnetwork_component` ADD COLUMN `min_ff_event_critical` int(4) unsigned default '0';
ALTER TABLE `tnetwork_component` ADD COLUMN `each_ff` tinyint(1) unsigned default '0';

View File

@ -183,3 +183,12 @@ DELETE FROM tnetwork_profile_component WHERE id_np=4;
DELETE FROM tnetwork_profile_component WHERE id_np=5;
DELETE FROM tnetwork_profile_component WHERE id_np=6;
DELETE FROM tnetwork_profile_component WHERE id_nc=24 AND id_np=3;
/* 2014/05/25 */
-- ---------------------------------------------------------------------
-- Table `tnetwork_component`
-- ---------------------------------------------------------------------
ALTER TABLE tnetwork_component ADD COLUMN min_ff_event_normal INTEGER default 0;
ALTER TABLE tnetwork_component ADD COLUMN min_ff_event_warning INTEGER default 0;
ALTER TABLE tnetwork_component ADD COLUMN min_ff_event_critical INTEGER default 0;
ALTER TABLE tnetwork_component ADD COLUMN each_ff NUMBER(1, 0) default 0;

View File

@ -157,3 +157,12 @@ DELETE FROM "tnetwork_profile_component" WHERE "id_np"=4;
DELETE FROM "tnetwork_profile_component" WHERE "id_np"=5;
DELETE FROM "tnetwork_profile_component" WHERE "id_np"=6;
DELETE FROM "tnetwork_profile_component" WHERE "id_nc"=24 AND "id_np"=3;
/* 2014/05/25 */
-- ---------------------------------------------------------------------
-- Table `tnetwork_component`
-- ---------------------------------------------------------------------
ALTER TABLE "tnetwork_component" ADD COLUMN "min_ff_event_normal" INTEGER default 0;
ALTER TABLE "tnetwork_component" ADD COLUMN "min_ff_event_warning" INTEGER default 0;
ALTER TABLE "tnetwork_component" ADD COLUMN "min_ff_event_critical" INTEGER default 0;
ALTER TABLE "tnetwork_component" ADD COLUMN "each_ff" SMALLINT default 0;

View File

@ -97,6 +97,10 @@ $warning_inverse = (int) get_parameter('warning_inverse');
$id_category = (int) get_parameter('id_category');
$id_tag_selected = (array) get_parameter('id_tag_selected');
$pure = get_parameter('pure', 0);
$ff_event_normal = (int) get_parameter ('ff_event_normal');
$ff_event_warning = (int) get_parameter ('ff_event_warning');
$ff_event_critical = (int) get_parameter ('ff_event_critical');
$each_ff = (int) get_parameter ('each_ff');
if (count($id_tag_selected) == 1 && empty($id_tag_selected[0])) {
$tags = '';
@ -214,7 +218,11 @@ if ($create_component) {
'warning_inverse' => $warning_inverse,
'id_category' => $id_category,
'tags' => $tags,
'disabled_types_event' => $disabled_types_event));
'disabled_types_event' => $disabled_types_event,
'min_ff_event_normal' => $ff_event_normal,
'min_ff_event_warning' => $ff_event_warning,
'min_ff_event_critical' => $ff_event_critical,
'each_ff' => $each_ff));
}
else {
$id = '';
@ -296,7 +304,11 @@ if ($update_component) {
'warning_inverse' => $warning_inverse,
'id_category' => $id_category,
'tags' => $tags,
'disabled_types_event' => $disabled_types_event));
'disabled_types_event' => $disabled_types_event,
'min_ff_event_normal' => $ff_event_normal,
'min_ff_event_warning' => $ff_event_warning,
'min_ff_event_critical' => $ff_event_critical,
'each_ff' => $each_ff));
}
else {
$result = '';
@ -413,7 +425,11 @@ $url = ui_get_url_refresh (array ('offset' => false,
'critical_inverse' => false,
'warning_inverse' => false,
'id_category' => false,
'tags' => false));
'tags' => false,
'ff_event_normal' => false,
'ff_event_warning' => false,
'ff_event_critical' => false,
'each_ff' => false));
$search_id_group = (int) get_parameter ('search_id_group');

View File

@ -70,6 +70,10 @@ if ($create_network_from_module) {
$critical_inverse = $data_module["critical_inverse"];
$warning_inverse = $data_module["warning_inverse"];
$id_category = $data_module["id_category"];
$ff_event_normal = $data_module["min_ff_event_normal"];
$ff_event_warning = $data_module["min_ff_event_warning"];
$ff_event_critical = $data_module["min_ff_event_critical"];
$each_ff = $data_module["each_ff"];
}
$id_component_type = (int) get_parameter ('id_component_type');
@ -120,6 +124,10 @@ if (isset ($id)) {
$warning_inverse = $component["warning_inverse"];
$id_category = $component["id_category"];
$tags = $component["tags"];
$ff_event_normal = $component["min_ff_event_normal"];
$ff_event_warning = $component["min_ff_event_warning"];
$ff_event_critical = $component["min_ff_event_critical"];
$each_ff = $component["each_ff"];
if ($type >= 15 && $type <= 18) {
// New support for snmp v3
@ -168,6 +176,10 @@ if (isset ($id)) {
$warning_inverse = 0;
$id_category = 0;
$tags = '';
$ff_event_normal = 0;
$ff_event_warning = 0;
$ff_event_critical = 0;
$each_ff = 0;
$snmp_version = 1;
$snmp3_auth_user = '';

View File

@ -130,35 +130,45 @@ $table->data[3][3] .= '<br /><em>'.__('Inverse interval').'</em>';
$table->data[3][3] .= html_print_checkbox ("critical_inverse", 1, $critical_inverse, 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,
'', 5, 15, true);
$table->data[4][2] = __('Historical data');
$table->data[4][3] = html_print_checkbox ("history_data", 1, $history_data, true);
$table->colspan[4][1] = 3;
$table->data[4][1] = html_print_radio_button ('each_ff', 0, '', $each_ff, true) . ' ' . __('All state changing') . ' : ';
$table->data[4][1] .= html_print_input_text ('ff_event', $ff_event,
'', 5, 15, true) . '<br />';
$table->data[4][1] .= html_print_radio_button ('each_ff', 1, '', $each_ff, true) . ' ' . __('Each state changing') . ' : ';
$table->data[4][1] .= __('To normal');
$table->data[4][1] .= html_print_input_text ('ff_event_normal', $ff_event_normal, '', 5, 15, true, $disabledBecauseInPolicy) . ' ';
$table->data[4][1] .= __('To warning');
$table->data[4][1] .= html_print_input_text ('ff_event_warning', $ff_event_warning, '', 5, 15, true, $disabledBecauseInPolicy) . ' ';
$table->data[4][1] .= __('To critical');
$table->data[4][1] .= html_print_input_text ('ff_event_critical', $ff_event_critical, '', 5, 15, true, $disabledBecauseInPolicy);
$table->data[5][0] = __('Min. Value');
$table->data[5][1] = html_print_input_text ('min', $min, '', 5, 15, true). ' ' . ui_print_help_tip (__('Any value below this number is discarted'), true);
$table->data[5][2] = __('Max. Value');
$table->data[5][3] = html_print_input_text ('max', $max, '', 5, 15, true) . ' ' . ui_print_help_tip (__('Any value over this number is discarted'), true);
$table->data[6][0] = __('Unit');
$table->data[6][1] = html_print_input_text ('unit', $unit, '', 12, 25, true);
$table->data[5][0] = __('Historical data');
$table->data[5][1] = html_print_checkbox ("history_data", 1, $history_data, true);
$table->data[6][2] = __('Throw unknown events');
$table->data[6][3] = html_print_checkbox('throw_unknown_events', 1,
$table->data[6][0] = __('Min. Value');
$table->data[6][1] = html_print_input_text ('min', $min, '', 5, 15, true). ' ' . ui_print_help_tip (__('Any value below this number is discarted'), true);
$table->data[6][2] = __('Max. Value');
$table->data[6][3] = html_print_input_text ('max', $max, '', 5, 15, true) . ' ' . ui_print_help_tip (__('Any value over this number is discarted'), true);
$table->data[7][0] = __('Unit');
$table->data[7][1] = html_print_input_text ('unit', $unit, '', 12, 25, true);
$table->data[7][2] = __('Throw unknown events');
$table->data[7][3] = html_print_checkbox('throw_unknown_events', 1,
!network_components_is_disable_type_event($id, EVENTS_GOING_UNKNOWN), true);
$table->data[7][0] = __('Critical instructions'). ui_print_help_tip(__("Instructions when the status is critical"), true);
$table->data[7][1] = html_print_textarea ('critical_instructions', 2, 65, $critical_instructions, '', true);
$table->colspan[7][1] = 3;
$table->data[8][0] = __('Warning instructions'). ui_print_help_tip(__("Instructions when the status is warning"), true);
$table->data[8][1] = html_print_textarea ('warning_instructions', 2, 65, $warning_instructions, '', true);
$table->data[8][0] = __('Critical instructions'). ui_print_help_tip(__("Instructions when the status is critical"), true);
$table->data[8][1] = html_print_textarea ('critical_instructions', 2, 65, $critical_instructions, '', true);
$table->colspan[8][1] = 3;
$table->data[9][0] = __('Unknown instructions'). ui_print_help_tip(__("Instructions when the status is unknown"), true);
$table->data[9][1] = html_print_textarea ('unknown_instructions', 2, 65, $unknown_instructions, '', true);
$table->data[9][0] = __('Warning instructions'). ui_print_help_tip(__("Instructions when the status is warning"), true);
$table->data[9][1] = html_print_textarea ('warning_instructions', 2, 65, $warning_instructions, '', true);
$table->colspan[9][1] = 3;
$next_row = 10;
$table->data[10][0] = __('Unknown instructions'). ui_print_help_tip(__("Instructions when the status is unknown"), true);
$table->data[10][1] = html_print_textarea ('unknown_instructions', 2, 65, $unknown_instructions, '', true);
$table->colspan[10][1] = 3;
$next_row = 11;
if (check_acl ($config['id_user'], 0, "PM")) {
$table->data[$next_row][0] = __('Category');
@ -168,7 +178,7 @@ if (check_acl ($config['id_user'], 0, "PM")) {
}
else {
// Store in a hidden field if is not visible to avoid delete the value
$table->data[9][1] .= html_print_input_hidden ('id_category', $id_category, true);
$table->data[10][1] .= html_print_input_hidden ('id_category', $id_category, true);
}
$table->data[$next_row][0] = __('Tags');

View File

@ -770,6 +770,10 @@ CREATE TABLE tnetwork_component (
tags CLOB,
disabled_types_event CLOB default '',
module_macros CLOB default '',
min_ff_event_normal INTEGER default 0,
min_ff_event_warning INTEGER default 0,
min_ff_event_critical INTEGER default 0,
each_ff NUMBER(1, 0) default 0,
CONSTRAINT t_network_component_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','nowizard'))
);

View File

@ -660,7 +660,11 @@ CREATE TABLE "tnetwork_component" (
"id_category" INTEGER NOT NULL default 0,
"tags" text NOT NULL,
"disabled_types_event" TEXT default '',
"module_macros" TEXT default ''
"module_macros" TEXT default '',
"min_ff_event_normal" INTEGER default 0,
"min_ff_event_warning" INTEGER default 0,
"min_ff_event_critical" INTEGER default 0,
"each_ff" SMALLINT default 0
);
-- ---------------------------------------------------------------------

View File

@ -718,6 +718,10 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` (
`tags` text NOT NULL,
`disabled_types_event` TEXT NOT NULL,
`module_macros` TEXT NOT NULL,
`min_ff_event_normal` int(4) unsigned default '0',
`min_ff_event_warning` int(4) unsigned default '0',
`min_ff_event_critical` int(4) unsigned default '0',
`each_ff` tinyint(1) unsigned default '0',
PRIMARY KEY (`id_nc`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;