finally, minimal config is working :)
This commit is contained in:
parent
606edc99b3
commit
d66ed9413d
10 changed files with 14 additions and 11 deletions
|
|
@ -3,14 +3,17 @@ import re
|
||||||
|
|
||||||
class Member:
|
class Member:
|
||||||
def __init__(self, nameid, name="", phone="", comment="", parent="", tasks=None):
|
def __init__(self, nameid, name="", phone="", comment="", parent="", tasks=None):
|
||||||
self.id = id
|
self.id = nameid
|
||||||
self.name = name
|
self.name = name
|
||||||
self.phone = phone
|
self.phone = phone
|
||||||
self.tasks = []
|
self.tasks = []
|
||||||
self.add_task(tasks)
|
self.add_task(tasks)
|
||||||
self.comment = comment
|
self.comment = comment
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
|
||||||
|
def get_id(self):
|
||||||
|
return self.id
|
||||||
|
|
||||||
def add_task(self, task):
|
def add_task(self, task):
|
||||||
if task is None:
|
if task is None:
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -240,7 +240,7 @@ class FullConfigParser(ConfigParser):
|
||||||
|
|
||||||
#replace object pointer
|
#replace object pointer
|
||||||
id_list_func = lambda hostgroup: hostgroup.get_members()
|
id_list_func = lambda hostgroup: hostgroup.get_members()
|
||||||
id_get_func = lambda member: member.id
|
id_get_func = lambda member: member.get_id()
|
||||||
self.replace_pointer(hostgroups, members, id_list_func, id_get_func)
|
self.replace_pointer(hostgroups, members, id_list_func, id_get_func)
|
||||||
|
|
||||||
id_list_func = lambda service: service.get_periods()
|
id_list_func = lambda service: service.get_periods()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
class Parser:
|
class Parser:
|
||||||
def __init__(self):
|
def __init__(self, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def parse_data(self, data):
|
def parse_data(self, data):
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ from lib.parsers.parser import Parser
|
||||||
|
|
||||||
|
|
||||||
class ShellParser(Parser):
|
class ShellParser(Parser):
|
||||||
def __init__(self):
|
def __init__(self, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from lib.processors.processor import Processor
|
||||||
|
|
||||||
|
|
||||||
class MariadbProcessor(Processor):
|
class MariadbProcessor(Processor):
|
||||||
def __init__(self):
|
def __init__(self, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ from lib.processors.processor import Processor
|
||||||
|
|
||||||
|
|
||||||
class MongodbProcessor(Processor):
|
class MongodbProcessor(Processor):
|
||||||
def __init__(self):
|
def __init__(self, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,5 @@ The processor class for postprocessing polled data.
|
||||||
|
|
||||||
|
|
||||||
class Processor:
|
class Processor:
|
||||||
def __init__(self):
|
def __init__(self, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
@ -6,7 +6,7 @@ from lib.processors.processor import Processor
|
||||||
|
|
||||||
|
|
||||||
class SyslogProcessor(Processor):
|
class SyslogProcessor(Processor):
|
||||||
def __init__(self):
|
def __init__(self, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,5 +51,5 @@ class HttpService(Service):
|
||||||
#print f.read()
|
#print f.read()
|
||||||
|
|
||||||
|
|
||||||
def create(**kwargs):
|
def create(kwargs):
|
||||||
return HttpService(**kwargs)
|
return HttpService(**kwargs)
|
||||||
|
|
@ -52,5 +52,5 @@ class SnmpgetService(Service):
|
||||||
# print('%s = %s' % (name.prettyPrint(), val.prettyPrint()))
|
# print('%s = %s' % (name.prettyPrint(), val.prettyPrint()))
|
||||||
|
|
||||||
|
|
||||||
def create(kargs):
|
def create(kwargs):
|
||||||
return SnmpgetService(**kwargs)
|
return SnmpgetService(**kwargs)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue