Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions collective/check_munin/check_munin.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ def __init__(self, args):
self.module = args.module
self.only = args.only
self.ignore = args.ignore
self.rrdpath = os.path.join(args.datadir, args.domain)
domain = args.domain
if not domain:
domain = re.sub(r'^[^\.]+\.', '', args.hostname)
self.rrdpath = os.path.join(args.datadir, domain)


def probe(self):
myglob = os.path.join(
Expand All @@ -61,7 +65,7 @@ def probe(self):
@nagiosplugin.guarded
def main():
argp = argparse.ArgumentParser(description=__doc__)
argp.add_argument('-d', '--domain', required=True, default='')
argp.add_argument('-d', '--domain', default='')
argp.add_argument('-H', '--hostname', required=True, default='')
argp.add_argument('-M', '--module', required=True, default='')
argp.add_argument('-o', '--only', default='*',
Expand Down