Remove alert.macros from db schema again. (#8460)

Only affects new installs.
Leave dynamic config settings.
This commit is contained in:
Tony Murray
2018-03-23 13:56:27 -05:00
committed by Neil Lathwood
parent 7ed7885ca7
commit 94f5ed67c5
5 changed files with 1 additions and 28 deletions

View File

@@ -1,8 +1,6 @@
DROP TABLE IF EXISTS `component_statuslog`;
CREATE TABLE `component_statuslog` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID for each log entry, unique index', `component_id` int(11) unsigned NOT NULL COMMENT 'id from the component table', `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'The status that the component was changed TO', `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'When the status of the component was changed', PRIMARY KEY (`id`), KEY `device` (`component_id`), CONSTRAINT `component_statuslog_ibfk_1` FOREIGN KEY (`component_id`) REFERENCES `component` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='log of status changes to a component.';
ALTER TABLE `component` CHANGE `status` `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT 'The status of the component, retreived from the device';
UPDATE `config` SET `config_name`='alert.macros.rule.component_warning',`config_descr`='Component status Warning' WHERE `config_name`='alert.macros.rule.component_normal';
UPDATE `config` SET `config_name`='alert.macros.rule.component_normal',`config_descr`='Component status Normal' WHERE `config_name`='alert.macros.rule.component_alert';
UPDATE component SET status=2 WHERE status=0;
UPDATE component SET status=0 WHERE status=1;
INSERT INTO `widgets` (`widget_title`,`widget`,`base_dimensions`) VALUES ('Component Status','component-status','3,2');

View File

@@ -1,4 +0,0 @@
UPDATE `config` SET `config_value`='((%ports.ifInOctets_rate*8) / %ports.ifSpeed)*100', `config_default`='((%ports.ifInOctets_rate*8) / %ports.ifSpeed)*100' WHERE `config_name`='alert.macros.rule.port_in_usage_perc';
UPDATE `config` SET `config_value`='((%ports.ifOutOctets_rate*8) / %ports.ifSpeed)*100', `config_default`='((%ports.ifOutOctets_rate*8) / %ports.ifSpeed)*100' WHERE `config_name`='alert.macros.rule.port_out_usage_perc';
UPDATE `config` SET `config_value`='((%bills.total_data / %bills.bill_quota)*100) && %bills.bill_type = "quota"', `config_default`='((%bills.total_data / %bills.bill_quota)*100) && %bills.bill_type = "quota"' WHERE `config_name`='alert.macros.rule.bill_quota_over_quota';
UPDATE `config` SET `config_value`='((%bills.rate_95th / %bills.bill_cdr)*100) && %bills.bill_type = "cdr"', `config_default`='((%bills.rate_95th / %bills.bill_cdr)*100) && %bills.bill_type = "cdr"' WHERE `config_name`='alert.macros.rule.bill_cdr_over_quota';

View File

@@ -1,2 +0,0 @@
UPDATE `config` SET `config_value` = '%sensors.sensor_class = "state" && %sensors.sensor_current != "6" && %sensors.sensor_type = "jnxFruState" && %sensors.sensor_current != "2" && %sensors.sensor_alert = "1"', `config_default` = '%sensors.sensor_class = "state" && %sensors.sensor_current != "6" && %sensors.sensor_type = "jnxFruState" && %sensors.sensor_current != "2" && %sensors.sensor_alert = "1"' WHERE `config`.`config_name` = 'alert.macros.rule.device_component_down_junos';
UPDATE `config` SET `config_value` = '%sensors.sensor_current != "1" && %sensors.sensor_current != "5" && %sensors.sensor_type ~ "^cisco.*State$" && %sensors.sensor_alert = "1"', `config_default` = '%sensors.sensor_current != "1" && %sensors.sensor_current != "5" && %sensors.sensor_type ~ "^cisco.*State$" && %sensors.sensor_alert = "1"' WHERE `config`.`config_name` = 'alert.macros.rule.device_component_down_cisco';

View File

@@ -1,5 +1,4 @@
UPDATE `sensors` SET `entPhysicalIndex_measured` = 'ports', `entPhysicalIndex` = entity_link_index WHERE entity_link_type='port';
UPDATE `config` SET `config_value` = "(%sensors.entPhysicalIndex_measured = 'ports' && %sensors.entPhysicalIndex = %ports.ifIndex && %macros.port_up)", `config_default` = "(%sensors.entPhysicalIndex_measured = 'ports' && %sensors.entPhysicalIndex = %ports.ifIndex && %macros.port_up)" WHERE `config_name` = 'alert.macros.rule.sensor_port_link';
UPDATE `alert_rules` SET `query` = REPLACE(query, 'entity_link_type', 'entPhysicalIndex_measured');
UPDATE `alert_rules` SET `query` = REPLACE(query, 'entity_link_index', 'entPhysicalIndex');
UPDATE `alert_rules` SET `rule` = REPLACE(rule, 'entity_link_type', 'entPhysicalIndex_measured');

File diff suppressed because one or more lines are too long