|
|
@ -15,7 +15,7 @@ import monitor
|
|
|
|
import requests
|
|
|
|
import requests
|
|
|
|
class Manager() :
|
|
|
|
class Manager() :
|
|
|
|
def version(self):
|
|
|
|
def version(self):
|
|
|
|
return 1.0
|
|
|
|
return 1.1
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
delay : <value>
|
|
|
|
delay : <value>
|
|
|
@ -29,7 +29,7 @@ class Manager() :
|
|
|
|
def init(self,**args) :
|
|
|
|
def init(self,**args) :
|
|
|
|
self.id = args['node']
|
|
|
|
self.id = args['node']
|
|
|
|
self.agents = args['agents']
|
|
|
|
self.agents = args['agents']
|
|
|
|
self.config = args['config']
|
|
|
|
self.config = dict(args['config'])
|
|
|
|
self.key = args['key']
|
|
|
|
self.key = args['key']
|
|
|
|
self.actors = args['actors']
|
|
|
|
self.actors = args['actors']
|
|
|
|
self.update() #-- Initializing status information
|
|
|
|
self.update() #-- Initializing status information
|
|
|
@ -42,7 +42,6 @@ class Manager() :
|
|
|
|
url="https://the-phi.com/store/status/monitor"
|
|
|
|
url="https://the-phi.com/store/status/monitor"
|
|
|
|
r = requests.get(url,headers={"uid":self.key})
|
|
|
|
r = requests.get(url,headers={"uid":self.key})
|
|
|
|
plans = json.loads(r.text)
|
|
|
|
plans = json.loads(r.text)
|
|
|
|
|
|
|
|
|
|
|
|
meta = [item['metadata'] for item in plans if item['status']=='active' ]
|
|
|
|
meta = [item['metadata'] for item in plans if item['status']=='active' ]
|
|
|
|
if len(meta) > 0 :
|
|
|
|
if len(meta) > 0 :
|
|
|
|
self.DELAY = 60* max([ int(item['delay']) for item in meta])
|
|
|
|
self.DELAY = 60* max([ int(item['delay']) for item in meta])
|
|
|
@ -58,7 +57,7 @@ class Manager() :
|
|
|
|
meta = meta[0]
|
|
|
|
meta = meta[0]
|
|
|
|
self.agents = self.filter('agents',meta,self.agents)
|
|
|
|
self.agents = self.filter('agents',meta,self.agents)
|
|
|
|
self.actors = self.filter('actors',meta,self.actors)
|
|
|
|
self.actors = self.filter('actors',meta,self.actors)
|
|
|
|
self.setup(meta)
|
|
|
|
#self.setup(meta)
|
|
|
|
|
|
|
|
|
|
|
|
def filter_collectors(self,meta) :
|
|
|
|
def filter_collectors(self,meta) :
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|