-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmonitorserver.py
34 lines (26 loc) · 1.07 KB
/
monitorserver.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os
class Monitorserver:
def __init__(self):
pass
def parsejobs(self):
"""Gets jobs to be run from the Jobs Folder and adds them
to the jobs list
"""
#moduleList = os.listdir(os.getcwd() + "/modules/")
for root, moduleNames, fileNames in os.walk('./modules/'):
for moduleName in moduleNames:
#import each module in the module directory
exec("import " + "modules." + moduleName + "." + moduleName + " as runModule")
#run the moduleMain function in each module.
#moduleMain always returns a list object with the following keys
# - status (boolean True or False)
# - message (string a short message that describes the result)
result = runModule.moduleMain()
print result['message']
def startschedular(self):
pass
def runMonitor(self):
self.startschedular()
if __name__ == "__main__":
blugmon = Monitorserver
blugmon.runMonitor()