aboutsummaryrefslogtreecommitdiffstats
path: root/nms/nms-dump.sql
diff options
context:
space:
mode:
Diffstat (limited to 'nms/nms-dump.sql')
-rw-r--r--nms/nms-dump.sql190
1 files changed, 163 insertions, 27 deletions
diff --git a/nms/nms-dump.sql b/nms/nms-dump.sql
index bbe141d..25ba3ac 100644
--- a/nms/nms-dump.sql
+++ b/nms/nms-dump.sql
@@ -44,17 +44,18 @@ SET default_tablespace = '';
SET default_with_oids = false;
--
--- Name: dhcp; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
+-- Name: dhcp; Type: TABLE; Schema: public; Owner: nms; Tablespace:
--
CREATE TABLE dhcp (
switch integer,
- "time" timestamp without time zone,
- mac macaddr
+ "time" timestamp with time zone,
+ mac macaddr,
+ ip inet
);
-ALTER TABLE dhcp OWNER TO postgres;
+ALTER TABLE dhcp OWNER TO nms;
--
-- Name: linknet_ping; Type: TABLE; Schema: public; Owner: nms; Tablespace:
@@ -77,9 +78,11 @@ ALTER TABLE linknet_ping OWNER TO nms;
CREATE TABLE linknets (
linknet integer NOT NULL,
switch1 integer NOT NULL,
- addr1 inet NOT NULL,
+ addr1 inet,
switch2 integer NOT NULL,
- addr2 inet NOT NULL
+ addr2 inet,
+ port1 character varying(10),
+ port2 character varying(10)
);
@@ -162,7 +165,7 @@ CREATE TABLE seen_mac (
ALTER TABLE seen_mac OWNER TO nms;
--
--- Name: snmp; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
+-- Name: snmp; Type: TABLE; Schema: public; Owner: nms; Tablespace:
--
CREATE TABLE snmp (
@@ -176,7 +179,7 @@ CREATE TABLE snmp (
ALTER TABLE snmp OWNER TO nms;
--
--- Name: snmp_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
+-- Name: snmp_id_seq; Type: SEQUENCE; Schema: public; Owner: nms
--
CREATE SEQUENCE snmp_id_seq
@@ -190,7 +193,7 @@ CREATE SEQUENCE snmp_id_seq
ALTER TABLE snmp_id_seq OWNER TO nms;
--
--- Name: snmp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
+-- Name: snmp_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: nms
--
ALTER SEQUENCE snmp_id_seq OWNED BY snmp.id;
@@ -252,19 +255,26 @@ ALTER TABLE switch_temp OWNER TO nms;
CREATE TABLE switches (
switch integer DEFAULT nextval(('"switches_switch_seq"'::text)::regclass) NOT NULL,
- ip inet,
+ mgmt_v4_addr inet,
sysname character varying NOT NULL,
switchtype character varying DEFAULT 'ex2200'::character varying NOT NULL,
last_updated timestamp with time zone,
locked boolean DEFAULT false NOT NULL,
poll_frequency interval DEFAULT '00:01:00'::interval NOT NULL,
- community character varying DEFAULT 'public'::character varying NOT NULL,
+ community character varying DEFAULT 'FullPuppTilNMS'::character varying NOT NULL,
lldp_chassis_id character varying,
- secondary_ip inet,
+ mgmt_v6_addr inet,
placement box,
subnet4 cidr,
subnet6 cidr,
- distro character varying
+ distro_name character varying,
+ distro_phy_port character varying(100),
+ mgmt_v6_gw inet,
+ mgmt_v4_gw inet,
+ mgmt_vlan integer DEFAULT 666,
+ traffic_vlan integer,
+ last_config_fetch timestamp with time zone,
+ current_mac macaddr
);
@@ -285,6 +295,17 @@ CREATE SEQUENCE switches_switch_seq
ALTER TABLE switches_switch_seq OWNER TO nms;
--
+-- Name: test_table; Type: TABLE; Schema: public; Owner: nms; Tablespace:
+--
+
+CREATE TABLE test_table (
+ test timestamp with time zone
+);
+
+
+ALTER TABLE test_table OWNER TO nms;
+
+--
-- Name: linknet; Type: DEFAULT; Schema: public; Owner: nms
--
@@ -292,7 +313,7 @@ ALTER TABLE ONLY linknets ALTER COLUMN linknet SET DEFAULT nextval('linknets_lin
--
--- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
+-- Name: id; Type: DEFAULT; Schema: public; Owner: nms
--
ALTER TABLE ONLY snmp ALTER COLUMN id SET DEFAULT nextval('snmp_id_seq'::regclass);
@@ -354,14 +375,28 @@ ALTER TABLE ONLY switches
--
--- Name: dhcp_switch; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
+-- Name: dhcp_ip; Type: INDEX; Schema: public; Owner: nms; Tablespace:
+--
+
+CREATE INDEX dhcp_ip ON dhcp USING btree (ip);
+
+
+--
+-- Name: dhcp_mac; Type: INDEX; Schema: public; Owner: nms; Tablespace:
+--
+
+CREATE INDEX dhcp_mac ON dhcp USING btree (mac);
+
+
+--
+-- Name: dhcp_switch; Type: INDEX; Schema: public; Owner: nms; Tablespace:
--
CREATE INDEX dhcp_switch ON dhcp USING btree (switch);
--
--- Name: dhcp_time; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
+-- Name: dhcp_time; Type: INDEX; Schema: public; Owner: nms; Tablespace:
--
CREATE INDEX dhcp_time ON dhcp USING btree ("time");
@@ -375,6 +410,13 @@ CREATE INDEX ping_index ON ping USING btree ("time");
--
+-- Name: ping_secondary_index; Type: INDEX; Schema: public; Owner: nms; Tablespace:
+--
+
+CREATE INDEX ping_secondary_index ON ping_secondary_ip USING btree ("time");
+
+
+--
-- Name: polls_ifname; Type: INDEX; Schema: public; Owner: nms; Tablespace:
--
@@ -417,21 +459,21 @@ CREATE INDEX seen_mac_seen ON seen_mac USING btree (seen);
--
--- Name: snmp_time; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
+-- Name: snmp_time; Type: INDEX; Schema: public; Owner: nms; Tablespace:
--
CREATE INDEX snmp_time ON snmp USING btree ("time");
--
--- Name: snmp_time15; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
+-- Name: snmp_time15; Type: INDEX; Schema: public; Owner: nms; Tablespace:
--
CREATE INDEX snmp_time15 ON snmp USING btree (id, switch);
--
--- Name: snmp_time6; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
+-- Name: snmp_time6; Type: INDEX; Schema: public; Owner: nms; Tablespace:
--
CREATE INDEX snmp_time6 ON snmp USING btree ("time" DESC, switch);
@@ -466,7 +508,7 @@ CREATE INDEX updated_index3 ON ping_secondary_ip USING btree ("time");
--
--- Name: dhcp_switch_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
+-- Name: dhcp_switch_fkey; Type: FK CONSTRAINT; Schema: public; Owner: nms
--
ALTER TABLE ONLY dhcp
@@ -474,7 +516,7 @@ ALTER TABLE ONLY dhcp
--
--- Name: snmp_switch_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
+-- Name: snmp_switch_fkey; Type: FK CONSTRAINT; Schema: public; Owner: nms
--
ALTER TABLE ONLY snmp
@@ -513,6 +555,67 @@ REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
+GRANT ALL ON SCHEMA public TO fap;
+
+
+--
+-- Name: dhcp; Type: ACL; Schema: public; Owner: nms
+--
+
+REVOKE ALL ON TABLE dhcp FROM PUBLIC;
+REVOKE ALL ON TABLE dhcp FROM nms;
+GRANT ALL ON TABLE dhcp TO nms;
+GRANT ALL ON TABLE dhcp TO fap;
+
+
+--
+-- Name: linknet_ping; Type: ACL; Schema: public; Owner: nms
+--
+
+REVOKE ALL ON TABLE linknet_ping FROM PUBLIC;
+REVOKE ALL ON TABLE linknet_ping FROM nms;
+GRANT ALL ON TABLE linknet_ping TO nms;
+GRANT ALL ON TABLE linknet_ping TO fap;
+
+
+--
+-- Name: linknets; Type: ACL; Schema: public; Owner: nms
+--
+
+REVOKE ALL ON TABLE linknets FROM PUBLIC;
+REVOKE ALL ON TABLE linknets FROM nms;
+GRANT ALL ON TABLE linknets TO nms;
+GRANT ALL ON TABLE linknets TO fap;
+
+
+--
+-- Name: ping; Type: ACL; Schema: public; Owner: nms
+--
+
+REVOKE ALL ON TABLE ping FROM PUBLIC;
+REVOKE ALL ON TABLE ping FROM nms;
+GRANT ALL ON TABLE ping TO nms;
+GRANT ALL ON TABLE ping TO fap;
+
+
+--
+-- Name: ping_secondary_ip; Type: ACL; Schema: public; Owner: nms
+--
+
+REVOKE ALL ON TABLE ping_secondary_ip FROM PUBLIC;
+REVOKE ALL ON TABLE ping_secondary_ip FROM nms;
+GRANT ALL ON TABLE ping_secondary_ip TO nms;
+GRANT ALL ON TABLE ping_secondary_ip TO fap;
+
+
+--
+-- Name: polls; Type: ACL; Schema: public; Owner: nms
+--
+
+REVOKE ALL ON TABLE polls FROM PUBLIC;
+REVOKE ALL ON TABLE polls FROM nms;
+GRANT ALL ON TABLE polls TO nms;
+GRANT ALL ON TABLE polls TO fap;
--
@@ -522,26 +625,48 @@ GRANT ALL ON SCHEMA public TO PUBLIC;
REVOKE ALL ON TABLE seen_mac FROM PUBLIC;
REVOKE ALL ON TABLE seen_mac FROM nms;
GRANT ALL ON TABLE seen_mac TO nms;
+GRANT ALL ON TABLE seen_mac TO fap;
--
--- Name: snmp; Type: ACL; Schema: public; Owner: postgres
+-- Name: snmp; Type: ACL; Schema: public; Owner: nms
--
REVOKE ALL ON TABLE snmp FROM PUBLIC;
-REVOKE ALL ON TABLE snmp FROM postgres;
-GRANT ALL ON TABLE snmp TO postgres;
+REVOKE ALL ON TABLE snmp FROM nms;
GRANT ALL ON TABLE snmp TO nms;
+GRANT ALL ON TABLE snmp TO postgres;
+GRANT ALL ON TABLE snmp TO fap;
--
--- Name: snmp_id_seq; Type: ACL; Schema: public; Owner: postgres
+-- Name: snmp_id_seq; Type: ACL; Schema: public; Owner: nms
--
REVOKE ALL ON SEQUENCE snmp_id_seq FROM PUBLIC;
-REVOKE ALL ON SEQUENCE snmp_id_seq FROM postgres;
-GRANT ALL ON SEQUENCE snmp_id_seq TO postgres;
+REVOKE ALL ON SEQUENCE snmp_id_seq FROM nms;
GRANT ALL ON SEQUENCE snmp_id_seq TO nms;
+GRANT ALL ON SEQUENCE snmp_id_seq TO postgres;
+
+
+--
+-- Name: switch_comments; Type: ACL; Schema: public; Owner: nms
+--
+
+REVOKE ALL ON TABLE switch_comments FROM PUBLIC;
+REVOKE ALL ON TABLE switch_comments FROM nms;
+GRANT ALL ON TABLE switch_comments TO nms;
+GRANT ALL ON TABLE switch_comments TO fap;
+
+
+--
+-- Name: switch_temp; Type: ACL; Schema: public; Owner: nms
+--
+
+REVOKE ALL ON TABLE switch_temp FROM PUBLIC;
+REVOKE ALL ON TABLE switch_temp FROM nms;
+GRANT ALL ON TABLE switch_temp TO nms;
+GRANT ALL ON TABLE switch_temp TO fap;
--
@@ -551,6 +676,17 @@ GRANT ALL ON SEQUENCE snmp_id_seq TO nms;
REVOKE ALL ON TABLE switches FROM PUBLIC;
REVOKE ALL ON TABLE switches FROM nms;
GRANT ALL ON TABLE switches TO nms;
+GRANT ALL ON TABLE switches TO fap;
+
+
+--
+-- Name: test_table; Type: ACL; Schema: public; Owner: nms
+--
+
+REVOKE ALL ON TABLE test_table FROM PUBLIC;
+REVOKE ALL ON TABLE test_table FROM nms;
+GRANT ALL ON TABLE test_table TO nms;
+GRANT ALL ON TABLE test_table TO fap;
--