X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=tools%2Fnagiosobjects.py;fp=tools%2Fnagiosobjects.py;h=0000000000000000000000000000000000000000;hb=6e54bcb39102e76565aa6d209fa83f9d35f39532;hp=332fb4051785507ab72548c6b617e8a26f0241ea;hpb=7e967243e813fcd428ea4e14bf75ed1ef3f4cecc;p=monitor.git diff --git a/tools/nagiosobjects.py b/tools/nagiosobjects.py deleted file mode 100644 index 332fb40..0000000 --- a/tools/nagiosobjects.py +++ /dev/null @@ -1,60 +0,0 @@ - -class NagiosObject(object): - trans = {'d2_coords': '2d_coords'} - - def __init__(self, id, **kwargs): - self.id = id - self.kwords = kwargs.keys() - for key in self.kwords: - self.__setattr__(key, kwargs[key]) - - def toString(self): - ret = "" - ret += "define %s {\n" % self.id - for key in self.kwords: - if key in self.trans: - ret += " %s %s\n" % (self.trans[key], self.__getattribute__(key)) - else: - ret += " %s %s\n" % (key, self.__getattribute__(key)) - ret += "}\n" - return ret - -class Command(NagiosObject): - def __init__(self, **kwargs): - NagiosObject.__init__(self, "command", **kwargs) - -class Host(NagiosObject): - def __init__(self, **kwargs): - NagiosObject.__init__(self, "host", **kwargs) - -class HostGroup(NagiosObject): - def __init__(self, **kwargs): - NagiosObject.__init__(self, "hostgroup", **kwargs) - -class HostEscalation(NagiosObject): - def __init__(self, **kwargs): - NagiosObject.__init__(self, "hostescalation", **kwargs) - -class Contact(NagiosObject): - def __init__(self, **kwargs): - NagiosObject.__init__(self, "contact", **kwargs) - -class ContactGroup(NagiosObject): - def __init__(self, **kwargs): - NagiosObject.__init__(self, "contactgroup", **kwargs) - -class Service(NagiosObject): - def __init__(self, **kwargs): - NagiosObject.__init__(self, "service", **kwargs) - -class ServiceDependency(NagiosObject): - def __init__(self, **kwargs): - NagiosObject.__init__(self, "servicedependency", **kwargs) - -class ServiceEscalation(NagiosObject): - def __init__(self, **kwargs): - NagiosObject.__init__(self, "serviceescalation", **kwargs) - -class ServiceGroup(NagiosObject): - def __init__(self, **kwargs): - NagiosObject.__init__(self, "servicegroup", **kwargs)