summaryrefslogtreecommitdiffstats
path: root/plugins-scripts/check_netdns.pl
diff options
context:
space:
mode:
Diffstat (limited to 'plugins-scripts/check_netdns.pl')
-rwxr-xr-xplugins-scripts/check_netdns.pl14
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins-scripts/check_netdns.pl b/plugins-scripts/check_netdns.pl
index 59c81a9..38538e5 100755
--- a/plugins-scripts/check_netdns.pl
+++ b/plugins-scripts/check_netdns.pl
@@ -29,10 +29,12 @@ use Getopt::Long;
29use Net::DNS; 29use Net::DNS;
30use FindBin; 30use FindBin;
31use lib "$FindBin::Bin"; 31use lib "$FindBin::Bin";
32use lib '@libexecdir@'; 32use utils;
33use utils ;
34 33
35my $PROGNAME = "check_netdns"; 34my $PROGNAME = "check_netdns";
35sub print_help ();
36sub print_version();
37sub print_usage ();
36 38
37$ENV{'PATH'}='@TRUSTED_PATH@'; 39$ENV{'PATH'}='@TRUSTED_PATH@';
38$ENV{'BASH_ENV'}=''; 40$ENV{'BASH_ENV'}='';
@@ -44,12 +46,12 @@ GetOptions("V" => $opt_V, "version" => $opt_V,
44 "t=i" => $opt_t, "timeout=i" => $opt_t, 46 "t=i" => $opt_t, "timeout=i" => $opt_t,
45 "s=s" => $opt_s, "server=s" => $opt_s, 47 "s=s" => $opt_s, "server=s" => $opt_s,
46 "H=s" => $opt_H, "hostname=s" => $opt_H); 48 "H=s" => $opt_H, "hostname=s" => $opt_H);
47 49
48# -h means display verbose help screen 50# -h means display verbose help screen
49if($opt_h){ print_help(); exit 0; } 51if($opt_h){ print_help(); exit 3; }
50 52
51# -V means display version number 53# -V means display version number
52if ($opt_V) { print_version(); exit 0; } 54if ($opt_V) { print_version(); exit 3; }
53 55
54# -H means host name 56# -H means host name
55$opt_H = shift unless ($opt_H); 57$opt_H = shift unless ($opt_H);
@@ -71,7 +73,7 @@ if ($opt_s) {
71 $server = $1; 73 $server = $1;
72 } else { 74 } else {
73 print "$opt_s is not a valid host name"; 75 print "$opt_s is not a valid host name";
74 exit -1; 76 exit 3;
75 } 77 }
76} 78}
77 79