From 90a5f018329eefce0a3e3739a1df49b8bef929fe Mon Sep 17 00:00:00 2001 From: Chris Simon Date: Tue, 2 Jun 2015 11:36:23 +0200 Subject: [PATCH 1/6] forgot the word then on line 28 --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index 947d993..fc079e5 100755 --- a/install.sh +++ b/install.sh @@ -25,6 +25,7 @@ case "$(python --version 2>&1)" in esac if [ ! -f ./README.md ] +then read -p "Use git to install the miniprobe (y|n)? " -n 1 -r echo # (optional) move to a new line if [[ $REPLY =~ ^[Yy]$ ]] From 5f9f713d0d9c15244caf96d50393d6a86a2dfbed Mon Sep 17 00:00:00 2001 From: Chris Simon Date: Sat, 6 Jun 2015 00:52:35 +0200 Subject: [PATCH 2/6] Changed setup.py to use single command to install and configure, removed configure from install.sh --- install.sh | 1 - setup.py | 13 ++++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index fc079e5..87e6227 100755 --- a/install.sh +++ b/install.sh @@ -53,5 +53,4 @@ if [ "$DOWNLOADED" = true ] then echo "Starting to install the miniprobe and requirements" python setup.py install - python setup.py configure fi diff --git a/setup.py b/setup.py index 3c300c9..d38a76c 100644 --- a/setup.py +++ b/setup.py @@ -24,14 +24,12 @@ import uuid from setuptools import setup, find_packages -from setuptools.command import install as _install - +from setuptools.command.install import install as _install def read(path): with open(path, 'r') as f: return f.read() - class bcolor: GREEN = '\033[92m' RED = '\033[91m' @@ -39,7 +37,7 @@ class bcolor: CYAN = '\033[96m' END = '\033[0m' -class Configure(_install.install): +class Configure(_install): probe_conf = {} config_old = {} config_old['name'] = "Python MiniProbe" @@ -57,6 +55,8 @@ class Configure(_install.install): def run(self): conf_avail = False + print dir(_install) + _install.do_egg_install(self) if not os.getuid() == 0: print bcolor.RED + "You must run me as root user!" + bcolor.END print bcolor.RED + "Rerun me with sudo " + __file__ + bcolor.END @@ -87,6 +87,7 @@ def run(self): else: print "Exiting!" sys.exit() + pass def file_check(self, check_path): # Check if a give file exists @@ -333,8 +334,6 @@ def get_config(self, config_old): print "" print bcolor.YELLOW + "Checking for necessary modules and Python Version" + bcolor.END try: - sys.path.append('./') - sys.path.append('./miniprobe') import hashlib import string import json @@ -428,7 +427,7 @@ def remove_config(self): "License :: OSI Approved :: BSD License", "Programming Language :: Python", ], - cmdclass={'configure': Configure} + cmdclass={'install': Configure} ) From 44002b4eb036a3363e45d0063cfd3370009ce2ee Mon Sep 17 00:00:00 2001 From: Chris Simon Date: Sat, 6 Jun 2015 00:54:23 +0200 Subject: [PATCH 3/6] removed leftover from testing new setup.py --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index d38a76c..251ece8 100644 --- a/setup.py +++ b/setup.py @@ -55,12 +55,11 @@ class Configure(_install): def run(self): conf_avail = False - print dir(_install) - _install.do_egg_install(self) if not os.getuid() == 0: print bcolor.RED + "You must run me as root user!" + bcolor.END print bcolor.RED + "Rerun me with sudo " + __file__ + bcolor.END sys.exit(2) + _install.do_egg_install(self) print "" print bcolor.CYAN + "Welcome to the Miniprobe (Python) for PRTG installer" + bcolor.END if self.file_check(self.path): From 45e54b43edd293f93c3e5a8a00236d95b6a10d50 Mon Sep 17 00:00:00 2001 From: Chris Simon Date: Sat, 6 Jun 2015 19:46:01 +0200 Subject: [PATCH 4/6] Removed no longer needed command from README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index dd6c172..469889c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ Installation for this branch - Install pip as outlined here https://pip.pypa.io/en/latest/installing.html (pre Python 2.7.9) - Download either zip or clone repository - run command 'sudo python setup.py install' which will install all necessary packages -- run command 'sudo python setup.py configure' which will start the configuration Current Status: BETA MiniProbe POC for PRTG Network Monitor written in Python which accesses the MiniProbe Interface on the PRTG Core Server. From bf86cb28a81b243e29afdc608456c961eb8c5841 Mon Sep 17 00:00:00 2001 From: Chris Simon Date: Sat, 6 Jun 2015 19:52:59 +0200 Subject: [PATCH 5/6] made change to prerequisites --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 469889c..45b98d5 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Prerequisites ----------------- Debian based system (tested on Ubuntu, Debian, Raspbian) Python 2.7+ -Needed modules are delivered with the probe package: +Needed modules are installed using the setup.py install phase: - pyasn1 (https://pypi.python.org/pypi/pyasn1/0.1.7) - pysnmp (https://pypi.python.org/pypi/pysnmp/4.2.5) - requests (https://pypi.python.org/pypi/requests/2.5.3) From 46d0d56ca8d5a2ce3e3d4039fc8a16d6f83f085a Mon Sep 17 00:00:00 2001 From: Chris Simon Date: Sat, 6 Jun 2015 23:08:57 +0200 Subject: [PATCH 6/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 45b98d5..8423c0e 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Installation - make sure you can reach the PRTG web interface from the machine the mini probe should run on (e.g. wget https://YOUR_PRTG_SERVER) - This is tested during the setup - copy the miniprobe folder to your linux machine -- run the probe installer (e.g. "python probe_installer.py") +- run the probe installer (e.g. "sudo python setup.py install") The miniprobe should now be started. You should also be able to start/stop the same using the command