fix: correct syntax errors and refactor interval parsing
This commit is contained in:
@@ -86,8 +86,6 @@ CREATE TABLE hosts (
|
|||||||
vendor_version varchar(32) DEFAULT '' NOT NULL,
|
vendor_version varchar(32) DEFAULT '' NOT NULL,
|
||||||
proxy_groupid bigint NULL,
|
proxy_groupid bigint NULL,
|
||||||
monitored_by integer DEFAULT '0' NOT NULL,
|
monitored_by integer DEFAULT '0' NOT NULL,
|
||||||
wizard_ready integer DEFAULT '0' NOT NULL,
|
|
||||||
readme text DEFAULT '' NOT NULL,
|
|
||||||
PRIMARY KEY (hostid)
|
PRIMARY KEY (hostid)
|
||||||
);
|
);
|
||||||
CREATE INDEX hosts_1 ON hosts (host);
|
CREATE INDEX hosts_1 ON hosts (host);
|
||||||
@@ -362,20 +360,6 @@ CREATE TABLE media_type (
|
|||||||
PRIMARY KEY (mediatypeid)
|
PRIMARY KEY (mediatypeid)
|
||||||
);
|
);
|
||||||
CREATE UNIQUE INDEX media_type_1 ON media_type (name);
|
CREATE UNIQUE INDEX media_type_1 ON media_type (name);
|
||||||
CREATE TABLE media_type_oauth (
|
|
||||||
mediatypeid bigint NOT NULL,
|
|
||||||
redirection_url varchar(2048) DEFAULT '' NOT NULL,
|
|
||||||
client_id varchar(255) DEFAULT '' NOT NULL,
|
|
||||||
client_secret varchar(255) DEFAULT '' NOT NULL,
|
|
||||||
authorization_url varchar(2048) DEFAULT '' NOT NULL,
|
|
||||||
tokens_status integer DEFAULT '0' NOT NULL,
|
|
||||||
access_token text DEFAULT '' NOT NULL,
|
|
||||||
access_token_updated integer DEFAULT '0' NOT NULL,
|
|
||||||
access_expires_in integer DEFAULT '0' NOT NULL,
|
|
||||||
refresh_token text DEFAULT '' NOT NULL,
|
|
||||||
token_url varchar(2048) DEFAULT '' NOT NULL,
|
|
||||||
PRIMARY KEY (mediatypeid)
|
|
||||||
);
|
|
||||||
CREATE TABLE media_type_param (
|
CREATE TABLE media_type_param (
|
||||||
mediatype_paramid bigint NOT NULL,
|
mediatype_paramid bigint NOT NULL,
|
||||||
mediatypeid bigint NOT NULL,
|
mediatypeid bigint NOT NULL,
|
||||||
@@ -586,6 +570,132 @@ CREATE TABLE conditions (
|
|||||||
PRIMARY KEY (conditionid)
|
PRIMARY KEY (conditionid)
|
||||||
);
|
);
|
||||||
CREATE INDEX conditions_1 ON conditions (actionid);
|
CREATE INDEX conditions_1 ON conditions (actionid);
|
||||||
|
CREATE TABLE config (
|
||||||
|
configid bigint NOT NULL,
|
||||||
|
work_period varchar(255) DEFAULT '1-5,09:00-18:00' NOT NULL,
|
||||||
|
alert_usrgrpid bigint NULL,
|
||||||
|
default_theme varchar(128) DEFAULT 'blue-theme' NOT NULL,
|
||||||
|
authentication_type integer DEFAULT '0' NOT NULL,
|
||||||
|
discovery_groupid bigint NULL,
|
||||||
|
max_in_table integer DEFAULT '50' NOT NULL,
|
||||||
|
search_limit integer DEFAULT '1000' NOT NULL,
|
||||||
|
severity_color_0 varchar(6) DEFAULT '97AAB3' NOT NULL,
|
||||||
|
severity_color_1 varchar(6) DEFAULT '7499FF' NOT NULL,
|
||||||
|
severity_color_2 varchar(6) DEFAULT 'FFC859' NOT NULL,
|
||||||
|
severity_color_3 varchar(6) DEFAULT 'FFA059' NOT NULL,
|
||||||
|
severity_color_4 varchar(6) DEFAULT 'E97659' NOT NULL,
|
||||||
|
severity_color_5 varchar(6) DEFAULT 'E45959' NOT NULL,
|
||||||
|
severity_name_0 varchar(32) DEFAULT 'Not classified' NOT NULL,
|
||||||
|
severity_name_1 varchar(32) DEFAULT 'Information' NOT NULL,
|
||||||
|
severity_name_2 varchar(32) DEFAULT 'Warning' NOT NULL,
|
||||||
|
severity_name_3 varchar(32) DEFAULT 'Average' NOT NULL,
|
||||||
|
severity_name_4 varchar(32) DEFAULT 'High' NOT NULL,
|
||||||
|
severity_name_5 varchar(32) DEFAULT 'Disaster' NOT NULL,
|
||||||
|
ok_period varchar(32) DEFAULT '5m' NOT NULL,
|
||||||
|
blink_period varchar(32) DEFAULT '2m' NOT NULL,
|
||||||
|
problem_unack_color varchar(6) DEFAULT 'CC0000' NOT NULL,
|
||||||
|
problem_ack_color varchar(6) DEFAULT 'CC0000' NOT NULL,
|
||||||
|
ok_unack_color varchar(6) DEFAULT '009900' NOT NULL,
|
||||||
|
ok_ack_color varchar(6) DEFAULT '009900' NOT NULL,
|
||||||
|
problem_unack_style integer DEFAULT '1' NOT NULL,
|
||||||
|
problem_ack_style integer DEFAULT '1' NOT NULL,
|
||||||
|
ok_unack_style integer DEFAULT '1' NOT NULL,
|
||||||
|
ok_ack_style integer DEFAULT '1' NOT NULL,
|
||||||
|
snmptrap_logging integer DEFAULT '1' NOT NULL,
|
||||||
|
server_check_interval integer DEFAULT '10' NOT NULL,
|
||||||
|
hk_events_mode integer DEFAULT '1' NOT NULL,
|
||||||
|
hk_events_trigger varchar(32) DEFAULT '365d' NOT NULL,
|
||||||
|
hk_events_internal varchar(32) DEFAULT '1d' NOT NULL,
|
||||||
|
hk_events_discovery varchar(32) DEFAULT '1d' NOT NULL,
|
||||||
|
hk_events_autoreg varchar(32) DEFAULT '1d' NOT NULL,
|
||||||
|
hk_services_mode integer DEFAULT '1' NOT NULL,
|
||||||
|
hk_services varchar(32) DEFAULT '365d' NOT NULL,
|
||||||
|
hk_audit_mode integer DEFAULT '1' NOT NULL,
|
||||||
|
hk_audit varchar(32) DEFAULT '31d' NOT NULL,
|
||||||
|
hk_sessions_mode integer DEFAULT '1' NOT NULL,
|
||||||
|
hk_sessions varchar(32) DEFAULT '365d' NOT NULL,
|
||||||
|
hk_history_mode integer DEFAULT '1' NOT NULL,
|
||||||
|
hk_history_global integer DEFAULT '0' NOT NULL,
|
||||||
|
hk_history varchar(32) DEFAULT '31d' NOT NULL,
|
||||||
|
hk_trends_mode integer DEFAULT '1' NOT NULL,
|
||||||
|
hk_trends_global integer DEFAULT '0' NOT NULL,
|
||||||
|
hk_trends varchar(32) DEFAULT '365d' NOT NULL,
|
||||||
|
default_inventory_mode integer DEFAULT '-1' NOT NULL,
|
||||||
|
custom_color integer DEFAULT '0' NOT NULL,
|
||||||
|
http_auth_enabled integer DEFAULT '0' NOT NULL,
|
||||||
|
http_login_form integer DEFAULT '0' NOT NULL,
|
||||||
|
http_strip_domains varchar(2048) DEFAULT '' NOT NULL,
|
||||||
|
http_case_sensitive integer DEFAULT '1' NOT NULL,
|
||||||
|
ldap_auth_enabled integer DEFAULT '0' NOT NULL,
|
||||||
|
ldap_case_sensitive integer DEFAULT '1' NOT NULL,
|
||||||
|
db_extension varchar(32) DEFAULT '' NOT NULL,
|
||||||
|
autoreg_tls_accept integer DEFAULT '1' NOT NULL,
|
||||||
|
compression_status integer DEFAULT '0' NOT NULL,
|
||||||
|
compress_older varchar(32) DEFAULT '7d' NOT NULL,
|
||||||
|
instanceid varchar(32) DEFAULT '' NOT NULL,
|
||||||
|
saml_auth_enabled integer DEFAULT '0' NOT NULL,
|
||||||
|
saml_case_sensitive integer DEFAULT '0' NOT NULL,
|
||||||
|
default_lang varchar(5) DEFAULT 'en_US' NOT NULL,
|
||||||
|
default_timezone varchar(50) DEFAULT 'system' NOT NULL,
|
||||||
|
login_attempts integer DEFAULT '5' NOT NULL,
|
||||||
|
login_block varchar(32) DEFAULT '30s' NOT NULL,
|
||||||
|
show_technical_errors integer DEFAULT '0' NOT NULL,
|
||||||
|
validate_uri_schemes integer DEFAULT '1' NOT NULL,
|
||||||
|
uri_valid_schemes varchar(255) DEFAULT 'http,https,ftp,file,mailto,tel,ssh' NOT NULL,
|
||||||
|
x_frame_options varchar(255) DEFAULT 'SAMEORIGIN' NOT NULL,
|
||||||
|
iframe_sandboxing_enabled integer DEFAULT '1' NOT NULL,
|
||||||
|
iframe_sandboxing_exceptions varchar(255) DEFAULT '' NOT NULL,
|
||||||
|
max_overview_table_size integer DEFAULT '50' NOT NULL,
|
||||||
|
history_period varchar(32) DEFAULT '24h' NOT NULL,
|
||||||
|
period_default varchar(32) DEFAULT '1h' NOT NULL,
|
||||||
|
max_period varchar(32) DEFAULT '2y' NOT NULL,
|
||||||
|
socket_timeout varchar(32) DEFAULT '3s' NOT NULL,
|
||||||
|
connect_timeout varchar(32) DEFAULT '3s' NOT NULL,
|
||||||
|
media_type_test_timeout varchar(32) DEFAULT '65s' NOT NULL,
|
||||||
|
script_timeout varchar(32) DEFAULT '60s' NOT NULL,
|
||||||
|
item_test_timeout varchar(32) DEFAULT '60s' NOT NULL,
|
||||||
|
session_key varchar(32) DEFAULT '' NOT NULL,
|
||||||
|
url varchar(2048) DEFAULT '' NOT NULL,
|
||||||
|
report_test_timeout varchar(32) DEFAULT '60s' NOT NULL,
|
||||||
|
dbversion_status text DEFAULT '' NOT NULL,
|
||||||
|
hk_events_service varchar(32) DEFAULT '1d' NOT NULL,
|
||||||
|
passwd_min_length integer DEFAULT '8' NOT NULL,
|
||||||
|
passwd_check_rules integer DEFAULT '8' NOT NULL,
|
||||||
|
auditlog_enabled integer DEFAULT '1' NOT NULL,
|
||||||
|
ha_failover_delay varchar(32) DEFAULT '1m' NOT NULL,
|
||||||
|
geomaps_tile_provider varchar(255) DEFAULT '' NOT NULL,
|
||||||
|
geomaps_tile_url varchar(2048) DEFAULT '' NOT NULL,
|
||||||
|
geomaps_max_zoom integer DEFAULT '0' NOT NULL,
|
||||||
|
geomaps_attribution varchar(1024) DEFAULT '' NOT NULL,
|
||||||
|
vault_provider integer DEFAULT '0' NOT NULL,
|
||||||
|
ldap_userdirectoryid bigint DEFAULT NULL NULL,
|
||||||
|
server_status text DEFAULT '' NOT NULL,
|
||||||
|
jit_provision_interval varchar(32) DEFAULT '1h' NOT NULL,
|
||||||
|
saml_jit_status integer DEFAULT '0' NOT NULL,
|
||||||
|
ldap_jit_status integer DEFAULT '0' NOT NULL,
|
||||||
|
disabled_usrgrpid bigint DEFAULT NULL NULL,
|
||||||
|
timeout_zabbix_agent varchar(255) DEFAULT '3s' NOT NULL,
|
||||||
|
timeout_simple_check varchar(255) DEFAULT '3s' NOT NULL,
|
||||||
|
timeout_snmp_agent varchar(255) DEFAULT '3s' NOT NULL,
|
||||||
|
timeout_external_check varchar(255) DEFAULT '3s' NOT NULL,
|
||||||
|
timeout_db_monitor varchar(255) DEFAULT '3s' NOT NULL,
|
||||||
|
timeout_http_agent varchar(255) DEFAULT '3s' NOT NULL,
|
||||||
|
timeout_ssh_agent varchar(255) DEFAULT '3s' NOT NULL,
|
||||||
|
timeout_telnet_agent varchar(255) DEFAULT '3s' NOT NULL,
|
||||||
|
timeout_script varchar(255) DEFAULT '3s' NOT NULL,
|
||||||
|
auditlog_mode integer DEFAULT '1' NOT NULL,
|
||||||
|
mfa_status integer DEFAULT '0' NOT NULL,
|
||||||
|
mfaid bigint NULL,
|
||||||
|
software_update_checkid varchar(32) DEFAULT '' NOT NULL,
|
||||||
|
software_update_check_data text DEFAULT '' NOT NULL,
|
||||||
|
timeout_browser varchar(255) DEFAULT '60s' NOT NULL,
|
||||||
|
PRIMARY KEY (configid)
|
||||||
|
);
|
||||||
|
CREATE INDEX config_1 ON config (alert_usrgrpid);
|
||||||
|
CREATE INDEX config_2 ON config (discovery_groupid);
|
||||||
|
CREATE INDEX config_3 ON config (ldap_userdirectoryid);
|
||||||
|
CREATE INDEX config_4 ON config (disabled_usrgrpid);
|
||||||
|
CREATE INDEX config_5 ON config (mfaid);
|
||||||
CREATE TABLE triggers (
|
CREATE TABLE triggers (
|
||||||
triggerid bigint NOT NULL,
|
triggerid bigint NOT NULL,
|
||||||
expression varchar(2048) DEFAULT '' NOT NULL,
|
expression varchar(2048) DEFAULT '' NOT NULL,
|
||||||
@@ -715,18 +825,6 @@ CREATE TABLE hostmacro (
|
|||||||
PRIMARY KEY (hostmacroid)
|
PRIMARY KEY (hostmacroid)
|
||||||
);
|
);
|
||||||
CREATE UNIQUE INDEX hostmacro_1 ON hostmacro (hostid,macro);
|
CREATE UNIQUE INDEX hostmacro_1 ON hostmacro (hostid,macro);
|
||||||
CREATE TABLE hostmacro_config (
|
|
||||||
hostmacroid bigint NOT NULL,
|
|
||||||
type integer DEFAULT '0' NOT NULL,
|
|
||||||
priority integer DEFAULT '0' NOT NULL,
|
|
||||||
section_name varchar(255) DEFAULT '' NOT NULL,
|
|
||||||
label varchar(255) DEFAULT '' NOT NULL,
|
|
||||||
description text DEFAULT '' NOT NULL,
|
|
||||||
required integer DEFAULT '0' NOT NULL,
|
|
||||||
regex varchar(255) DEFAULT '' NOT NULL,
|
|
||||||
options text DEFAULT '' NOT NULL,
|
|
||||||
PRIMARY KEY (hostmacroid)
|
|
||||||
);
|
|
||||||
CREATE TABLE hosts_groups (
|
CREATE TABLE hosts_groups (
|
||||||
hostgroupid bigint NOT NULL,
|
hostgroupid bigint NOT NULL,
|
||||||
hostid bigint NOT NULL,
|
hostid bigint NOT NULL,
|
||||||
@@ -858,9 +956,6 @@ CREATE TABLE sysmaps (
|
|||||||
userid bigint NOT NULL,
|
userid bigint NOT NULL,
|
||||||
private integer DEFAULT '1' NOT NULL,
|
private integer DEFAULT '1' NOT NULL,
|
||||||
show_suppressed integer DEFAULT '0' NOT NULL,
|
show_suppressed integer DEFAULT '0' NOT NULL,
|
||||||
background_scale integer DEFAULT '1' NOT NULL,
|
|
||||||
show_element_label integer DEFAULT '1' NOT NULL,
|
|
||||||
show_link_label integer DEFAULT '1' NOT NULL,
|
|
||||||
PRIMARY KEY (sysmapid)
|
PRIMARY KEY (sysmapid)
|
||||||
);
|
);
|
||||||
CREATE UNIQUE INDEX sysmaps_1 ON sysmaps (name);
|
CREATE UNIQUE INDEX sysmaps_1 ON sysmaps (name);
|
||||||
@@ -887,8 +982,6 @@ CREATE TABLE sysmaps_elements (
|
|||||||
viewtype integer DEFAULT '0' NOT NULL,
|
viewtype integer DEFAULT '0' NOT NULL,
|
||||||
use_iconmap integer DEFAULT '1' NOT NULL,
|
use_iconmap integer DEFAULT '1' NOT NULL,
|
||||||
evaltype integer DEFAULT '0' NOT NULL,
|
evaltype integer DEFAULT '0' NOT NULL,
|
||||||
show_label integer DEFAULT '-1' NOT NULL,
|
|
||||||
zindex integer DEFAULT '0' NOT NULL,
|
|
||||||
PRIMARY KEY (selementid)
|
PRIMARY KEY (selementid)
|
||||||
);
|
);
|
||||||
CREATE INDEX sysmaps_elements_1 ON sysmaps_elements (sysmapid);
|
CREATE INDEX sysmaps_elements_1 ON sysmaps_elements (sysmapid);
|
||||||
@@ -904,15 +997,11 @@ CREATE TABLE sysmaps_links (
|
|||||||
drawtype integer DEFAULT '0' NOT NULL,
|
drawtype integer DEFAULT '0' NOT NULL,
|
||||||
color varchar(6) DEFAULT '000000' NOT NULL,
|
color varchar(6) DEFAULT '000000' NOT NULL,
|
||||||
label varchar(2048) DEFAULT '' NOT NULL,
|
label varchar(2048) DEFAULT '' NOT NULL,
|
||||||
show_label integer DEFAULT '-1' NOT NULL,
|
|
||||||
indicator_type integer DEFAULT '0' NOT NULL,
|
|
||||||
itemid bigint NULL,
|
|
||||||
PRIMARY KEY (linkid)
|
PRIMARY KEY (linkid)
|
||||||
);
|
);
|
||||||
CREATE INDEX sysmaps_links_1 ON sysmaps_links (sysmapid);
|
CREATE INDEX sysmaps_links_1 ON sysmaps_links (sysmapid);
|
||||||
CREATE INDEX sysmaps_links_2 ON sysmaps_links (selementid1);
|
CREATE INDEX sysmaps_links_2 ON sysmaps_links (selementid1);
|
||||||
CREATE INDEX sysmaps_links_3 ON sysmaps_links (selementid2);
|
CREATE INDEX sysmaps_links_3 ON sysmaps_links (selementid2);
|
||||||
CREATE INDEX sysmaps_links_4 ON sysmaps_links (itemid);
|
|
||||||
CREATE TABLE sysmaps_link_triggers (
|
CREATE TABLE sysmaps_link_triggers (
|
||||||
linktriggerid bigint NOT NULL,
|
linktriggerid bigint NOT NULL,
|
||||||
linkid bigint NOT NULL,
|
linkid bigint NOT NULL,
|
||||||
@@ -923,18 +1012,6 @@ CREATE TABLE sysmaps_link_triggers (
|
|||||||
);
|
);
|
||||||
CREATE UNIQUE INDEX sysmaps_link_triggers_1 ON sysmaps_link_triggers (linkid,triggerid);
|
CREATE UNIQUE INDEX sysmaps_link_triggers_1 ON sysmaps_link_triggers (linkid,triggerid);
|
||||||
CREATE INDEX sysmaps_link_triggers_2 ON sysmaps_link_triggers (triggerid);
|
CREATE INDEX sysmaps_link_triggers_2 ON sysmaps_link_triggers (triggerid);
|
||||||
CREATE TABLE sysmap_link_threshold (
|
|
||||||
linkthresholdid bigint NOT NULL,
|
|
||||||
linkid bigint NOT NULL,
|
|
||||||
drawtype integer DEFAULT '0' NOT NULL,
|
|
||||||
color varchar(6) DEFAULT '000000' NOT NULL,
|
|
||||||
type integer DEFAULT '0' NOT NULL,
|
|
||||||
threshold varchar(255) DEFAULT '' NOT NULL,
|
|
||||||
pattern varchar(255) DEFAULT '' NOT NULL,
|
|
||||||
sortorder integer DEFAULT '0' NOT NULL,
|
|
||||||
PRIMARY KEY (linkthresholdid)
|
|
||||||
);
|
|
||||||
CREATE INDEX sysmap_link_threshold_1 ON sysmap_link_threshold (linkid);
|
|
||||||
CREATE TABLE sysmap_element_url (
|
CREATE TABLE sysmap_element_url (
|
||||||
sysmapelementurlid bigint NOT NULL,
|
sysmapelementurlid bigint NOT NULL,
|
||||||
selementid bigint NOT NULL,
|
selementid bigint NOT NULL,
|
||||||
@@ -1120,6 +1197,7 @@ CREATE TABLE proxy_history (
|
|||||||
write_clock integer DEFAULT '0' NOT NULL,
|
write_clock integer DEFAULT '0' NOT NULL,
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
);
|
);
|
||||||
|
CREATE INDEX proxy_history_1 ON proxy_history (clock);
|
||||||
CREATE INDEX proxy_history_2 ON proxy_history (write_clock);
|
CREATE INDEX proxy_history_2 ON proxy_history (write_clock);
|
||||||
CREATE TABLE proxy_dhistory (
|
CREATE TABLE proxy_dhistory (
|
||||||
id bigint NOT NULL,
|
id bigint NOT NULL,
|
||||||
@@ -1396,23 +1474,21 @@ CREATE UNIQUE INDEX images_1 ON images (name);
|
|||||||
CREATE TABLE item_discovery (
|
CREATE TABLE item_discovery (
|
||||||
itemdiscoveryid bigint NOT NULL,
|
itemdiscoveryid bigint NOT NULL,
|
||||||
itemid bigint NOT NULL,
|
itemid bigint NOT NULL,
|
||||||
parent_itemid bigint NULL,
|
parent_itemid bigint NOT NULL,
|
||||||
key_ varchar(2048) DEFAULT '' NOT NULL,
|
key_ varchar(2048) DEFAULT '' NOT NULL,
|
||||||
lastcheck integer DEFAULT '0' NOT NULL,
|
lastcheck integer DEFAULT '0' NOT NULL,
|
||||||
ts_delete integer DEFAULT '0' NOT NULL,
|
ts_delete integer DEFAULT '0' NOT NULL,
|
||||||
status integer DEFAULT '0' NOT NULL,
|
status integer DEFAULT '0' NOT NULL,
|
||||||
disable_source integer DEFAULT '0' NOT NULL,
|
disable_source integer DEFAULT '0' NOT NULL,
|
||||||
ts_disable integer DEFAULT '0' NOT NULL,
|
ts_disable integer DEFAULT '0' NOT NULL,
|
||||||
lldruleid bigint NULL,
|
|
||||||
PRIMARY KEY (itemdiscoveryid)
|
PRIMARY KEY (itemdiscoveryid)
|
||||||
);
|
);
|
||||||
CREATE UNIQUE INDEX item_discovery_1 ON item_discovery (itemid,parent_itemid);
|
CREATE UNIQUE INDEX item_discovery_1 ON item_discovery (itemid,parent_itemid);
|
||||||
CREATE INDEX item_discovery_2 ON item_discovery (parent_itemid);
|
CREATE INDEX item_discovery_2 ON item_discovery (parent_itemid);
|
||||||
CREATE INDEX item_discovery_3 ON item_discovery (lldruleid);
|
|
||||||
CREATE TABLE host_discovery (
|
CREATE TABLE host_discovery (
|
||||||
hostid bigint NOT NULL,
|
hostid bigint NOT NULL,
|
||||||
parent_hostid bigint NULL,
|
parent_hostid bigint NULL,
|
||||||
lldruleid bigint NULL,
|
parent_itemid bigint NULL,
|
||||||
host varchar(128) DEFAULT '' NOT NULL,
|
host varchar(128) DEFAULT '' NOT NULL,
|
||||||
lastcheck integer DEFAULT '0' NOT NULL,
|
lastcheck integer DEFAULT '0' NOT NULL,
|
||||||
ts_delete integer DEFAULT '0' NOT NULL,
|
ts_delete integer DEFAULT '0' NOT NULL,
|
||||||
@@ -1422,7 +1498,7 @@ CREATE TABLE host_discovery (
|
|||||||
PRIMARY KEY (hostid)
|
PRIMARY KEY (hostid)
|
||||||
);
|
);
|
||||||
CREATE INDEX host_discovery_1 ON host_discovery (parent_hostid);
|
CREATE INDEX host_discovery_1 ON host_discovery (parent_hostid);
|
||||||
CREATE INDEX host_discovery_2 ON host_discovery (lldruleid);
|
CREATE INDEX host_discovery_2 ON host_discovery (parent_itemid);
|
||||||
CREATE TABLE interface_discovery (
|
CREATE TABLE interface_discovery (
|
||||||
interfaceid bigint NOT NULL,
|
interfaceid bigint NOT NULL,
|
||||||
parent_interfaceid bigint NOT NULL,
|
parent_interfaceid bigint NOT NULL,
|
||||||
@@ -2407,36 +2483,13 @@ CREATE TABLE mfa_totp_secret (
|
|||||||
);
|
);
|
||||||
CREATE INDEX mfa_totp_secret_1 ON mfa_totp_secret (mfaid);
|
CREATE INDEX mfa_totp_secret_1 ON mfa_totp_secret (mfaid);
|
||||||
CREATE INDEX mfa_totp_secret_2 ON mfa_totp_secret (userid);
|
CREATE INDEX mfa_totp_secret_2 ON mfa_totp_secret (userid);
|
||||||
CREATE TABLE settings (
|
|
||||||
name varchar(255) NOT NULL,
|
|
||||||
type integer NOT NULL,
|
|
||||||
value_str text DEFAULT '' NOT NULL,
|
|
||||||
value_int integer DEFAULT '0' NOT NULL,
|
|
||||||
value_usrgrpid bigint NULL,
|
|
||||||
value_hostgroupid bigint NULL,
|
|
||||||
value_userdirectoryid bigint NULL,
|
|
||||||
value_mfaid bigint NULL,
|
|
||||||
PRIMARY KEY (name)
|
|
||||||
);
|
|
||||||
CREATE INDEX settings_2 ON settings (value_usrgrpid);
|
|
||||||
CREATE INDEX settings_3 ON settings (value_hostgroupid);
|
|
||||||
CREATE INDEX settings_4 ON settings (value_userdirectoryid);
|
|
||||||
CREATE INDEX settings_5 ON settings (value_mfaid);
|
|
||||||
CREATE TABLE lld_macro_export (
|
|
||||||
lld_macro_exportid bigint NOT NULL,
|
|
||||||
itemid bigint NOT NULL,
|
|
||||||
lld_macro varchar(255) DEFAULT '' NOT NULL,
|
|
||||||
value text DEFAULT '' NOT NULL,
|
|
||||||
PRIMARY KEY (lld_macro_exportid)
|
|
||||||
);
|
|
||||||
CREATE INDEX lld_macro_export_1 ON lld_macro_export (itemid);
|
|
||||||
CREATE TABLE dbversion (
|
CREATE TABLE dbversion (
|
||||||
dbversionid bigint NOT NULL,
|
dbversionid bigint NOT NULL,
|
||||||
mandatory integer DEFAULT '0' NOT NULL,
|
mandatory integer DEFAULT '0' NOT NULL,
|
||||||
optional integer DEFAULT '0' NOT NULL,
|
optional integer DEFAULT '0' NOT NULL,
|
||||||
PRIMARY KEY (dbversionid)
|
PRIMARY KEY (dbversionid)
|
||||||
);
|
);
|
||||||
INSERT INTO dbversion VALUES ('1','7040000','7040009');
|
INSERT INTO dbversion VALUES ('1','7000000','7000029');
|
||||||
create or replace function changelog_hosts_insert() returns trigger as $$
|
create or replace function changelog_hosts_insert() returns trigger as $$
|
||||||
begin
|
begin
|
||||||
insert into changelog (object,objectid,operation,clock)
|
insert into changelog (object,objectid,operation,clock)
|
||||||
@@ -3111,7 +3164,6 @@ ALTER TABLE ONLY httpstepitem ADD CONSTRAINT c_httpstepitem_1 FOREIGN KEY (https
|
|||||||
ALTER TABLE ONLY httpstepitem ADD CONSTRAINT c_httpstepitem_2 FOREIGN KEY (itemid) REFERENCES items (itemid);
|
ALTER TABLE ONLY httpstepitem ADD CONSTRAINT c_httpstepitem_2 FOREIGN KEY (itemid) REFERENCES items (itemid);
|
||||||
ALTER TABLE ONLY httptestitem ADD CONSTRAINT c_httptestitem_1 FOREIGN KEY (httptestid) REFERENCES httptest (httptestid);
|
ALTER TABLE ONLY httptestitem ADD CONSTRAINT c_httptestitem_1 FOREIGN KEY (httptestid) REFERENCES httptest (httptestid);
|
||||||
ALTER TABLE ONLY httptestitem ADD CONSTRAINT c_httptestitem_2 FOREIGN KEY (itemid) REFERENCES items (itemid);
|
ALTER TABLE ONLY httptestitem ADD CONSTRAINT c_httptestitem_2 FOREIGN KEY (itemid) REFERENCES items (itemid);
|
||||||
ALTER TABLE ONLY media_type_oauth ADD CONSTRAINT c_media_type_oauth_1 FOREIGN KEY (mediatypeid) REFERENCES media_type (mediatypeid) ON DELETE CASCADE;
|
|
||||||
ALTER TABLE ONLY media_type_param ADD CONSTRAINT c_media_type_param_1 FOREIGN KEY (mediatypeid) REFERENCES media_type (mediatypeid) ON DELETE CASCADE;
|
ALTER TABLE ONLY media_type_param ADD CONSTRAINT c_media_type_param_1 FOREIGN KEY (mediatypeid) REFERENCES media_type (mediatypeid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY media_type_message ADD CONSTRAINT c_media_type_message_1 FOREIGN KEY (mediatypeid) REFERENCES media_type (mediatypeid) ON DELETE CASCADE;
|
ALTER TABLE ONLY media_type_message ADD CONSTRAINT c_media_type_message_1 FOREIGN KEY (mediatypeid) REFERENCES media_type (mediatypeid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY usrgrp ADD CONSTRAINT c_usrgrp_2 FOREIGN KEY (userdirectoryid) REFERENCES userdirectory (userdirectoryid);
|
ALTER TABLE ONLY usrgrp ADD CONSTRAINT c_usrgrp_2 FOREIGN KEY (userdirectoryid) REFERENCES userdirectory (userdirectoryid);
|
||||||
@@ -3145,6 +3197,11 @@ ALTER TABLE ONLY optemplate ADD CONSTRAINT c_optemplate_1 FOREIGN KEY (operation
|
|||||||
ALTER TABLE ONLY optemplate ADD CONSTRAINT c_optemplate_2 FOREIGN KEY (templateid) REFERENCES hosts (hostid);
|
ALTER TABLE ONLY optemplate ADD CONSTRAINT c_optemplate_2 FOREIGN KEY (templateid) REFERENCES hosts (hostid);
|
||||||
ALTER TABLE ONLY opconditions ADD CONSTRAINT c_opconditions_1 FOREIGN KEY (operationid) REFERENCES operations (operationid) ON DELETE CASCADE;
|
ALTER TABLE ONLY opconditions ADD CONSTRAINT c_opconditions_1 FOREIGN KEY (operationid) REFERENCES operations (operationid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY conditions ADD CONSTRAINT c_conditions_1 FOREIGN KEY (actionid) REFERENCES actions (actionid) ON DELETE CASCADE;
|
ALTER TABLE ONLY conditions ADD CONSTRAINT c_conditions_1 FOREIGN KEY (actionid) REFERENCES actions (actionid) ON DELETE CASCADE;
|
||||||
|
ALTER TABLE ONLY config ADD CONSTRAINT c_config_1 FOREIGN KEY (alert_usrgrpid) REFERENCES usrgrp (usrgrpid);
|
||||||
|
ALTER TABLE ONLY config ADD CONSTRAINT c_config_2 FOREIGN KEY (discovery_groupid) REFERENCES hstgrp (groupid);
|
||||||
|
ALTER TABLE ONLY config ADD CONSTRAINT c_config_3 FOREIGN KEY (ldap_userdirectoryid) REFERENCES userdirectory (userdirectoryid);
|
||||||
|
ALTER TABLE ONLY config ADD CONSTRAINT c_config_4 FOREIGN KEY (disabled_usrgrpid) REFERENCES usrgrp (usrgrpid);
|
||||||
|
ALTER TABLE ONLY config ADD CONSTRAINT c_config_5 FOREIGN KEY (mfaid) REFERENCES mfa (mfaid);
|
||||||
ALTER TABLE ONLY triggers ADD CONSTRAINT c_triggers_1 FOREIGN KEY (templateid) REFERENCES triggers (triggerid);
|
ALTER TABLE ONLY triggers ADD CONSTRAINT c_triggers_1 FOREIGN KEY (templateid) REFERENCES triggers (triggerid);
|
||||||
ALTER TABLE ONLY trigger_depends ADD CONSTRAINT c_trigger_depends_1 FOREIGN KEY (triggerid_down) REFERENCES triggers (triggerid) ON DELETE CASCADE;
|
ALTER TABLE ONLY trigger_depends ADD CONSTRAINT c_trigger_depends_1 FOREIGN KEY (triggerid_down) REFERENCES triggers (triggerid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY trigger_depends ADD CONSTRAINT c_trigger_depends_2 FOREIGN KEY (triggerid_up) REFERENCES triggers (triggerid) ON DELETE CASCADE;
|
ALTER TABLE ONLY trigger_depends ADD CONSTRAINT c_trigger_depends_2 FOREIGN KEY (triggerid_up) REFERENCES triggers (triggerid) ON DELETE CASCADE;
|
||||||
@@ -3156,7 +3213,6 @@ ALTER TABLE ONLY graphs ADD CONSTRAINT c_graphs_3 FOREIGN KEY (ymax_itemid) REFE
|
|||||||
ALTER TABLE ONLY graphs_items ADD CONSTRAINT c_graphs_items_1 FOREIGN KEY (graphid) REFERENCES graphs (graphid) ON DELETE CASCADE;
|
ALTER TABLE ONLY graphs_items ADD CONSTRAINT c_graphs_items_1 FOREIGN KEY (graphid) REFERENCES graphs (graphid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY graphs_items ADD CONSTRAINT c_graphs_items_2 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE;
|
ALTER TABLE ONLY graphs_items ADD CONSTRAINT c_graphs_items_2 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY hostmacro ADD CONSTRAINT c_hostmacro_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE;
|
ALTER TABLE ONLY hostmacro ADD CONSTRAINT c_hostmacro_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY hostmacro_config ADD CONSTRAINT c_hostmacro_config_1 FOREIGN KEY (hostmacroid) REFERENCES hostmacro (hostmacroid) ON DELETE CASCADE;
|
|
||||||
ALTER TABLE ONLY hosts_groups ADD CONSTRAINT c_hosts_groups_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE;
|
ALTER TABLE ONLY hosts_groups ADD CONSTRAINT c_hosts_groups_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY hosts_groups ADD CONSTRAINT c_hosts_groups_2 FOREIGN KEY (groupid) REFERENCES hstgrp (groupid) ON DELETE CASCADE;
|
ALTER TABLE ONLY hosts_groups ADD CONSTRAINT c_hosts_groups_2 FOREIGN KEY (groupid) REFERENCES hstgrp (groupid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY hosts_templates ADD CONSTRAINT c_hosts_templates_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE;
|
ALTER TABLE ONLY hosts_templates ADD CONSTRAINT c_hosts_templates_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE;
|
||||||
@@ -3185,10 +3241,8 @@ ALTER TABLE ONLY sysmaps_elements ADD CONSTRAINT c_sysmaps_elements_5 FOREIGN KE
|
|||||||
ALTER TABLE ONLY sysmaps_links ADD CONSTRAINT c_sysmaps_links_1 FOREIGN KEY (sysmapid) REFERENCES sysmaps (sysmapid) ON DELETE CASCADE;
|
ALTER TABLE ONLY sysmaps_links ADD CONSTRAINT c_sysmaps_links_1 FOREIGN KEY (sysmapid) REFERENCES sysmaps (sysmapid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY sysmaps_links ADD CONSTRAINT c_sysmaps_links_2 FOREIGN KEY (selementid1) REFERENCES sysmaps_elements (selementid) ON DELETE CASCADE;
|
ALTER TABLE ONLY sysmaps_links ADD CONSTRAINT c_sysmaps_links_2 FOREIGN KEY (selementid1) REFERENCES sysmaps_elements (selementid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY sysmaps_links ADD CONSTRAINT c_sysmaps_links_3 FOREIGN KEY (selementid2) REFERENCES sysmaps_elements (selementid) ON DELETE CASCADE;
|
ALTER TABLE ONLY sysmaps_links ADD CONSTRAINT c_sysmaps_links_3 FOREIGN KEY (selementid2) REFERENCES sysmaps_elements (selementid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY sysmaps_links ADD CONSTRAINT c_sysmaps_links_4 FOREIGN KEY (itemid) REFERENCES items (itemid);
|
|
||||||
ALTER TABLE ONLY sysmaps_link_triggers ADD CONSTRAINT c_sysmaps_link_triggers_1 FOREIGN KEY (linkid) REFERENCES sysmaps_links (linkid) ON DELETE CASCADE;
|
ALTER TABLE ONLY sysmaps_link_triggers ADD CONSTRAINT c_sysmaps_link_triggers_1 FOREIGN KEY (linkid) REFERENCES sysmaps_links (linkid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY sysmaps_link_triggers ADD CONSTRAINT c_sysmaps_link_triggers_2 FOREIGN KEY (triggerid) REFERENCES triggers (triggerid) ON DELETE CASCADE;
|
ALTER TABLE ONLY sysmaps_link_triggers ADD CONSTRAINT c_sysmaps_link_triggers_2 FOREIGN KEY (triggerid) REFERENCES triggers (triggerid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY sysmap_link_threshold ADD CONSTRAINT c_sysmap_link_threshold_1 FOREIGN KEY (linkid) REFERENCES sysmaps_links (linkid) ON DELETE CASCADE;
|
|
||||||
ALTER TABLE ONLY sysmap_element_url ADD CONSTRAINT c_sysmap_element_url_1 FOREIGN KEY (selementid) REFERENCES sysmaps_elements (selementid) ON DELETE CASCADE;
|
ALTER TABLE ONLY sysmap_element_url ADD CONSTRAINT c_sysmap_element_url_1 FOREIGN KEY (selementid) REFERENCES sysmaps_elements (selementid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY sysmap_url ADD CONSTRAINT c_sysmap_url_1 FOREIGN KEY (sysmapid) REFERENCES sysmaps (sysmapid) ON DELETE CASCADE;
|
ALTER TABLE ONLY sysmap_url ADD CONSTRAINT c_sysmap_url_1 FOREIGN KEY (sysmapid) REFERENCES sysmaps (sysmapid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY sysmap_user ADD CONSTRAINT c_sysmap_user_1 FOREIGN KEY (sysmapid) REFERENCES sysmaps (sysmapid) ON DELETE CASCADE;
|
ALTER TABLE ONLY sysmap_user ADD CONSTRAINT c_sysmap_user_1 FOREIGN KEY (sysmapid) REFERENCES sysmaps (sysmapid) ON DELETE CASCADE;
|
||||||
@@ -3222,10 +3276,9 @@ ALTER TABLE ONLY graph_discovery ADD CONSTRAINT c_graph_discovery_2 FOREIGN KEY
|
|||||||
ALTER TABLE ONLY host_inventory ADD CONSTRAINT c_host_inventory_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE;
|
ALTER TABLE ONLY host_inventory ADD CONSTRAINT c_host_inventory_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY item_discovery ADD CONSTRAINT c_item_discovery_1 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE;
|
ALTER TABLE ONLY item_discovery ADD CONSTRAINT c_item_discovery_1 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY item_discovery ADD CONSTRAINT c_item_discovery_2 FOREIGN KEY (parent_itemid) REFERENCES items (itemid) ON DELETE CASCADE;
|
ALTER TABLE ONLY item_discovery ADD CONSTRAINT c_item_discovery_2 FOREIGN KEY (parent_itemid) REFERENCES items (itemid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY item_discovery ADD CONSTRAINT c_item_discovery_3 FOREIGN KEY (lldruleid) REFERENCES items (itemid);
|
|
||||||
ALTER TABLE ONLY host_discovery ADD CONSTRAINT c_host_discovery_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE;
|
ALTER TABLE ONLY host_discovery ADD CONSTRAINT c_host_discovery_1 FOREIGN KEY (hostid) REFERENCES hosts (hostid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY host_discovery ADD CONSTRAINT c_host_discovery_2 FOREIGN KEY (parent_hostid) REFERENCES hosts (hostid);
|
ALTER TABLE ONLY host_discovery ADD CONSTRAINT c_host_discovery_2 FOREIGN KEY (parent_hostid) REFERENCES hosts (hostid);
|
||||||
ALTER TABLE ONLY host_discovery ADD CONSTRAINT c_host_discovery_3 FOREIGN KEY (lldruleid) REFERENCES items (itemid);
|
ALTER TABLE ONLY host_discovery ADD CONSTRAINT c_host_discovery_3 FOREIGN KEY (parent_itemid) REFERENCES items (itemid);
|
||||||
ALTER TABLE ONLY interface_discovery ADD CONSTRAINT c_interface_discovery_1 FOREIGN KEY (interfaceid) REFERENCES interface (interfaceid) ON DELETE CASCADE;
|
ALTER TABLE ONLY interface_discovery ADD CONSTRAINT c_interface_discovery_1 FOREIGN KEY (interfaceid) REFERENCES interface (interfaceid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY interface_discovery ADD CONSTRAINT c_interface_discovery_2 FOREIGN KEY (parent_interfaceid) REFERENCES interface (interfaceid) ON DELETE CASCADE;
|
ALTER TABLE ONLY interface_discovery ADD CONSTRAINT c_interface_discovery_2 FOREIGN KEY (parent_interfaceid) REFERENCES interface (interfaceid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY profiles ADD CONSTRAINT c_profiles_1 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE;
|
ALTER TABLE ONLY profiles ADD CONSTRAINT c_profiles_1 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE;
|
||||||
@@ -3352,8 +3405,3 @@ ALTER TABLE ONLY host_proxy ADD CONSTRAINT c_host_proxy_1 FOREIGN KEY (hostid) R
|
|||||||
ALTER TABLE ONLY host_proxy ADD CONSTRAINT c_host_proxy_2 FOREIGN KEY (proxyid) REFERENCES proxy (proxyid);
|
ALTER TABLE ONLY host_proxy ADD CONSTRAINT c_host_proxy_2 FOREIGN KEY (proxyid) REFERENCES proxy (proxyid);
|
||||||
ALTER TABLE ONLY mfa_totp_secret ADD CONSTRAINT c_mfa_totp_secret_1 FOREIGN KEY (mfaid) REFERENCES mfa (mfaid) ON DELETE CASCADE;
|
ALTER TABLE ONLY mfa_totp_secret ADD CONSTRAINT c_mfa_totp_secret_1 FOREIGN KEY (mfaid) REFERENCES mfa (mfaid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY mfa_totp_secret ADD CONSTRAINT c_mfa_totp_secret_2 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE;
|
ALTER TABLE ONLY mfa_totp_secret ADD CONSTRAINT c_mfa_totp_secret_2 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE;
|
||||||
ALTER TABLE ONLY settings ADD CONSTRAINT c_settings_2 FOREIGN KEY (value_usrgrpid) REFERENCES usrgrp (usrgrpid);
|
|
||||||
ALTER TABLE ONLY settings ADD CONSTRAINT c_settings_3 FOREIGN KEY (value_hostgroupid) REFERENCES hstgrp (groupid);
|
|
||||||
ALTER TABLE ONLY settings ADD CONSTRAINT c_settings_4 FOREIGN KEY (value_userdirectoryid) REFERENCES userdirectory (userdirectoryid);
|
|
||||||
ALTER TABLE ONLY settings ADD CONSTRAINT c_settings_5 FOREIGN KEY (value_mfaid) REFERENCES mfa (mfaid);
|
|
||||||
ALTER TABLE ONLY lld_macro_export ADD CONSTRAINT c_lld_macro_export_1 FOREIGN KEY (itemid) REFERENCES items (itemid) ON DELETE CASCADE;
|
|
||||||
|
|||||||
@@ -120,25 +120,20 @@ BEGIN
|
|||||||
IF p_period = 'day' THEN
|
IF p_period = 'day' THEN
|
||||||
v_period_interval := '1 day'::interval;
|
v_period_interval := '1 day'::interval;
|
||||||
v_start_time := date_trunc('day', now() AT TIME ZONE 'UTC');
|
v_start_time := date_trunc('day', now() AT TIME ZONE 'UTC');
|
||||||
-- Calculate how many past days cover the retention period
|
-- Calculate how many past days cover the retention period (86400 seconds = 1 day)
|
||||||
v_past_iterations := extract(day from p_keep_history)::integer;
|
v_past_iterations := ceil(extract(epoch from p_keep_history) / 86400)::integer;
|
||||||
-- Safety cap or ensure minimum? default 7 if null?
|
|
||||||
IF v_past_iterations IS NULL THEN v_past_iterations := 7; END IF;
|
|
||||||
|
|
||||||
ELSIF p_period = 'week' THEN
|
ELSIF p_period = 'week' THEN
|
||||||
v_period_interval := '1 week'::interval;
|
v_period_interval := '1 week'::interval;
|
||||||
v_start_time := date_trunc('week', now() AT TIME ZONE 'UTC');
|
v_start_time := date_trunc('week', now() AT TIME ZONE 'UTC');
|
||||||
v_past_iterations := (extract(day from p_keep_history) / 7)::integer;
|
-- 604800 seconds = 1 week
|
||||||
|
v_past_iterations := ceil(extract(epoch from p_keep_history) / 604800)::integer;
|
||||||
|
|
||||||
ELSIF p_period = 'month' THEN
|
ELSIF p_period = 'month' THEN
|
||||||
v_period_interval := '1 month'::interval;
|
v_period_interval := '1 month'::interval;
|
||||||
v_start_time := date_trunc('month', now() AT TIME ZONE 'UTC');
|
v_start_time := date_trunc('month', now() AT TIME ZONE 'UTC');
|
||||||
-- Approximate months
|
-- Approximate 30 days per month (2592000 seconds)
|
||||||
v_past_iterations := (extract(year from p_keep_history) * 12 + extract(month from p_keep_history))::integer;
|
v_past_iterations := ceil(extract(epoch from p_keep_history) / 2592000)::integer;
|
||||||
-- Fallback if interval is just days (e.g. '365 days')
|
|
||||||
IF v_past_iterations = 0 THEN
|
|
||||||
v_past_iterations := (extract(day from p_keep_history) / 30)::integer;
|
|
||||||
END IF;
|
|
||||||
ELSE
|
ELSE
|
||||||
RETURN;
|
RETURN;
|
||||||
END IF;
|
END IF;
|
||||||
@@ -153,7 +148,6 @@ BEGIN
|
|||||||
);
|
);
|
||||||
COMMIT; -- Release lock immediately
|
COMMIT; -- Release lock immediately
|
||||||
END LOOP;
|
END LOOP;
|
||||||
END LOOP;
|
|
||||||
|
|
||||||
-- 2. Create Past Partitions (Covering retention period)
|
-- 2. Create Past Partitions (Covering retention period)
|
||||||
IF v_past_iterations > 0 THEN
|
IF v_past_iterations > 0 THEN
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -107,7 +107,8 @@ else
|
|||||||
echo -e "${RED}Warning: z_gen_history_data.sql not found!${NC}"
|
echo -e "${RED}Warning: z_gen_history_data.sql not found!${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check logic for 7.4 vs 7.0 (file names might slightly differ or be organized differently if using packages, but assuming source layout provided)
|
# Check logic for 7.4 vs 7.0 (file names might slightly differ or be organized differently if using packages,
|
||||||
|
# but assuming source layout provided)
|
||||||
|
|
||||||
# Export variable for Docker Compose
|
# Export variable for Docker Compose
|
||||||
export PG_VERSION=$PG_VERSION
|
export PG_VERSION=$PG_VERSION
|
||||||
|
|||||||
@@ -120,25 +120,20 @@ BEGIN
|
|||||||
IF p_period = 'day' THEN
|
IF p_period = 'day' THEN
|
||||||
v_period_interval := '1 day'::interval;
|
v_period_interval := '1 day'::interval;
|
||||||
v_start_time := date_trunc('day', now() AT TIME ZONE 'UTC');
|
v_start_time := date_trunc('day', now() AT TIME ZONE 'UTC');
|
||||||
-- Calculate how many past days cover the retention period
|
-- Calculate how many past days cover the retention period (86400 seconds = 1 day)
|
||||||
v_past_iterations := extract(day from p_keep_history)::integer;
|
v_past_iterations := ceil(extract(epoch from p_keep_history) / 86400)::integer;
|
||||||
-- Safety cap or ensure minimum? default 7 if null?
|
|
||||||
IF v_past_iterations IS NULL THEN v_past_iterations := 7; END IF;
|
|
||||||
|
|
||||||
ELSIF p_period = 'week' THEN
|
ELSIF p_period = 'week' THEN
|
||||||
v_period_interval := '1 week'::interval;
|
v_period_interval := '1 week'::interval;
|
||||||
v_start_time := date_trunc('week', now() AT TIME ZONE 'UTC');
|
v_start_time := date_trunc('week', now() AT TIME ZONE 'UTC');
|
||||||
v_past_iterations := (extract(day from p_keep_history) / 7)::integer;
|
-- 604800 seconds = 1 week
|
||||||
|
v_past_iterations := ceil(extract(epoch from p_keep_history) / 604800)::integer;
|
||||||
|
|
||||||
ELSIF p_period = 'month' THEN
|
ELSIF p_period = 'month' THEN
|
||||||
v_period_interval := '1 month'::interval;
|
v_period_interval := '1 month'::interval;
|
||||||
v_start_time := date_trunc('month', now() AT TIME ZONE 'UTC');
|
v_start_time := date_trunc('month', now() AT TIME ZONE 'UTC');
|
||||||
-- Approximate months
|
-- Approximate 30 days per month (2592000 seconds)
|
||||||
v_past_iterations := (extract(year from p_keep_history) * 12 + extract(month from p_keep_history))::integer;
|
v_past_iterations := ceil(extract(epoch from p_keep_history) / 2592000)::integer;
|
||||||
-- Fallback if interval is just days (e.g. '365 days')
|
|
||||||
IF v_past_iterations = 0 THEN
|
|
||||||
v_past_iterations := (extract(day from p_keep_history) / 30)::integer;
|
|
||||||
END IF;
|
|
||||||
ELSE
|
ELSE
|
||||||
RETURN;
|
RETURN;
|
||||||
END IF;
|
END IF;
|
||||||
@@ -153,7 +148,6 @@ BEGIN
|
|||||||
);
|
);
|
||||||
COMMIT; -- Release lock immediately
|
COMMIT; -- Release lock immediately
|
||||||
END LOOP;
|
END LOOP;
|
||||||
END LOOP;
|
|
||||||
|
|
||||||
-- 2. Create Past Partitions (Covering retention period)
|
-- 2. Create Past Partitions (Covering retention period)
|
||||||
IF v_past_iterations > 0 THEN
|
IF v_past_iterations > 0 THEN
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
PATCHES = \
|
|
||||||
history_upgrade_prepare.sql
|
|
||||||
|
|
||||||
if DBSCHEMA
|
|
||||||
all: $(PATCHES)
|
|
||||||
|
|
||||||
history_upgrade_prepare.sql: $(top_srcdir)/create/bin/gen_history_upgrade.pl
|
|
||||||
$(top_srcdir)/create/bin/gen_history_upgrade.pl postgresql > $@
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f history_upgrade_prepare.sql
|
|
||||||
endif
|
|
||||||
|
|
||||||
EXTRA_DIST = $(PATCHES)
|
|
||||||
|
|
||||||
.PHONY: all clean
|
|
||||||
@@ -1,567 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.17 from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright (C) 1994-2024 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
VPATH = @srcdir@
|
|
||||||
am__is_gnu_make = { \
|
|
||||||
if test -z '$(MAKELEVEL)'; then \
|
|
||||||
false; \
|
|
||||||
elif test -n '$(MAKE_HOST)'; then \
|
|
||||||
true; \
|
|
||||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
false; \
|
|
||||||
fi; \
|
|
||||||
}
|
|
||||||
am__make_running_with_option = \
|
|
||||||
case $${target_option-} in \
|
|
||||||
?) ;; \
|
|
||||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
|
||||||
"target option '$${target_option-}' specified" >&2; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
has_opt=no; \
|
|
||||||
sane_makeflags=$$MAKEFLAGS; \
|
|
||||||
if $(am__is_gnu_make); then \
|
|
||||||
sane_makeflags=$$MFLAGS; \
|
|
||||||
else \
|
|
||||||
case $$MAKEFLAGS in \
|
|
||||||
*\\[\ \ ]*) \
|
|
||||||
bs=\\; \
|
|
||||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
|
||||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
|
||||||
esac; \
|
|
||||||
fi; \
|
|
||||||
skip_next=no; \
|
|
||||||
strip_trailopt () \
|
|
||||||
{ \
|
|
||||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
|
||||||
}; \
|
|
||||||
for flg in $$sane_makeflags; do \
|
|
||||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
|
||||||
case $$flg in \
|
|
||||||
*=*|--*) continue;; \
|
|
||||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
|
||||||
-*I?*) strip_trailopt 'I';; \
|
|
||||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
|
||||||
-*O?*) strip_trailopt 'O';; \
|
|
||||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
|
||||||
-*l?*) strip_trailopt 'l';; \
|
|
||||||
-[dEDm]) skip_next=yes;; \
|
|
||||||
-[JT]) skip_next=yes;; \
|
|
||||||
esac; \
|
|
||||||
case $$flg in \
|
|
||||||
*$$target_option*) has_opt=yes; break;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
test $$has_opt = yes
|
|
||||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
|
||||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
|
||||||
am__rm_f = rm -f $(am__rm_f_notfound)
|
|
||||||
am__rm_rf = rm -rf $(am__rm_f_notfound)
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
install_sh_PROGRAM = $(install_sh) -c
|
|
||||||
install_sh_SCRIPT = $(install_sh) -c
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = $(program_transform_name)
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
build_triplet = @build@
|
|
||||||
host_triplet = @host@
|
|
||||||
subdir = database/postgresql/option-patches
|
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ares.m4 \
|
|
||||||
$(top_srcdir)/m4/ax_lib_mysql.m4 \
|
|
||||||
$(top_srcdir)/m4/ax_lib_postgresql.m4 \
|
|
||||||
$(top_srcdir)/m4/ax_lib_sqlite3.m4 \
|
|
||||||
$(top_srcdir)/m4/check_enum.m4 $(top_srcdir)/m4/iconv.m4 \
|
|
||||||
$(top_srcdir)/m4/ldap.m4 $(top_srcdir)/m4/libcurl.m4 \
|
|
||||||
$(top_srcdir)/m4/libevent.m4 $(top_srcdir)/m4/libgnutls.m4 \
|
|
||||||
$(top_srcdir)/m4/libmodbus.m4 $(top_srcdir)/m4/libopenssl.m4 \
|
|
||||||
$(top_srcdir)/m4/libssh.m4 $(top_srcdir)/m4/libssh2.m4 \
|
|
||||||
$(top_srcdir)/m4/libunixodbc.m4 $(top_srcdir)/m4/libxml2.m4 \
|
|
||||||
$(top_srcdir)/m4/netsnmp.m4 $(top_srcdir)/m4/openipmi.m4 \
|
|
||||||
$(top_srcdir)/m4/pcre2.m4 $(top_srcdir)/m4/pthread.m4 \
|
|
||||||
$(top_srcdir)/m4/resolv.m4 $(top_srcdir)/m4/times.m4 \
|
|
||||||
$(top_srcdir)/m4/zlib.m4 $(top_srcdir)/configure.ac
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
|
||||||
$(ACLOCAL_M4)
|
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
|
||||||
mkinstalldirs = $(install_sh) -d
|
|
||||||
CONFIG_HEADER = $(top_builddir)/include/common/config.h
|
|
||||||
CONFIG_CLEAN_FILES =
|
|
||||||
CONFIG_CLEAN_VPATH_FILES =
|
|
||||||
AM_V_P = $(am__v_P_@AM_V@)
|
|
||||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
|
||||||
am__v_P_0 = false
|
|
||||||
am__v_P_1 = :
|
|
||||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
|
||||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
|
||||||
am__v_GEN_0 = @echo " GEN " $@;
|
|
||||||
am__v_GEN_1 =
|
|
||||||
AM_V_at = $(am__v_at_@AM_V@)
|
|
||||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|
||||||
am__v_at_0 = @
|
|
||||||
am__v_at_1 =
|
|
||||||
SOURCES =
|
|
||||||
DIST_SOURCES =
|
|
||||||
am__can_run_installinfo = \
|
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
|
||||||
n|no|NO) false;; \
|
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
|
||||||
esac
|
|
||||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AGENT2_CONFIG_DIR = @AGENT2_CONFIG_DIR@
|
|
||||||
AGENT2_CONFIG_FILE = @AGENT2_CONFIG_FILE@
|
|
||||||
AGENT2_LDFLAGS = @AGENT2_LDFLAGS@
|
|
||||||
AGENT2_LIBS = @AGENT2_LIBS@
|
|
||||||
AGENT2_PLUGIN_CONFIG_DIR = @AGENT2_PLUGIN_CONFIG_DIR@
|
|
||||||
AGENT_CONFIG_FILE = @AGENT_CONFIG_FILE@
|
|
||||||
AGENT_LDFLAGS = @AGENT_LDFLAGS@
|
|
||||||
AGENT_LIBS = @AGENT_LIBS@
|
|
||||||
ALERT_SCRIPTS_PATH = @ALERT_SCRIPTS_PATH@
|
|
||||||
AMTAR = @AMTAR@
|
|
||||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
||||||
ARCH = @ARCH@
|
|
||||||
ARES_CFLAGS = @ARES_CFLAGS@
|
|
||||||
ARES_LDFLAGS = @ARES_LDFLAGS@
|
|
||||||
ARES_LIBS = @ARES_LIBS@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AWK = @AWK@
|
|
||||||
CC = @CC@
|
|
||||||
CCDEPMODE = @CCDEPMODE@
|
|
||||||
CFLAGS = @CFLAGS@
|
|
||||||
CGO_CFLAGS = @CGO_CFLAGS@
|
|
||||||
CGO_LDFLAGS = @CGO_LDFLAGS@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
CSCOPE = @CSCOPE@
|
|
||||||
CTAGS = @CTAGS@
|
|
||||||
CURL_SSL_CERT_LOCATION = @CURL_SSL_CERT_LOCATION@
|
|
||||||
CURL_SSL_KEY_LOCATION = @CURL_SSL_KEY_LOCATION@
|
|
||||||
CXX = @CXX@
|
|
||||||
CXXDEPMODE = @CXXDEPMODE@
|
|
||||||
CXXFLAGS = @CXXFLAGS@
|
|
||||||
CYGPATH_W = @CYGPATH_W@
|
|
||||||
DB_CFLAGS = @DB_CFLAGS@
|
|
||||||
DB_LDFLAGS = @DB_LDFLAGS@
|
|
||||||
DB_LIBS = @DB_LIBS@
|
|
||||||
DEFAULT_INCLUDES = @DEFAULT_INCLUDES@
|
|
||||||
DEFS = @DEFS@
|
|
||||||
DEPDIR = @DEPDIR@
|
|
||||||
ECHO_C = @ECHO_C@
|
|
||||||
ECHO_N = @ECHO_N@
|
|
||||||
ECHO_T = @ECHO_T@
|
|
||||||
EGREP = @EGREP@
|
|
||||||
ETAGS = @ETAGS@
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
EXTERNAL_SCRIPTS_PATH = @EXTERNAL_SCRIPTS_PATH@
|
|
||||||
GNUTLS_CFLAGS = @GNUTLS_CFLAGS@
|
|
||||||
GNUTLS_LDFLAGS = @GNUTLS_LDFLAGS@
|
|
||||||
GNUTLS_LIBS = @GNUTLS_LIBS@
|
|
||||||
GO = @GO@
|
|
||||||
GREP = @GREP@
|
|
||||||
ICONV_CFLAGS = @ICONV_CFLAGS@
|
|
||||||
ICONV_LDFLAGS = @ICONV_LDFLAGS@
|
|
||||||
ICONV_LIBS = @ICONV_LIBS@
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
||||||
JAR = @JAR@
|
|
||||||
JAVAC = @JAVAC@
|
|
||||||
LDAP_CPPFLAGS = @LDAP_CPPFLAGS@
|
|
||||||
LDAP_LDFLAGS = @LDAP_LDFLAGS@
|
|
||||||
LDAP_LIBS = @LDAP_LIBS@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LIBCURL_CFLAGS = @LIBCURL_CFLAGS@
|
|
||||||
LIBCURL_LDFLAGS = @LIBCURL_LDFLAGS@
|
|
||||||
LIBCURL_LIBS = @LIBCURL_LIBS@
|
|
||||||
LIBEVENT_CFLAGS = @LIBEVENT_CFLAGS@
|
|
||||||
LIBEVENT_LDFLAGS = @LIBEVENT_LDFLAGS@
|
|
||||||
LIBEVENT_LIBS = @LIBEVENT_LIBS@
|
|
||||||
LIBMODBUS_CFLAGS = @LIBMODBUS_CFLAGS@
|
|
||||||
LIBMODBUS_LDFLAGS = @LIBMODBUS_LDFLAGS@
|
|
||||||
LIBMODBUS_LIBS = @LIBMODBUS_LIBS@
|
|
||||||
LIBOBJS = @LIBOBJS@
|
|
||||||
LIBPCRE2_CFLAGS = @LIBPCRE2_CFLAGS@
|
|
||||||
LIBPCRE2_LDFLAGS = @LIBPCRE2_LDFLAGS@
|
|
||||||
LIBPCRE2_LIBS = @LIBPCRE2_LIBS@
|
|
||||||
LIBPTHREAD_CFLAGS = @LIBPTHREAD_CFLAGS@
|
|
||||||
LIBPTHREAD_LDFLAGS = @LIBPTHREAD_LDFLAGS@
|
|
||||||
LIBPTHREAD_LIBS = @LIBPTHREAD_LIBS@
|
|
||||||
LIBS = @LIBS@
|
|
||||||
LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
|
|
||||||
LIBXML2_LDFLAGS = @LIBXML2_LDFLAGS@
|
|
||||||
LIBXML2_LIBS = @LIBXML2_LIBS@
|
|
||||||
LIBXML2_VERSION = @LIBXML2_VERSION@
|
|
||||||
LOAD_MODULE_PATH = @LOAD_MODULE_PATH@
|
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
|
||||||
MAKEINFO = @MAKEINFO@
|
|
||||||
MKDIR_P = @MKDIR_P@
|
|
||||||
MYSQL_CFLAGS = @MYSQL_CFLAGS@
|
|
||||||
MYSQL_CONFIG = @MYSQL_CONFIG@
|
|
||||||
MYSQL_LDFLAGS = @MYSQL_LDFLAGS@
|
|
||||||
MYSQL_LIBS = @MYSQL_LIBS@
|
|
||||||
MYSQL_VERSION = @MYSQL_VERSION@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
ODBC_CONFIG = @ODBC_CONFIG@
|
|
||||||
OPENIPMI_CFLAGS = @OPENIPMI_CFLAGS@
|
|
||||||
OPENIPMI_LDFLAGS = @OPENIPMI_LDFLAGS@
|
|
||||||
OPENIPMI_LIBS = @OPENIPMI_LIBS@
|
|
||||||
OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
|
|
||||||
OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@
|
|
||||||
OPENSSL_LIBS = @OPENSSL_LIBS@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
|
||||||
PACKAGE_NAME = @PACKAGE_NAME@
|
|
||||||
PACKAGE_STRING = @PACKAGE_STRING@
|
|
||||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
PG_CONFIG = @PG_CONFIG@
|
|
||||||
PKG_CONFIG = @PKG_CONFIG@
|
|
||||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
|
||||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
|
||||||
POSTGRESQL_CFLAGS = @POSTGRESQL_CFLAGS@
|
|
||||||
POSTGRESQL_LDFLAGS = @POSTGRESQL_LDFLAGS@
|
|
||||||
POSTGRESQL_LIBS = @POSTGRESQL_LIBS@
|
|
||||||
POSTGRESQL_VERSION = @POSTGRESQL_VERSION@
|
|
||||||
POW_LIB = @POW_LIB@
|
|
||||||
PROXY_CONFIG_FILE = @PROXY_CONFIG_FILE@
|
|
||||||
PROXY_LDFLAGS = @PROXY_LDFLAGS@
|
|
||||||
PROXY_LIBS = @PROXY_LIBS@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
RESOLV_LIBS = @RESOLV_LIBS@
|
|
||||||
SENDER_LDFLAGS = @SENDER_LDFLAGS@
|
|
||||||
SENDER_LIBS = @SENDER_LIBS@
|
|
||||||
SERVER_CONFIG_FILE = @SERVER_CONFIG_FILE@
|
|
||||||
SERVER_LDFLAGS = @SERVER_LDFLAGS@
|
|
||||||
SERVER_LIBS = @SERVER_LIBS@
|
|
||||||
SET_MAKE = @SET_MAKE@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
SNMP_CFLAGS = @SNMP_CFLAGS@
|
|
||||||
SNMP_LDFLAGS = @SNMP_LDFLAGS@
|
|
||||||
SNMP_LIBS = @SNMP_LIBS@
|
|
||||||
SQLITE3_CPPFLAGS = @SQLITE3_CPPFLAGS@
|
|
||||||
SQLITE3_LDFLAGS = @SQLITE3_LDFLAGS@
|
|
||||||
SQLITE3_LIBS = @SQLITE3_LIBS@
|
|
||||||
SQLITE3_VERSION = @SQLITE3_VERSION@
|
|
||||||
SSH2_CFLAGS = @SSH2_CFLAGS@
|
|
||||||
SSH2_LDFLAGS = @SSH2_LDFLAGS@
|
|
||||||
SSH2_LIBS = @SSH2_LIBS@
|
|
||||||
SSH_CFLAGS = @SSH_CFLAGS@
|
|
||||||
SSH_LDFLAGS = @SSH_LDFLAGS@
|
|
||||||
SSH_LIBS = @SSH_LIBS@
|
|
||||||
STRIP = @STRIP@
|
|
||||||
TLS_CFLAGS = @TLS_CFLAGS@
|
|
||||||
TLS_LDFLAGS = @TLS_LDFLAGS@
|
|
||||||
TLS_LIBS = @TLS_LIBS@
|
|
||||||
UNIXODBC_CFLAGS = @UNIXODBC_CFLAGS@
|
|
||||||
UNIXODBC_LDFLAGS = @UNIXODBC_LDFLAGS@
|
|
||||||
UNIXODBC_LIBS = @UNIXODBC_LIBS@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
WEBSERVICE_CONFIG_FILE = @WEBSERVICE_CONFIG_FILE@
|
|
||||||
ZBXGET_LDFLAGS = @ZBXGET_LDFLAGS@
|
|
||||||
ZBXGET_LIBS = @ZBXGET_LIBS@
|
|
||||||
ZBXJS_LDFLAGS = @ZBXJS_LDFLAGS@
|
|
||||||
ZBXJS_LIBS = @ZBXJS_LIBS@
|
|
||||||
ZLIB_CFLAGS = @ZLIB_CFLAGS@
|
|
||||||
ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
|
|
||||||
ZLIB_LIBS = @ZLIB_LIBS@
|
|
||||||
_libcurl_config = @_libcurl_config@
|
|
||||||
_libnetsnmp_config = @_libnetsnmp_config@
|
|
||||||
_libnetsnmp_config_bin = @_libnetsnmp_config_bin@
|
|
||||||
_libnetsnmp_config_root = @_libnetsnmp_config_root@
|
|
||||||
abs_builddir = @abs_builddir@
|
|
||||||
abs_srcdir = @abs_srcdir@
|
|
||||||
abs_top_builddir = @abs_top_builddir@
|
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
|
||||||
ac_ct_CC = @ac_ct_CC@
|
|
||||||
ac_ct_CXX = @ac_ct_CXX@
|
|
||||||
am__include = @am__include@
|
|
||||||
am__leading_dot = @am__leading_dot@
|
|
||||||
am__quote = @am__quote@
|
|
||||||
am__rm_f_notfound = @am__rm_f_notfound@
|
|
||||||
am__tar = @am__tar@
|
|
||||||
am__untar = @am__untar@
|
|
||||||
am__xargs_n = @am__xargs_n@
|
|
||||||
bindir = @bindir@
|
|
||||||
build = @build@
|
|
||||||
build_alias = @build_alias@
|
|
||||||
build_cpu = @build_cpu@
|
|
||||||
build_os = @build_os@
|
|
||||||
build_vendor = @build_vendor@
|
|
||||||
builddir = @builddir@
|
|
||||||
datadir = @datadir@
|
|
||||||
datarootdir = @datarootdir@
|
|
||||||
docdir = @docdir@
|
|
||||||
dvidir = @dvidir@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
host = @host@
|
|
||||||
host_alias = @host_alias@
|
|
||||||
host_cpu = @host_cpu@
|
|
||||||
host_os = @host_os@
|
|
||||||
host_vendor = @host_vendor@
|
|
||||||
htmldir = @htmldir@
|
|
||||||
includedir = @includedir@
|
|
||||||
infodir = @infodir@
|
|
||||||
install_sh = @install_sh@
|
|
||||||
libdir = @libdir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
localedir = @localedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
mandir = @mandir@
|
|
||||||
mkdir_p = @mkdir_p@
|
|
||||||
oldincludedir = @oldincludedir@
|
|
||||||
pdfdir = @pdfdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
program_transform_name = @program_transform_name@
|
|
||||||
psdir = @psdir@
|
|
||||||
runstatedir = @runstatedir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
srcdir = @srcdir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
target_alias = @target_alias@
|
|
||||||
top_build_prefix = @top_build_prefix@
|
|
||||||
top_builddir = @top_builddir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
PATCHES = \
|
|
||||||
history_upgrade_prepare.sql
|
|
||||||
|
|
||||||
EXTRA_DIST = $(PATCHES)
|
|
||||||
all: all-am
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
|
||||||
@for dep in $?; do \
|
|
||||||
case '$(am__configure_deps)' in \
|
|
||||||
*$$dep*) \
|
|
||||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
|
||||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu database/postgresql/option-patches/Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu database/postgresql/option-patches/Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
@case '$?' in \
|
|
||||||
*config.status*) \
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
|
||||||
*) \
|
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
|
||||||
esac;
|
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
|
|
||||||
$(top_srcdir)/configure: $(am__configure_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(am__aclocal_m4_deps):
|
|
||||||
tags TAGS:
|
|
||||||
|
|
||||||
ctags CTAGS:
|
|
||||||
|
|
||||||
cscope cscopelist:
|
|
||||||
|
|
||||||
distdir: $(BUILT_SOURCES)
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
|
||||||
|
|
||||||
distdir-am: $(DISTFILES)
|
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
list='$(DISTFILES)'; \
|
|
||||||
dist_files=`for file in $$list; do echo $$file; done | \
|
|
||||||
sed -e "s|^$$srcdirstrip/||;t" \
|
|
||||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
|
||||||
case $$dist_files in \
|
|
||||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
|
||||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
|
||||||
sort -u` ;; \
|
|
||||||
esac; \
|
|
||||||
for file in $$dist_files; do \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test -d "$(distdir)/$$file"; then \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
|
||||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
else \
|
|
||||||
test -f "$(distdir)/$$file" \
|
|
||||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
check-am: all-am
|
|
||||||
check: check-am
|
|
||||||
all-am: Makefile
|
|
||||||
installdirs:
|
|
||||||
install: install-am
|
|
||||||
install-exec: install-exec-am
|
|
||||||
install-data: install-data-am
|
|
||||||
uninstall: uninstall-am
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-am
|
|
||||||
install-strip:
|
|
||||||
if test -z '$(STRIP)'; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
install; \
|
|
||||||
else \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
|
||||||
fi
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-$(am__rm_f) $(CONFIG_CLEAN_FILES)
|
|
||||||
-test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
@DBSCHEMA_FALSE@clean: clean-am
|
|
||||||
|
|
||||||
clean-am: clean-generic mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-generic
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-am
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am:
|
|
||||||
|
|
||||||
install-dvi: install-dvi-am
|
|
||||||
|
|
||||||
install-dvi-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-html: install-html-am
|
|
||||||
|
|
||||||
install-html-am:
|
|
||||||
|
|
||||||
install-info: install-info-am
|
|
||||||
|
|
||||||
install-info-am:
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
install-pdf: install-pdf-am
|
|
||||||
|
|
||||||
install-pdf-am:
|
|
||||||
|
|
||||||
install-ps: install-ps-am
|
|
||||||
|
|
||||||
install-ps-am:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-am
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic
|
|
||||||
|
|
||||||
pdf: pdf-am
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-am
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am:
|
|
||||||
|
|
||||||
.MAKE: install-am install-strip
|
|
||||||
|
|
||||||
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
|
|
||||||
ctags-am distclean distclean-generic distdir dvi dvi-am html \
|
|
||||||
html-am info info-am install install-am install-data \
|
|
||||||
install-data-am install-dvi install-dvi-am install-exec \
|
|
||||||
install-exec-am install-html install-html-am install-info \
|
|
||||||
install-info-am install-man install-pdf install-pdf-am \
|
|
||||||
install-ps install-ps-am install-strip installcheck \
|
|
||||||
installcheck-am installdirs maintainer-clean \
|
|
||||||
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
|
|
||||||
pdf-am ps ps-am tags-am uninstall uninstall-am
|
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
|
|
||||||
@DBSCHEMA_TRUE@all: $(PATCHES)
|
|
||||||
|
|
||||||
@DBSCHEMA_TRUE@history_upgrade_prepare.sql: $(top_srcdir)/create/bin/gen_history_upgrade.pl
|
|
||||||
@DBSCHEMA_TRUE@ $(top_srcdir)/create/bin/gen_history_upgrade.pl postgresql > $@
|
|
||||||
|
|
||||||
@DBSCHEMA_TRUE@clean:
|
|
||||||
@DBSCHEMA_TRUE@ rm -f history_upgrade_prepare.sql
|
|
||||||
|
|
||||||
.PHONY: all clean
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
||||||
|
|
||||||
# Tell GNU make to disable its built-in pattern rules.
|
|
||||||
%:: %,v
|
|
||||||
%:: RCS/%,v
|
|
||||||
%:: RCS/%
|
|
||||||
%:: s.%
|
|
||||||
%:: SCCS/s.%
|
|
||||||
Reference in New Issue
Block a user