summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-06-06 23:21:13 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-06-06 23:30:49 +0200
commitd5bf1ab34f742a8801390a123aa730349bb87905 (patch)
tree2bc8c849954878fa4ca9f844770eafc09ec98a0a
parent60961e5cf7f1cd76382dbdcaf5bc7adc97ace812 (diff)
downloadhostinfo-maintainer-d5bf1ab34f742a8801390a123aa730349bb87905.tar.gz
hostinfo-maintainer-d5bf1ab34f742a8801390a123aa730349bb87905.tar.bz2
hostinfo-maintainer-d5bf1ab34f742a8801390a123aa730349bb87905.zip
missing-maintainer-keys: better check names0.1.2stable
-rwxr-xr-xmissing-maintainer-keys (renamed from hostinfo-checks)16
1 files changed, 11 insertions, 5 deletions
diff --git a/hostinfo-checks b/missing-maintainer-keys
index 9fb53ba..c3f5967 100755
--- a/hostinfo-checks
+++ b/missing-maintainer-keys
@@ -12,11 +12,15 @@ import argparse
import logging
import nagiosplugin
-class MissingMaintainers(nagiosplugin.Resource):
+class MissingMaintainerKeys(nagiosplugin.Resource):
def __init__(self, hostinfo, repo):
self.hostinfo = hostinfo
self.repo = repo
+ @property
+ def name(self):
+ return "missing_maintainer_keys"
+
def _get_all_hosts(self):
hosts = list()
hosts_path = os.path.join(self.hostinfo, 'metadata', 'hosts')
@@ -48,9 +52,11 @@ class MissingMaintainers(nagiosplugin.Resource):
yield nagiosplugin.Metric('missing', errors, context='missing')
-class MaintainersContext(nagiosplugin.Context):
+class MissingMaintainerKeysContext(nagiosplugin.Context):
def __init__(self, name, result_cls=nagiosplugin.Result):
- super(MaintainersContext, self).__init__(name, result_cls=result_cls)
+ super(MissingMaintainerKeysContext, self).__init__(
+ name,
+ result_cls=result_cls)
def describe(self, metric):
if len(metric.value) > 0:
@@ -109,8 +115,8 @@ def main():
raise Exception("bcfg2 repo not found in '%s'" % args.repo)
check = nagiosplugin.Check(
- MissingMaintainers(args.path, args.repo),
- MaintainersContext('missing'))
+ MissingMaintainerKeys(args.path, args.repo),
+ MissingMaintainerKeysContext('missing'))
check.main(verbose=args.verbose)
if __name__ == '__main__':