From b008f03c4bdec91fa589fffc29831e1de1880a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rob=C3=A9rt=20S=2E=20Guhr?= Date: Sat, 18 May 2019 01:35:11 +0200 Subject: [PATCH] Increased plugin timeout to 30 seconds and added possibility for users to manipulate this timeout - Closes #4 --- check_vmware_ntp.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/check_vmware_ntp.pl b/check_vmware_ntp.pl index 4f0227a..248aa04 100644 --- a/check_vmware_ntp.pl +++ b/check_vmware_ntp.pl @@ -82,6 +82,13 @@ help => "Set the warning threshold for number of peers (default:1).", required => 0, }, + plugin_timeout => { + default => 30, + type => "=i", + variable => "plugin_timeout", + help => "Set plugin timeout (default:30).", + required => 0, + }, ); my $list; @@ -106,8 +113,8 @@ my $crit = Opts::get_option('critical'); my $peer_warn = Opts::get_option('peer_warning'); my $peer_crit = Opts::get_option('peer_critical'); +my $TIMEOUT = Opts::get_option('plugin_timeout'); -$TIMEOUT = 3; # Just in case of problems, let's not hang Nagios $SIG{'ALRM'} = sub { print "UNKNOWN - Plugin Timed out\n"; @@ -219,4 +226,3 @@ sub list { } return $ntp_srv_count; } -