Rancid hinzugefuegt, funktioniert noch nicht

This commit is contained in:
Marcus Stoegbauer 2013-04-12 09:00:17 +00:00
parent 7391ced8d7
commit 059a5517dc

View File

@ -20,6 +20,14 @@ class checks(object):
pass pass
# def __init__ # def __init__
def getShortHostname(self):
"""docstring for getShortHostname"""
hostname = platform.node()
if hostname.count("."):
hostname = hostname.split(".")[0]
return hostname
# def getShortHostname
def __classesForHost__(self): def __classesForHost__(self):
"""docstring for __classesForHost""" """docstring for __classesForHost"""
classes = [] classes = []
@ -28,7 +36,8 @@ class checks(object):
continue continue
# if __ # if __
ret = getattr(self, c)() ret = getattr(self, c)()
classes.append(ret) if len(ret) == 3:
classes.append(ret)
# for c # for c
return map(lambda k: (k[1],k[2]), sorted(classes, key=lambda k: k[0])) return map(lambda k: (k[1],k[2]), sorted(classes, key=lambda k: k[0]))
# def __classesForHost__ # def __classesForHost__
@ -54,9 +63,16 @@ class checks(object):
def hostname(self): def hostname(self):
"""docstring for hostname""" """docstring for hostname"""
hostname = platform.node() hostname = self.getShortHostname()
if hostname.count("."):
hostname = hostname.split(".")[0]
return(10, "Host", hostname) return(10, "Host", hostname)
# def hostname # def hostname
def app(self):
"""docstring for app"""
hostname = self.getShortHostname()
if (hostname == "glitters"):
return(500, "", "rancid_hosts")
else:
return ()
# def app
# def checks # def checks