mirror of
https://github.com/VerosK/nagios-snmp-tortilla.git
synced 2024-11-22 02:13:48 +01:00
added test of readable config file - fixes #2
This commit is contained in:
parent
132b9a08a3
commit
e911bd33ba
@ -124,8 +124,13 @@ def main():
|
||||
print 'Error: Need to set config file\n\n'
|
||||
parser.print_help()
|
||||
raise SystemExit(ERROR)
|
||||
|
||||
config = ConfigParser()
|
||||
config.read([options.config_file])
|
||||
parsed = config.read([options.config_file])
|
||||
if len(parsed) == 0:
|
||||
print "Error: Unable to read config '%s'" % options.config_file
|
||||
raise SystemExit(ERROR)
|
||||
|
||||
test = Device(config=config, host=options.host,
|
||||
snmp_community=options.snmp_community)
|
||||
raise SystemExit, test.run_checks()
|
||||
|
Loading…
Reference in New Issue
Block a user