From 06c9106b396d02d45ce5dd954507d010063ded59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Kir=C3=B8?= Date: Sun, 20 Mar 2016 13:59:46 +0100 Subject: Added basic .bashrc file for simplifed development in container. --- nms/.bashrc | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 nms/.bashrc (limited to 'nms') diff --git a/nms/.bashrc b/nms/.bashrc new file mode 100644 index 0000000..c1fd16f --- /dev/null +++ b/nms/.bashrc @@ -0,0 +1,8 @@ +NAME='NMS Docker' + +# Aliases +alias h="history" +alias l="ls -lAhoF --color --show-control-chars" +alias ll="ls -lash --color --show-control-chars" +alias cd..="cd .." + -- cgit v1.2.3 From 25c603b32eaf35f07bea0dfd9541afd196cb1343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Kir=C3=B8?= Date: Sun, 20 Mar 2016 14:00:33 +0100 Subject: Updated config to nms-dev-db --- nms/config.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nms') diff --git a/nms/config.pm b/nms/config.pm index faaeaa1..db9775f 100755 --- a/nms/config.pm +++ b/nms/config.pm @@ -6,9 +6,9 @@ package nms::config; # DB our $db_name = "nms"; -our $db_host = "db"; +our $db_host = "nms-dev-db.gathering.org"; our $db_username = "nms"; -our $db_password = "foobar"; +our $db_password = "nms-lol"; # NMS hash used for public NMS obfuscation of interface names our $nms_hash = ""; -- cgit v1.2.3 From 47788e2d2c95ecf4174dbb9ab8d5dafcfd552c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Kir=C3=B8?= Date: Sun, 20 Mar 2016 14:01:13 +0100 Subject: Updated Readme with new docker run commands. --- nms/README.md | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'nms') diff --git a/nms/README.md b/nms/README.md index 107b630..739fc5b 100644 --- a/nms/README.md +++ b/nms/README.md @@ -4,21 +4,28 @@ - fetch data from tg server: `scp ${USER}@wat.gathering.org:/root/nms-2015.sql.gz .` - Rename the nms dump so we can use it later: `mv nms-2015.sql.gz nms-dump.sql.gz` -- Do the Debian install(or whatever OS you're on.): https://docs.docker.com/engine/installation/linux/debian/ And make sure that your user is in the docker group, so that you can run docker without sudo. +- Do the Debian install(or whatever OS you're on.): +https://docs.docker.com/engine/installation/linux/debian/ +And make sure that your user is in the docker group, so that you can run docker without sudo. - Clone repository: `git clone git@github.com:tech-server/tgmanage.git` - - run `./makedockerfiles.sh`, which creates the docker image files, and builds them. -- Start database node: `docker run -v /sys/fs/cgroup:/sys/fs/cgroup:ro --privileged --rm -ti --name=db nms-db` -- Start front end node: ` docker run -v /sys/fs/cgroup:/sys/fs/cgroup:ro --privileged --rm -ti --name=front --link=db:db nms-front ` -- Find IP's: `docker inspect front`, `docker inspect db` -- Start a shell in a container: `docker exec front /bin/bash` -- Open localhost:PORT in browser to start testing. +- Start database node: +`docker run -v /sys/fs/cgroup:/sys/fs/cgroup:ro --privileged --rm -ti --name=db nms-db` + +- Start front end node: +-- with cgroup: `docker run -v /sys/fs/cgroup:/sys/fs/cgroup:ro --privileged --rm -ti --name=front --link=db:db nms-front` + +-- getting to prompt(without cgroup): +`docker run -v "/home/kiro/repos/tgmanage:/srv/tgmanage" -v "/home/kiro/repos/tgmanage/nms/.bashrc:/root/.bashrc" -w "/srv/tgmanage/web/nms.gathering.org" \ +-it --privileged nms-front /bin/bash` +- Find IP's: +`docker inspect nms-db | grep "IPAddress\":"` +`docker inspect nms-front | grep "IPAddress\":"` +- Open the nms-front ip in the web browser. -## TODO -- finish the installation guide above. -- cgit v1.2.3 From 0ff7168d629c33a76ee117767a279afaabbca85c Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Sun, 20 Mar 2016 14:09:25 +0000 Subject: NMS: Update schema with recent dhcp-changes --- nms/nms-dump.sql | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'nms') diff --git a/nms/nms-dump.sql b/nms/nms-dump.sql index bbe141d..335a3b0 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 + 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: @@ -162,7 +163,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 +177,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 +191,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; @@ -292,7 +293,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 +355,14 @@ ALTER TABLE ONLY switches -- --- Name: dhcp_switch; Type: INDEX; Schema: public; Owner: postgres; Tablespace: +-- 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"); @@ -417,21 +418,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 +467,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 +475,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 @@ -525,23 +526,23 @@ GRANT ALL ON TABLE seen_mac TO nms; -- --- 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; -- --- 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; -- -- cgit v1.2.3 From 699d843a141f3bc8a835c38cce039737f3dfd5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Kir=C3=B8?= Date: Sun, 20 Mar 2016 17:37:56 +0100 Subject: Readme: updated docker cms + added link location to working dev site. --- nms/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nms') diff --git a/nms/README.md b/nms/README.md index 739fc5b..7be3f14 100644 --- a/nms/README.md +++ b/nms/README.md @@ -21,11 +21,12 @@ And make sure that your user is in the docker group, so that you can run docker -- getting to prompt(without cgroup): `docker run -v "/home/kiro/repos/tgmanage:/srv/tgmanage" -v "/home/kiro/repos/tgmanage/nms/.bashrc:/root/.bashrc" -w "/srv/tgmanage/web/nms.gathering.org" \ --it --privileged nms-front /bin/bash` +-rm=true -ti --name=front --privileged nms-front /bin/bash` - Find IP's: `docker inspect nms-db | grep "IPAddress\":"` `docker inspect nms-front | grep "IPAddress\":"` - Open the nms-front ip in the web browser. +http://172.17.0.2:8080/ -- cgit v1.2.3 From fe68ba984f7f1c1e586fc02219b80adedb64c555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Kir=C3=B8?= Date: Sun, 20 Mar 2016 18:03:36 +0100 Subject: bash rc stuffs for dev docker container. --- nms/.bashrc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'nms') diff --git a/nms/.bashrc b/nms/.bashrc index c1fd16f..06072e3 100644 --- a/nms/.bashrc +++ b/nms/.bashrc @@ -1,5 +1,13 @@ NAME='NMS Docker' + +ln -s /srv/tgmanage/web/etc/apache2/nms.tg16.gathering.org.conf /etc/apache2/sites-enabled/ +ln -s /srv/tgmanage/nms/config.pm /srv/tgmanage/include/ +echo 'demo:$apr1$IKrQYF6x$0zmRciLR7Clc2tEEosyHV.' > /srv/tgmanage/web/.htpasswd + +/etc/init.d/apache2 restart +echo "go here to look at nms: http://172.17.0.2:8080/" + # Aliases alias h="history" alias l="ls -lAhoF --color --show-control-chars" -- cgit v1.2.3