diff --git a/.gitignore b/.gitignore index fd4d819..8bf9a4b 100644 --- a/.gitignore +++ b/.gitignore @@ -103,6 +103,7 @@ celerybeat.pid # Environments .env +.env.* .venv #env/ gitignore inside venv/ diff --git a/README.md b/README.md index 8cf2d47..a4031d2 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Please use the _unmanaged_ installation with direct influxdb data ingestion if y targets = ["server:33001"] ... ``` -5. Create .env file with server credentials `sudo vim /etc/nm-exp-active-netrics/.env`: +5. Create .env.netrics file with server credentials `sudo vim /etc/nm-exp-active-netrics/.env.netrics`:
INFLUXDB_SERVER= INFLUXDB_PORT= diff --git a/etc/init.d/nm-exp-active-netrics b/etc/init.d/nm-exp-active-netrics index ff8587f..0ced76a 100644 --- a/etc/init.d/nm-exp-active-netrics +++ b/etc/init.d/nm-exp-active-netrics @@ -32,9 +32,9 @@ fi start_nma() { upload="" - if [ -f /etc/nm-exp-active-netrics/.env ];then + if [ -f /etc/nm-exp-active-netrics/.env.netrics ];then upload="-u" - echo "INFO: /etc/nm-exp-active-netrics/.env present, using -u (upload flag)" + echo "INFO: /etc/nm-exp-active-netrics/.env.netrics present, using -u (upload flag)" fi echo "Installing nm-exp-active-netrics in crontab (/etc/cron.d/cron-nm-exp-active-netrics)..." diff --git a/package/deb/nm-exp-active-netrics/DEBIAN/control b/package/deb/nm-exp-active-netrics/DEBIAN/control index f74396f..d61eb32 100644 --- a/package/deb/nm-exp-active-netrics/DEBIAN/control +++ b/package/deb/nm-exp-active-netrics/DEBIAN/control @@ -1,5 +1,5 @@ Package: nm-exp-active-netrics -Version: 0.1.11 +Version: 1.0.0 Section: custom Priority: optional Architecture: arm64 diff --git a/package/deb/nm-exp-active-netrics/DEBIAN/postinst b/package/deb/nm-exp-active-netrics/DEBIAN/postinst index aa91c97..1b4d38d 100755 --- a/package/deb/nm-exp-active-netrics/DEBIAN/postinst +++ b/package/deb/nm-exp-active-netrics/DEBIAN/postinst @@ -15,20 +15,17 @@ usermod -a -G wireshark netrics echo "INFO: Please enable non-root users to run tshark wireshark. Eg.:" echo "INFO: \"$ yes | DEBIAN_FRONTEND=teletype dpkg-reconfigure wireshark-common\"" -if [ -f /etc/nm-exp-active-netrics/.env ];then - chown netrics:netrics /etc/nm-exp-active-netrics/.env -fi - -# uncomment here to stash archive/pending -#if [ -d /var/nm/ ];then -# mv /var/nm /var/nm.backup.$(date +"%Y%m%d") -#fi +### uncomment here to stash archive/pending +## if [ -d /var/nm/ ];then +## mv /var/nm /var/nm.backup.$(date +"%Y%m%d") +## fi mkdir -p /var/nm/ -if [ -f /etc/nm-exp-active-netrics/.env ];then - chown netrics:netrics /etc/nm-exp-active-netrics/.env +if [ -f /etc/nm-exp-active-netrics/.env.netrics ];then + chown netrics:netrics /etc/nm-exp-active-netrics/.env.netrics fi + chown netrics:netrics /usr/local/src/nm-exp-active-netrics/ -R chmod +x /etc/init.d/nm-exp-active-netrics update-rc.d nm-exp-active-netrics defaults diff --git a/scripts/make_install.sh b/scripts/make_install.sh index 55abe32..14947fc 100755 --- a/scripts/make_install.sh +++ b/scripts/make_install.sh @@ -53,9 +53,9 @@ update-rc.d nm-exp-active-netrics defaults cd - if [ -f env/.env ];then - echo "INFO: env detected. copying env/.env /etc/nm-exp-active-netrics/.env ..." - chmod go-rw env/.env - cp env/.env /etc/nm-exp-active-netrics/.env + echo "INFO: env detected. copying env/.env.netrics /etc/nm-exp-active-netrics/.env.netrics ..." + chmod go-rw env/.env.netrics + cp env/.env.netrics /etc/nm-exp-active-netrics/.env.netrics else echo "INFO: NO env detected." fi @@ -65,5 +65,5 @@ if [ ! -d "/var/nm" ]; then chown netrics:netrics /var/nm -R fi -chown netrics:netrics /etc/nm-exp-active-netrics/.env +chown netrics:netrics /etc/nm-exp-active-netrics/.env.netrics chown netrics:netrics /usr/local/src/nm-exp-active-netrics/ -R diff --git a/src/netrics.py b/src/netrics.py index fbfe089..704217d 100755 --- a/src/netrics.py +++ b/src/netrics.py @@ -15,8 +15,9 @@ #TODO: move this to setup.py __name__ = "nm-exp-active-netrics" -__version__ = "0.1.11" -__author__ = "Kyle-MacMillan, James Saxon, Guilherme Martins, Nick Feamster" +__version__ = "1.0.0" +__author__ = "Kyle-MacMillan, James Saxon, Guilherme Martins,"\ + "Marc Richardson, Nick Feamster" #Used for Annotations class keyvalue(argparse.Action): diff --git a/src/nmexpactive/experiment.py b/src/nmexpactive/experiment.py index c9cb7a0..fedc1f3 100644 --- a/src/nmexpactive/experiment.py +++ b/src/nmexpactive/experiment.py @@ -22,7 +22,7 @@ projectname = "nm-exp-active-{0}".format(project) EXP = Path(projectname) ETC = Path("/etc") / EXP -ETC_ENV = ETC / ".env" +ETC_ENV = ETC / ".env.netrics" VAR_NM = Path("/var/nm/") VAR = Path("/var/nm/") / EXP VAR_LOG = VAR / "log"