--
-- PostgreSQL database dump
--

SET client_encoding = 'SQL_ASCII';
SET check_function_bodies = false;
SET client_min_messages = warning;

--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--

COMMENT ON SCHEMA public IS 'Standard public schema';


--
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: 
--

CREATE PROCEDURAL LANGUAGE plpgsql;


SET search_path = public, pg_catalog;

--
-- Name: datarate; Type: TYPE; Schema: public; Owner: sesse
--

CREATE TYPE datarate AS (
	switch integer,
	port integer,
	bytes_in double precision,
	bytes_out double precision
);


ALTER TYPE public.datarate OWNER TO sesse;

--
-- Name: get_current_datarate(); Type: FUNCTION; Schema: public; Owner: nms
--

CREATE FUNCTION get_current_datarate() RETURNS SETOF datarate
    AS $$
DECLARE
        num_entries INTEGER;
        poll polls;
        first_poll polls;
        last_poll polls;
        timediff float;
        ret datarate;
BEGIN
        num_entries := 0;
        last_poll.switch := -1;

        FOR poll IN select * from polls where time >= now() - '15 minutes'::interval and time < now() order by switch,port,time LOOP
                IF poll.switch <> last_poll.switch OR poll.port <> last_poll.port THEN
                        IF num_entries >= 2 THEN
                                timediff := EXTRACT(epoch from last_poll.time - first_poll.time);
                                ret.switch := last_poll.switch;
                                ret.port := last_poll.port;

                                IF last_poll.bytes_in >= first_poll.bytes_in AND last_poll.bytes_out >= first_poll.bytes_out THEN
                                        ret.bytes_in := (last_poll.bytes_in - first_poll.bytes_in) / timediff;
                                        ret.bytes_out := (last_poll.bytes_out - first_poll.bytes_out) / timediff;
                                        return next ret; 
                                END IF;
                        END IF;
                        num_entries := 0;
                ELSE
                        -- reset if we have wraparound
                        IF last_poll.bytes_in < first_poll.bytes_in OR
                           last_poll.bytes_out < first_poll.bytes_out THEN
                                num_entries := 0;
                        END IF;
                END IF;

                num_entries := num_entries + 1;
                IF num_entries = 1 THEN
                        first_poll.switch := poll.switch;
                        first_poll.port := poll.port;
                        first_poll.time := poll.time;
                        first_poll.bytes_in := poll.bytes_in;
                        first_poll.bytes_out := poll.bytes_out;
                END IF;

                last_poll.switch := poll.switch;
                last_poll.port := poll.port;
                last_poll.time := poll.time;
                last_poll.bytes_in := poll.bytes_in;
                last_poll.bytes_out := poll.bytes_out;
        END LOOP;

        -- last
        IF num_entries >= 2 THEN
                timediff := EXTRACT(epoch from last_poll.time - first_poll.time);
                ret.switch := last_poll.switch;
                ret.port := last_poll.port;

                IF last_poll.bytes_in >= first_poll.bytes_in AND
                   last_poll.bytes_out >= first_poll.bytes_out THEN
                        ret.bytes_in := (last_poll.bytes_in - first_poll.bytes_in) / timediff;
                        ret.bytes_out := (last_poll.bytes_out - first_poll.bytes_out) / timediff;
                        return next ret; 
                END IF;
        END IF;

        RETURN;
END;
$$
    LANGUAGE plpgsql;


ALTER FUNCTION public.get_current_datarate() OWNER TO nms;

