Skip to content

Commit 4eccbee

Browse files
committed
Merge pull request #24 from eagle00789/development
Development for setup.py change
2 parents db44a87 + 46d0d56 commit 4eccbee

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Installation for this branch
1212
- Install pip as outlined here https://pip.pypa.io/en/latest/installing.html (pre Python 2.7.9)
1313
- Download either zip or clone repository
1414
- run command 'sudo python setup.py install' which will install all necessary packages
15-
- run command 'sudo python setup.py configure' which will start the configuration
1615

1716
Current Status: BETA
1817
MiniProbe POC for PRTG Network Monitor written in Python which accesses the MiniProbe Interface on the PRTG Core Server.
@@ -21,7 +20,7 @@ Prerequisites
2120
-----------------
2221
Debian based system (tested on Ubuntu, Debian, Raspbian)
2322
Python 2.7+
24-
Needed modules are delivered with the probe package:
23+
Needed modules are installed using the setup.py install phase:
2524
- pyasn1 (https://pypi.python.org/pypi/pyasn1/0.1.7)
2625
- pysnmp (https://pypi.python.org/pypi/pysnmp/4.2.5)
2726
- requests (https://pypi.python.org/pypi/requests/2.5.3)
@@ -34,7 +33,7 @@ Installation
3433
- 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)
3534
- This is tested during the setup
3635
- copy the miniprobe folder to your linux machine
37-
- run the probe installer (e.g. "python probe_installer.py")
36+
- run the probe installer (e.g. "sudo python setup.py install")
3837

3938
The miniprobe should now be started. You should also be able to start/stop the same using the command
4039

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ case "$(python --version 2>&1)" in
2525
esac
2626

2727
if [ ! -f ./README.md ]
28+
then
2829
read -p "Use git to install the miniprobe (y|n)? " -n 1 -r
2930
echo # (optional) move to a new line
3031
if [[ $REPLY =~ ^[Yy]$ ]]
@@ -52,5 +53,4 @@ if [ "$DOWNLOADED" = true ]
5253
then
5354
echo "Starting to install the miniprobe and requirements"
5455
python setup.py install
55-
python setup.py configure
5656
fi

setup.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,20 @@
2424
import uuid
2525

2626
from setuptools import setup, find_packages
27-
from setuptools.command import install as _install
28-
27+
from setuptools.command.install import install as _install
2928

3029
def read(path):
3130
with open(path, 'r') as f:
3231
return f.read()
3332

34-
3533
class bcolor:
3634
GREEN = '\033[92m'
3735
RED = '\033[91m'
3836
YELLOW = '\033[93m'
3937
CYAN = '\033[96m'
4038
END = '\033[0m'
4139

42-
class Configure(_install.install):
40+
class Configure(_install):
4341
probe_conf = {}
4442
config_old = {}
4543
config_old['name'] = "Python MiniProbe"
@@ -61,6 +59,7 @@ def run(self):
6159
print bcolor.RED + "You must run me as root user!" + bcolor.END
6260
print bcolor.RED + "Rerun me with sudo " + __file__ + bcolor.END
6361
sys.exit(2)
62+
_install.do_egg_install(self)
6463
print ""
6564
print bcolor.CYAN + "Welcome to the Miniprobe (Python) for PRTG installer" + bcolor.END
6665
if self.file_check(self.path):
@@ -87,6 +86,7 @@ def run(self):
8786
else:
8887
print "Exiting!"
8988
sys.exit()
89+
pass
9090

9191
def file_check(self, check_path):
9292
# Check if a give file exists
@@ -333,8 +333,6 @@ def get_config(self, config_old):
333333
print ""
334334
print bcolor.YELLOW + "Checking for necessary modules and Python Version" + bcolor.END
335335
try:
336-
sys.path.append('./')
337-
sys.path.append('./miniprobe')
338336
import hashlib
339337
import string
340338
import json
@@ -428,7 +426,7 @@ def remove_config(self):
428426
"License :: OSI Approved :: BSD License",
429427
"Programming Language :: Python",
430428
],
431-
cmdclass={'configure': Configure}
429+
cmdclass={'install': Configure}
432430
)
433431

434432

0 commit comments

Comments
 (0)