diff options
author | Simon Rettberg | 2022-09-12 09:58:19 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-09-12 09:58:19 +0200 |
commit | caa63fb08ec97f660487286ec878d991a475dd90 (patch) | |
tree | a8ac11246e5a471aba7307c1fc4a395ea162a1d8 /modules-available/eventlog/install.inc.php | |
parent | [eventlog] Add nic speed and duplex to filtering options (diff) | |
download | slx-admin-caa63fb08ec97f660487286ec878d991a475dd90.tar.gz slx-admin-caa63fb08ec97f660487286ec878d991a475dd90.tar.xz slx-admin-caa63fb08ec97f660487286ec878d991a475dd90.zip |
[eventlog] Add machine data to collected notification samples
Diffstat (limited to 'modules-available/eventlog/install.inc.php')
-rw-r--r-- | modules-available/eventlog/install.inc.php | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/modules-available/eventlog/install.inc.php b/modules-available/eventlog/install.inc.php index f6057d23..def608aa 100644 --- a/modules-available/eventlog/install.inc.php +++ b/modules-available/eventlog/install.inc.php @@ -41,12 +41,16 @@ $res[] = tableCreate('notification_rule_x_transport', ' KEY (`transportid`) '); -$res[] = tableCreate('notification_sample', ' - `type` varchar(40) CHARACTER SET ascii NOT NULL, +$res[] = tableCreate('notification_sample', " + `sampleid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `dateline` int(10) UNSIGNED NOT NULL, + `extended` tinyint(1) NOT NULL DEFAULT '0', + `type` varchar(40) CHARACTER SET ascii NOT NULL, `data` mediumblob, - KEY (`type`, `dateline`) -'); + KEY (`type`, `dateline`), + KEY (`extended`), + PRIMARY KEY (`sampleid`) +"); // Update path @@ -63,6 +67,18 @@ $res[] = tableAddConstraint('notification_rule_x_transport', 'ruleid', $res[] = tableAddConstraint('notification_rule_x_transport', 'transportid', 'notification_backend', 'transportid', 'ON UPDATE CASCADE ON DELETE CASCADE'); +// 2022-07-20: Add flag to see if notification_sample has been extended +if (!tableHasColumn('notification_sample', 'extended')) { + if (Database::exec("ALTER TABLE notification_sample + ADD COLUMN `extended` tinyint(1) NOT NULL DEFAULT '0', + ADD KEY (`extended`), + ADD COLUMN `sampleid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + ADD PRIMARY KEY (`sampleid`)") === false) { + finalResponse(UPDATE_FAILED, 'Could not add extended flag to notification_sample: ' . Database::lastError()); + } + $res[] = UPDATE_DONE; +} + // Create response for browser if (in_array(UPDATE_DONE, $res)) { |