--
-- Name: get_datarate(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION get_datarate() RETURNS SETOF datarate
    AS $$
DECLARE
        num_entries INTEGER;
        poll polls;
        second_last_poll polls;
        last_poll polls;
        timediff float;
        ret datarate;
BEGIN
        num_entries := 0;
        last_poll.switch = -1;

        FOR poll IN select * from polls where time >= now() - '15 minutes'::interval and time < now() order by switch,port,time LOOP
                IF poll.switch <> last_poll.switch OR poll.port <> last_poll.port THEN
                        IF num_entries >= 2 THEN
                                timediff := EXTRACT(epoch from last_poll.time - second_last_poll.time);
                                ret.switch := last_poll.switch;
                                ret.port := last_poll.port;
                                
                                IF last_poll.bytes_in < second_last_poll.bytes_in THEN
                                        second_last_poll.bytes_in = 0;
                                END IF;
                                IF last_poll.bytes_out < second_last_poll.bytes_out THEN
                                        second_last_poll.bytes_out = 0;
                                END IF;

                                ret.bytes_in := (last_poll.bytes_in - second_last_poll.bytes_in) / timediff;
                                ret.bytes_out := (last_poll.bytes_out - second_last_poll.bytes_out) / timediff;
                                return next ret;
                        ELSIF num_entries = 1 THEN
                                ret.switch := last_poll.switch;
                                ret.port := last_poll.port;
                                ret.bytes_in := -1;
                                ret.bytes_out := -1;
                                return next ret;
                        END IF;
                        num_entries := 1;
                ELSE
                        num_entries := num_entries + 1;
                END IF;
                second_last_poll.switch := last_poll.switch;
                second_last_poll.port := last_poll.port;
                second_last_poll.time := last_poll.time;
                second_last_poll.bytes_in := last_poll.bytes_in;
                second_last_poll.bytes_out := last_poll.bytes_out;
                last_poll.switch := poll.switch;
                last_poll.port := poll.port;
                last_poll.time := poll.time;
                last_poll.bytes_in := poll.bytes_in;
                last_poll.bytes_out := poll.bytes_out;
        END LOOP;
       -- pah, and once more, for the last switch/port...
        IF num_entries >= 2 THEN
                timediff := EXTRACT(epoch from last_poll.time - second_last_poll.time);
                ret.switch := last_poll.switch;
                ret.port := last_poll.port;
                
                IF last_poll.bytes_in < second_last_poll.bytes_in THEN
                        second_last_poll.bytes_in = 0;
                END IF;
                IF last_poll.bytes_out < second_last_poll.bytes_out THEN
                        second_last_poll.bytes_out = 0;
                END IF;

                ret.bytes_in := (last_poll.bytes_in - second_last_poll.bytes_in) / timediff;
                ret.bytes_out := (last_poll.bytes_out - second_last_poll.bytes_out) / timediff;
                return next ret;
        ELSIF num_entries = 1 THEN
                ret.switch := last_poll.switch;
                ret.port := last_poll.port;
                ret.bytes_in := -1;
                ret.bytes_out := -1;
                return next ret;
        END IF;
        
        RETURN;
END;
$$
    LANGUAGE plpgsql;


ALTER FUNCTION public.get_datarate() OWNER TO postgres;

--
-- Name: plpgsql_call_handler(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler
    AS '$libdir/plpgsql', 'plpgsql_call_handler'
    LANGUAGE c;


ALTER FUNCTION public.plpgsql_call_handler() OWNER TO postgres;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: cpuloadpoll; Type: TABLE; Schema: public; Owner: sesse; Tablespace: 
--

CREATE TABLE cpuloadpoll (
    id serial NOT NULL,
    "time" timestamp without time zone NOT NULL,
    switch integer NOT NULL,
    entity integer NOT NULL,
    value integer NOT NULL
);


ALTER TABLE public.cpuloadpoll OWNER TO sesse;

--
-- Name: cpuloadpoll_id_seq; Type: SEQUENCE SET; Schema: public; Owner: sesse
--



--
-- Name: dhcp; Type: TABLE; Schema: public; Owner: sesse; Tablespace: 
--

CREATE TABLE dhcp (
    switch integer NOT NULL,
    network cidr NOT NULL,
    last_ack timestamp without time zone
);


ALTER TABLE public.dhcp OWNER TO sesse;

--
-- Name: placements; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE placements (
    switch integer NOT NULL,
    placement box NOT NULL
);


ALTER TABLE public.placements OWNER TO postgres;

--
-- Name: polls; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE polls (
    "time" timestamp with time zone NOT NULL,
    switch integer NOT NULL,
    port integer NOT NULL,
    bytes_in bigint NOT NULL,
    bytes_out bigint NOT NULL,
    errors_in bigint NOT NULL,
    errors_out bigint NOT NULL
);
ALTER TABLE ONLY polls ALTER COLUMN "time" SET STATISTICS 100;


ALTER TABLE public.polls OWNER TO postgres;

--
-- Name: polls_poll_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE polls_poll_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.polls_poll_seq OWNER TO postgres;

--
-- Name: polls_poll_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('polls_poll_seq', 1, false);


SET default_with_oids = true;

--
-- Name: portnames; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE portnames (
    switchtype character varying NOT NULL,
    port integer NOT NULL,
    description character varying NOT NULL
);


ALTER TABLE public.portnames OWNER TO postgres;

--
-- Name: squeue; Type: TABLE; Schema: public; Owner: nms; Tablespace: 
--

CREATE TABLE squeue (
    id integer DEFAULT nextval(('squeue_sequence'::text)::regclass) NOT NULL,
    gid integer NOT NULL,
    added timestamp with time zone NOT NULL,
    updated timestamp with time zone,
    addr inet,
    cmd character varying NOT NULL,
    locked boolean DEFAULT false NOT NULL,
    processed boolean DEFAULT false NOT NULL,
    disabled boolean DEFAULT false NOT NULL,
    priority integer DEFAULT 3,
    sysname character varying NOT NULL,
    author character varying NOT NULL,
    result character varying,
    delay timestamp with time zone,
    delaytime interval DEFAULT '00:01:00'::interval
);


ALTER TABLE public.squeue OWNER TO nms;

--
-- Name: squeue_group_sequence; Type: SEQUENCE; Schema: public; Owner: nms
--

CREATE SEQUENCE squeue_group_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.squeue_group_sequence OWNER TO nms;

--
-- Name: squeue_group_sequence; Type: SEQUENCE SET; Schema: public; Owner: nms
--



--
-- Name: squeue_sequence; Type: SEQUENCE; Schema: public; Owner: nms
--

CREATE SEQUENCE squeue_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.squeue_sequence OWNER TO nms;

--
-- Name: squeue_sequence; Type: SEQUENCE SET; Schema: public; Owner: nms
--

SELECT pg_catalog.setval('squeue_sequence', 901, true);


--
-- Name: stemppoll_sequence; Type: SEQUENCE; Schema: public; Owner: nms
--

CREATE SEQUENCE stemppoll_sequence
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.stemppoll_sequence OWNER TO nms;

--
-- Name: stemppoll_sequence; Type: SEQUENCE SET; Schema: public; Owner: nms
--

SELECT pg_catalog.setval('stemppoll_sequence', 182534, true);


SET default_with_oids = false;

--
-- Name: switches; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE switches (
    switch integer DEFAULT nextval(('"switches_switch_seq"'::text)::regclass) NOT NULL,
    ip inet NOT NULL,
    sysname character varying NOT NULL,
    switchtype character varying NOT NULL,
    last_updated timestamp with time zone,
    locked boolean DEFAULT false NOT NULL,
    priority integer DEFAULT 0 NOT NULL,
    poll_frequency interval DEFAULT '00:05:00'::interval NOT NULL,
    community character varying DEFAULT 'public'::character varying NOT NULL
);


ALTER TABLE public.switches OWNER TO postgres;

--
-- Name: switches_switch_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE switches_switch_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.switches_switch_seq OWNER TO postgres;

--
-- Name: switches_switch_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('switches_switch_seq', 225, true);


--
-- Name: switchtypes; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE switchtypes (
    switchtype character varying NOT NULL,
    ports character varying NOT NULL,
    wide_counters boolean DEFAULT false NOT NULL
);


ALTER TABLE public.switchtypes OWNER TO postgres;

SET default_with_oids = true;

--
-- Name: temppoll; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE temppoll (
    id integer DEFAULT nextval(('stemppoll_sequence'::text)::regclass) NOT NULL,
    "time" timestamp without time zone NOT NULL,
    switch integer NOT NULL,
    "temp" double precision
);


ALTER TABLE public.temppoll OWNER TO postgres;


--
-- Data for Name: portnames; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY portnames (switchtype, port, description) FROM stdin;
blackdiamond	1001	BD6808/G8Xi-Port 1:1
blackdiamond	1002	BD6808/G8Xi-Port 1:2
blackdiamond	1003	BD6808/G8Xi-Port 1:3
blackdiamond	1004	BD6808/G8Xi-Port 1:4
blackdiamond	1005	BD6808/G8Xi-Port 1:5
blackdiamond	1006	BD6808/G8Xi-Port 1:6
blackdiamond	1007	BD6808/G8Xi-Port 1:7
blackdiamond	4001	BD6808/G16X3-Port 4:1
blackdiamond	4002	BD6808/G16X3-Port 4:2
blackdiamond	4003	BD6808/G16X3-Port 4:3
blackdiamond	4004	BD6808/G16X3-Port 4:4
blackdiamond	4005	BD6808/G16X3-Port 4:5
blackdiamond	4006	BD6808/G16X3-Port 4:6
blackdiamond	4007	BD6808/G16X3-Port 4:7
blackdiamond	4008	BD6808/G16X3-Port 4:8
blackdiamond	4009	BD6808/G16X3-Port 4:9
blackdiamond	4010	BD6808/G16X3-Port 4:10
blackdiamond	4011	BD6808/G16X3-Port 4:11
blackdiamond	4012	BD6808/G16X3-Port 4:12
blackdiamond	4013	BD6808/G16X3-Port 4:13
blackdiamond	4014	BD6808/G16X3-Port 4:14
blackdiamond	4015	BD6808/G16X3-Port 4:15
blackdiamond	4016	BD6808/G16X3-Port 4:16
blackdiamond	5001	BD6808/G24T3-Port 5:1
blackdiamond	5002	BD6808/G24T3-Port 5:2
blackdiamond	5003	BD6808/G24T3-Port 5:3
blackdiamond	5004	BD6808/G24T3-Port 5:4
blackdiamond	5005	BD6808/G24T3-Port 5:5
blackdiamond	5006	BD6808/G24T3-Port 5:6
blackdiamond	5007	BD6808/G24T3-Port 5:7
blackdiamond	5008	BD6808/G24T3-Port 5:8
blackdiamond	5009	BD6808/G24T3-Port 5:9
blackdiamond	5010	BD6808/G24T3-Port 5:10
blackdiamond	5011	BD6808/G24T3-Port 5:11
blackdiamond	5012	BD6808/G24T3-Port 5:12
blackdiamond	5013	BD6808/G24T3-Port 5:13
blackdiamond	5014	BD6808/G24T3-Port 5:14
blackdiamond	5015	BD6808/G24T3-Port 5:15
blackdiamond	5016	BD6808/G24T3-Port 5:16
blackdiamond	5017	BD6808/G24T3-Port 5:17
blackdiamond	5018	BD6808/G24T3-Port 5:18
blackdiamond	5019	BD6808/G24T3-Port 5:19
blackdiamond	5020	BD6808/G24T3-Port 5:20
blackdiamond	5021	BD6808/G24T3-Port 5:21
blackdiamond	5022	BD6808/G24T3-Port 5:22
blackdiamond	5023	BD6808/G24T3-Port 5:23
blackdiamond	5024	BD6808/G24T3-Port 5:24
blackdiamond	6001	BD6808/F48Ti-Port 6:1
blackdiamond	6002	BD6808/F48Ti-Port 6:2
blackdiamond	6003	BD6808/F48Ti-Port 6:3
blackdiamond	6004	BD6808/F48Ti-Port 6:4
blackdiamond	6005	BD6808/F48Ti-Port 6:5
blackdiamond	6006	BD6808/F48Ti-Port 6:6
blackdiamond	6007	BD6808/F48Ti-Port 6:7
blackdiamond	6008	BD6808/F48Ti-Port 6:8
blackdiamond	6009	BD6808/F48Ti-Port 6:9
blackdiamond	6010	BD6808/F48Ti-Port 6:10
blackdiamond	6011	BD6808/F48Ti-Port 6:11
blackdiamond	6012	BD6808/F48Ti-Port 6:12
blackdiamond	6013	BD6808/F48Ti-Port 6:13
blackdiamond	6014	BD6808/F48Ti-Port 6:14
blackdiamond	6015	BD6808/F48Ti-Port 6:15
blackdiamond	6016	BD6808/F48Ti-Port 6:16
blackdiamond	6017	BD6808/F48Ti-Port 6:17
blackdiamond	6018	BD6808/F48Ti-Port 6:18
blackdiamond	6019	BD6808/F48Ti-Port 6:19
blackdiamond	6020	BD6808/F48Ti-Port 6:20
blackdiamond	6021	BD6808/F48Ti-Port 6:21
blackdiamond	6022	BD6808/F48Ti-Port 6:22
blackdiamond	6023	BD6808/F48Ti-Port 6:23
blackdiamond	6024	BD6808/F48Ti-Port 6:24
blackdiamond	6025	BD6808/F48Ti-Port 6:25
blackdiamond	6026	BD6808/F48Ti-Port 6:26
blackdiamond	6027	BD6808/F48Ti-Port 6:27
blackdiamond	6028	BD6808/F48Ti-Port 6:28
blackdiamond	6029	BD6808/F48Ti-Port 6:29
blackdiamond	6030	BD6808/F48Ti-Port 6:30
blackdiamond	6031	BD6808/F48Ti-Port 6:31
blackdiamond	6032	BD6808/F48Ti-Port 6:32
blackdiamond	6033	BD6808/F48Ti-Port 6:33
blackdiamond	6034	BD6808/F48Ti-Port 6:34
blackdiamond	6035	BD6808/F48Ti-Port 6:35
blackdiamond	6036	BD6808/F48Ti-Port 6:36
blackdiamond	6037	BD6808/F48Ti-Port 6:37
blackdiamond	6038	BD6808/F48Ti-Port 6:38
blackdiamond	6039	BD6808/F48Ti-Port 6:39
blackdiamond	6040	BD6808/F48Ti-Port 6:40
blackdiamond	6041	BD6808/F48Ti-Port 6:41
blackdiamond	6042	BD6808/F48Ti-Port 6:42
blackdiamond	6043	BD6808/F48Ti-Port 6:43
blackdiamond	6044	BD6808/F48Ti-Port 6:44
blackdiamond	6045	BD6808/F48Ti-Port 6:45
blackdiamond	6046	BD6808/F48Ti-Port 6:46
blackdiamond	6047	BD6808/F48Ti-Port 6:47
blackdiamond	6048	BD6808/F48Ti-Port 6:48
cisco6509	1	GigabitEthernet1/1
cisco6509	2	GigabitEthernet1/2
cisco6509	3	GigabitEthernet1/3
cisco6509	4	GigabitEthernet1/4
cisco6509	5	GigabitEthernet1/5
cisco6509	6	GigabitEthernet1/6
cisco6509	7	GigabitEthernet1/7
cisco6509	8	GigabitEthernet1/8
cisco6509	9	GigabitEthernet1/9
cisco6509	10	GigabitEthernet1/10
cisco6509	11	GigabitEthernet1/11
cisco6509	12	GigabitEthernet1/12
cisco6509	13	GigabitEthernet1/13
cisco6509	14	GigabitEthernet1/14
cisco6509	15	GigabitEthernet1/15
cisco6509	16	GigabitEthernet1/16
cisco6509	17	GigabitEthernet1/17
cisco6509	18	GigabitEthernet1/18
cisco6509	19	GigabitEthernet1/19
cisco6509	20	GigabitEthernet1/20
cisco6509	21	GigabitEthernet1/21
cisco6509	22	GigabitEthernet1/22
cisco6509	23	GigabitEthernet1/23
cisco6509	24	GigabitEthernet1/24
cisco6509	25	GigabitEthernet1/25
cisco6509	26	GigabitEthernet1/26
cisco6509	27	GigabitEthernet1/27
cisco6509	28	GigabitEthernet1/28
cisco6509	29	GigabitEthernet1/29
cisco6509	30	GigabitEthernet1/30
cisco6509	31	GigabitEthernet1/31
cisco6509	32	GigabitEthernet1/32
cisco6509	33	GigabitEthernet1/33
cisco6509	34	GigabitEthernet1/34
cisco6509	35	GigabitEthernet1/35
cisco6509	36	GigabitEthernet1/36
cisco6509	37	GigabitEthernet1/37
cisco6509	38	GigabitEthernet1/38
cisco6509	39	GigabitEthernet1/39
cisco6509	40	GigabitEthernet1/40
cisco6509	41	GigabitEthernet1/41
cisco6509	42	GigabitEthernet1/42
cisco6509	43	GigabitEthernet1/43
cisco6509	44	GigabitEthernet1/44
cisco6509	45	GigabitEthernet1/45
cisco6509	46	GigabitEthernet1/46
cisco6509	47	GigabitEthernet1/47
cisco6509	48	GigabitEthernet1/48
cisco6509	49	GigabitEthernet2/1
cisco6509	50	GigabitEthernet2/2
cisco6509	51	GigabitEthernet2/3
cisco6509	52	GigabitEthernet2/4
cisco6509	53	GigabitEthernet2/5
cisco6509	54	GigabitEthernet2/6
cisco6509	55	GigabitEthernet2/7
cisco6509	56	GigabitEthernet2/8
cisco6509	57	GigabitEthernet2/9
cisco6509	58	GigabitEthernet2/10
cisco6509	59	GigabitEthernet2/11
cisco6509	60	GigabitEthernet2/12
cisco6509	61	GigabitEthernet2/13
cisco6509	62	GigabitEthernet2/14
cisco6509	63	GigabitEthernet2/15
cisco6509	64	GigabitEthernet2/16
cisco6509	65	FastEthernet4/1
cisco6509	66	FastEthernet4/2
cisco6509	67	FastEthernet4/3
cisco6509	68	FastEthernet4/4
cisco6509	69	FastEthernet4/5
cisco6509	70	FastEthernet4/6
cisco6509	71	FastEthernet4/7
cisco6509	72	FastEthernet4/8
cisco6509	73	FastEthernet4/9
cisco6509	74	FastEthernet4/10
cisco6509	75	FastEthernet4/11
cisco6509	76	FastEthernet4/12
cisco6509	77	FastEthernet4/13
cisco6509	78	FastEthernet4/14
cisco6509	79	FastEthernet4/15
cisco6509	80	FastEthernet4/16
cisco6509	81	FastEthernet4/17
cisco6509	82	FastEthernet4/18
cisco6509	83	FastEthernet4/19
cisco6509	84	FastEthernet4/20
cisco6509	85	FastEthernet4/21
cisco6509	86	FastEthernet4/22
cisco6509	87	FastEthernet4/23
cisco6509	88	FastEthernet4/24
cisco6509	89	FastEthernet4/25
cisco6509	90	FastEthernet4/26
cisco6509	91	FastEthernet4/27
cisco6509	92	FastEthernet4/28
cisco6509	93	FastEthernet4/29
cisco6509	94	FastEthernet4/30
cisco6509	95	FastEthernet4/31
cisco6509	96	FastEthernet4/32
cisco6509	97	FastEthernet4/33
cisco6509	98	FastEthernet4/34
cisco6509	99	FastEthernet4/35
cisco6509	100	FastEthernet4/36
cisco6509	101	FastEthernet4/37
cisco6509	102	FastEthernet4/38
cisco6509	103	FastEthernet4/39
cisco6509	104	FastEthernet4/40
cisco6509	105	FastEthernet4/41
cisco6509	106	FastEthernet4/42
cisco6509	107	FastEthernet4/43
cisco6509	108	FastEthernet4/44
cisco6509	109	FastEthernet4/45
cisco6509	110	FastEthernet4/46
cisco6509	111	FastEthernet4/47
cisco6509	112	FastEthernet4/48
cisco6509	113	GigabitEthernet5/1
cisco6509	114	GigabitEthernet5/2
cisco6509	115	GigabitEthernet8/1
cisco6509	116	GigabitEthernet8/2
cisco6509	117	GigabitEthernet8/3
cisco6509	118	GigabitEthernet8/4
cisco6509	119	GigabitEthernet8/5
cisco6509	120	GigabitEthernet8/6
cisco6509	121	GigabitEthernet8/7
cisco6509	122	GigabitEthernet8/8
cisco6509	123	GigabitEthernet8/9
\.


--
-- Data for Name: squeue; Type: TABLE DATA; Schema: public; Owner: nms
--

COPY squeue (id, gid, added, updated, addr, cmd, locked, processed, disabled, priority, sysname, author, result, delay, delaytime) FROM stdin;
\.



COPY switchtypes (switchtype, ports, wide_counters) FROM stdin;
blackdiamond	1001-1007,4001-4016,5001-5024,6001-6048	f
es3024	1-25	f
summit400	1-50	f
cisco3550	1-50	f
summit7i	1-32	f
summit48	1-50	f
cisco6509	1-24	t
\.


--
-- Data for Name: temppoll; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY temppoll (id, "time", switch, "temp") FROM stdin;
\.


--
-- Name: cpuloadpoll_pkey; Type: CONSTRAINT; Schema: public; Owner: sesse; Tablespace: 
--

ALTER TABLE ONLY cpuloadpoll
    ADD CONSTRAINT cpuloadpoll_pkey PRIMARY KEY (id);


--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

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;


--
-- Name: cpuloadpoll; Type: ACL; Schema: public; Owner: sesse
--

REVOKE ALL ON TABLE cpuloadpoll FROM PUBLIC;
REVOKE ALL ON TABLE cpuloadpoll FROM sesse;
GRANT ALL ON TABLE cpuloadpoll TO sesse;
GRANT INSERT,SELECT,UPDATE,DELETE ON TABLE cpuloadpoll TO nms;


--
-- Name: cpuloadpoll_id_seq; Type: ACL; Schema: public; Owner: sesse
--

REVOKE ALL ON TABLE cpuloadpoll_id_seq FROM PUBLIC;
REVOKE ALL ON TABLE cpuloadpoll_id_seq FROM sesse;
GRANT ALL ON TABLE cpuloadpoll_id_seq TO sesse;
GRANT INSERT,SELECT,UPDATE,DELETE ON TABLE cpuloadpoll_id_seq TO nms;


--
-- Name: polls; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE polls FROM PUBLIC;
REVOKE ALL ON TABLE polls FROM postgres;
GRANT ALL ON TABLE polls TO postgres;
GRANT INSERT ON TABLE polls TO nms;


--
-- Name: switches; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE switches FROM PUBLIC;
REVOKE ALL ON TABLE switches FROM postgres;
GRANT ALL ON TABLE switches TO postgres;
GRANT INSERT,SELECT,UPDATE,DELETE ON TABLE switches TO nms;


--
-- Name: switchtypes; Type: ACL; Schema: public; Owner: postgres
--

REVOKE ALL ON TABLE switchtypes FROM PUBLIC;
REVOKE ALL ON TABLE switchtypes FROM postgres;
GRANT ALL ON TABLE switchtypes TO postgres;
GRANT SELECT ON TABLE switchtypes TO nms;


--
-- PostgreSQL database dump complete
--

