From 059a5517dcbb5691a1eb94b8f151cb15d320c4ed Mon Sep 17 00:00:00 2001 From: Marcus Stoegbauer Date: Fri, 12 Apr 2013 09:00:17 +0000 Subject: [PATCH] Rancid hinzugefuegt, funktioniert noch nicht --- Userconfig/checks.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Userconfig/checks.py b/Userconfig/checks.py index 8d5c38c..ddc0a23 100644 --- a/Userconfig/checks.py +++ b/Userconfig/checks.py @@ -20,6 +20,14 @@ class checks(object): pass # 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): """docstring for __classesForHost""" classes = [] @@ -28,7 +36,8 @@ class checks(object): continue # if __ ret = getattr(self, c)() - classes.append(ret) + if len(ret) == 3: + classes.append(ret) # for c return map(lambda k: (k[1],k[2]), sorted(classes, key=lambda k: k[0])) # def __classesForHost__ @@ -54,9 +63,16 @@ class checks(object): def hostname(self): """docstring for hostname""" - hostname = platform.node() - if hostname.count("."): - hostname = hostname.split(".")[0] + hostname = self.getShortHostname() return(10, "Host", 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 \ No newline at end of file