Skip to content

Commit d765f18

Browse files
committed
fix: add check for existance of file with zabbix metrics
1 parent 7c345a9 commit d765f18

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mamonsu/lib/runner.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@ def quit_handler(_signo=None, _stack_frame=None):
5555
args, commands = parse_args()
5656
if not args.zabbix_address:
5757
print('Option --zabbix-address is missing')
58-
print_total_help()
58+
exit(125)
59+
if not os.path.isfile(args.zabbix_file):
60+
print('Cannot find zabbix file with metric to upload. Check path in --zabbix-file option.')
5961
exit(125)
6062

6163
cfg = Config(args.config_file, args.plugins_dirs)
6264
cfg.config.set('zabbix', 'address', args.zabbix_address)
6365
cfg.config.set('zabbix', 'port', args.zabbix_port)
64-
cfg.config.set('zabbix', 'client', args.zabbix_client)
66+
cfg.config.set('zabbix', 'client', args.zabbix_client)
6567
cfg.config.set('log', 'level', args.zabbix_log_level)
6668

6769
supervisor = Supervisor(cfg)

0 commit comments

Comments
 (0)