Skip to content

Commit

Permalink
Add require_attention to all alert families on CH
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Nov 11, 2024
1 parent 6f9d069 commit 12407d6
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions httpdocs/misc/db_schema_clickhouse.sql
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,13 @@ CREATE TABLE IF NOT EXISTS `active_monitoring_alerts` (
`json` String,
`user_label` String,
`user_label_tstamp` DateTime NULL,
`alert_category` UInt8
`alert_category` UInt8,
`require_attention` Boolean
) ENGINE = MergeTree() PARTITION BY toYYYYMMDD(tstamp) ORDER BY (tstamp);
@
ALTER TABLE `active_monitoring_alerts` ADD COLUMN IF NOT EXISTS alert_category UInt8;
@
ALTER TABLE `active_monitoring_alerts` ADD COLUMN IF NOT EXISTS require_attention Boolean;

@

Expand Down Expand Up @@ -383,10 +386,13 @@ CREATE TABLE IF NOT EXISTS `mac_alerts` (
`json` String,
`user_label` String,
`user_label_tstamp` DateTime,
`alert_category` UInt8
`alert_category` UInt8,
`require_attention` Boolean
) ENGINE = MergeTree() PARTITION BY toYYYYMMDD(tstamp) ORDER BY (tstamp);
@
ALTER TABLE `mac_alerts` ADD COLUMN IF NOT EXISTS alert_category UInt8;
@
ALTER TABLE `mac_alerts` ADD COLUMN IF NOT EXISTS require_attention Boolean;

@

Expand All @@ -409,12 +415,15 @@ CREATE TABLE IF NOT EXISTS `snmp_alerts` (
`json` String,
`user_label` String,
`user_label_tstamp` DateTime,
`alert_category` UInt8
`alert_category` UInt8,
`require_attention` Boolean
) ENGINE = MergeTree() PARTITION BY toYYYYMMDD(tstamp) ORDER BY (tstamp);
@
ALTER TABLE `snmp_alerts` MODIFY COLUMN `port` UInt32;
@
ALTER TABLE `snmp_alerts` ADD COLUMN IF NOT EXISTS alert_category UInt8;
@
ALTER TABLE `snmp_alerts` ADD COLUMN IF NOT EXISTS require_attention Boolean;

@

Expand All @@ -436,10 +445,13 @@ CREATE TABLE IF NOT EXISTS `network_alerts` (
`json` String,
`user_label` String,
`user_label_tstamp` DateTime,
`alert_category` UInt8
`alert_category` UInt8,
`require_attention` Boolean
) ENGINE = MergeTree() PARTITION BY toYYYYMMDD(tstamp) ORDER BY (tstamp);
@
ALTER TABLE `network_alerts` ADD COLUMN IF NOT EXISTS alert_category UInt8;
@
ALTER TABLE `network_alerts` ADD COLUMN IF NOT EXISTS require_attention Boolean;

@

Expand All @@ -462,10 +474,13 @@ CREATE TABLE IF NOT EXISTS `interface_alerts` (
`json` String,
`user_label` String,
`user_label_tstamp` DateTime,
`alert_category` UInt8
`alert_category` UInt8,
`require_attention` Boolean
) ENGINE = MergeTree() PARTITION BY toYYYYMMDD(tstamp) ORDER BY (tstamp);
@
ALTER TABLE `interface_alerts` ADD COLUMN IF NOT EXISTS alert_category UInt8;
@
ALTER TABLE `interface_alerts` ADD COLUMN IF NOT EXISTS require_attention Boolean;

@

Expand All @@ -485,10 +500,13 @@ CREATE TABLE IF NOT EXISTS `user_alerts` (
`json` String,
`user_label` String,
`user_label_tstamp` DateTime,
`alert_category` UInt8
`alert_category` UInt8,
`require_attention` Boolean
) ENGINE = MergeTree() PARTITION BY toYYYYMMDD(tstamp) ORDER BY (tstamp);
@
ALTER TABLE `user_alerts` ADD COLUMN IF NOT EXISTS alert_category UInt8;
@
ALTER TABLE `user_alerts` ADD COLUMN IF NOT EXISTS require_attention Boolean;

@

Expand All @@ -508,12 +526,16 @@ CREATE TABLE IF NOT EXISTS `system_alerts` (
`json` String,
`user_label` String,
`user_label_tstamp` DateTime,
`alert_category` UInt8
`alert_category` UInt8,
`require_attention` Boolean
) ENGINE = MergeTree() PARTITION BY toYYYYMMDD(tstamp) ORDER BY (tstamp);
@
ALTER TABLE `system_alerts` ADD COLUMN IF NOT EXISTS alert_category UInt8;
@
ALTER TABLE `system_alerts` ADD COLUMN IF NOT EXISTS require_attention Boolean;

@

DROP VIEW IF EXISTS `all_alerts_view`;
@
CREATE VIEW IF NOT EXISTS `all_alerts_view` AS
Expand Down

0 comments on commit 12407d6

Please sign in to comment.