From 7fc694aee4394f40adcd41f1b74bb885ca5d94f9 Mon Sep 17 00:00:00 2001 From: PhiBo Date: Wed, 22 Jan 2020 00:27:03 +0100 Subject: [PATCH] src - Option to set report cycles --- check_mtr.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/check_mtr.pl b/check_mtr.pl index 5f19795..fbf725a 100755 --- a/check_mtr.pl +++ b/check_mtr.pl @@ -91,6 +91,12 @@ $mp->add_arg( help => 'Use the specified port. Only aplicable if TCP or UDP set.' ); +$mp->add_arg( + spec => 'cycles=i', + help => 'Number of cycles to check hosts and the reliability. (Default: 4)', + default => 4, +); + $mp->getopts; check(); @@ -102,7 +108,8 @@ sub check { my @cmd; push(@cmd, 'mtr'); - push(@cmd, ('-n', '-c', '4', '--report', '--report-wide')); + push(@cmd, ('-n', '--report', '--report-wide')); + push(@cmd, ('--report-cycles', $mp->opts->cycles)); if ($mp->opts->tcp && $mp->opts->udp) { wrap_exit(UNKNOWN, 'TCP and UDP mode can not be used in combination'); } elsif ($mp->opts->tcp) { -- GitLab