diff options
author | Sven Nierlein <sven@nierlein.de> | 2015-10-04 18:48:23 +0200 |
---|---|---|
committer | Sven Nierlein <sven@nierlein.de> | 2015-10-04 19:24:30 +0200 |
commit | d6baf9dbce1578ca59a577ac8155b835c46f0a16 (patch) | |
tree | 7f2cef8ef11361cc4a6c01b8951430e15f7a74ec | |
parent | 741710c27c1749b81be4260a2ce0c18b319623cd (diff) | |
download | monitoring-plugins-d6baf9dbce1578ca59a577ac8155b835c46f0a16.tar.gz |
change exit code to unknown on help and version info
Signed-off-by: Sven Nierlein <sven@nierlein.de>
-rwxr-xr-x | plugins-scripts/check_breeze.pl | 4 | ||||
-rwxr-xr-x | plugins-scripts/check_disk_smb.pl | 4 | ||||
-rwxr-xr-x | plugins-scripts/check_file_age.pl | 4 | ||||
-rwxr-xr-x | plugins-scripts/check_flexlm.pl | 4 | ||||
-rwxr-xr-x | plugins-scripts/check_ifoperstatus.pl | 6 | ||||
-rwxr-xr-x | plugins-scripts/check_ifstatus.pl | 8 | ||||
-rwxr-xr-x | plugins-scripts/check_ircd.pl | 4 | ||||
-rwxr-xr-x | plugins-scripts/check_mailq.pl | 4 | ||||
-rwxr-xr-x | plugins-scripts/check_mssql.pl | 2 | ||||
-rwxr-xr-x | plugins-scripts/check_netdns.pl | 6 | ||||
-rwxr-xr-x | plugins-scripts/check_ntp.pl | 4 | ||||
-rwxr-xr-x | plugins-scripts/check_rpc.pl | 4 | ||||
-rwxr-xr-x | plugins-scripts/check_wave.pl | 4 | ||||
-rw-r--r-- | plugins-scripts/t/check_rpc.t | 2 |
14 files changed, 30 insertions, 30 deletions
diff --git a/plugins-scripts/check_breeze.pl b/plugins-scripts/check_breeze.pl index 12a60ee6..05b99203 100755 --- a/plugins-scripts/check_breeze.pl +++ b/plugins-scripts/check_breeze.pl | |||
@@ -28,10 +28,10 @@ GetOptions | |||
28 | 28 | ||
29 | if ($opt_V) { | 29 | if ($opt_V) { |
30 | print_revision($PROGNAME,'@NP_VERSION@'); | 30 | print_revision($PROGNAME,'@NP_VERSION@'); |
31 | exit $ERRORS{'OK'}; | 31 | exit $ERRORS{'UNKNOWN'}; |
32 | } | 32 | } |
33 | 33 | ||
34 | if ($opt_h) {print_help(); exit $ERRORS{'OK'};} | 34 | if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};} |
35 | 35 | ||
36 | ($opt_H) || usage("Host name/address not specified\n"); | 36 | ($opt_H) || usage("Host name/address not specified\n"); |
37 | my $host = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/); | 37 | my $host = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/); |
diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index 99948a41..98992268 100755 --- a/plugins-scripts/check_disk_smb.pl +++ b/plugins-scripts/check_disk_smb.pl | |||
@@ -54,10 +54,10 @@ GetOptions | |||
54 | 54 | ||
55 | if ($opt_V) { | 55 | if ($opt_V) { |
56 | print_revision($PROGNAME,'@NP_VERSION@'); #' | 56 | print_revision($PROGNAME,'@NP_VERSION@'); #' |
57 | exit $ERRORS{'OK'}; | 57 | exit $ERRORS{'UNKNOWN'}; |
58 | } | 58 | } |
59 | 59 | ||
60 | if ($opt_h) {print_help(); exit $ERRORS{'OK'};} | 60 | if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};} |
61 | 61 | ||
62 | my $smbclient = $utils::PATH_TO_SMBCLIENT; | 62 | my $smbclient = $utils::PATH_TO_SMBCLIENT; |
63 | $smbclient || usage("check requires smbclient, smbclient not set\n"); | 63 | $smbclient || usage("check requires smbclient, smbclient not set\n"); |
diff --git a/plugins-scripts/check_file_age.pl b/plugins-scripts/check_file_age.pl index 15330f71..56b8e97c 100755 --- a/plugins-scripts/check_file_age.pl +++ b/plugins-scripts/check_file_age.pl | |||
@@ -60,12 +60,12 @@ GetOptions( | |||
60 | 60 | ||
61 | if ($opt_V) { | 61 | if ($opt_V) { |
62 | print_revision($PROGNAME, '@NP_VERSION@'); | 62 | print_revision($PROGNAME, '@NP_VERSION@'); |
63 | exit $ERRORS{'OK'}; | 63 | exit $ERRORS{'UNKNOWN'}; |
64 | } | 64 | } |
65 | 65 | ||
66 | if ($opt_h) { | 66 | if ($opt_h) { |
67 | print_help(); | 67 | print_help(); |
68 | exit $ERRORS{'OK'}; | 68 | exit $ERRORS{'UNKNOWN'}; |
69 | } | 69 | } |
70 | 70 | ||
71 | $opt_f = shift unless ($opt_f); | 71 | $opt_f = shift unless ($opt_f); |
diff --git a/plugins-scripts/check_flexlm.pl b/plugins-scripts/check_flexlm.pl index 49d674d4..e3fe296f 100755 --- a/plugins-scripts/check_flexlm.pl +++ b/plugins-scripts/check_flexlm.pl | |||
@@ -58,7 +58,7 @@ GetOptions | |||
58 | 58 | ||
59 | if ($opt_V) { | 59 | if ($opt_V) { |
60 | print_revision($PROGNAME,'@NP_VERSION@'); | 60 | print_revision($PROGNAME,'@NP_VERSION@'); |
61 | exit $ERRORS{'OK'}; | 61 | exit $ERRORS{'UNKNOWN'}; |
62 | } | 62 | } |
63 | 63 | ||
64 | unless (defined $opt_t) { | 64 | unless (defined $opt_t) { |
@@ -66,7 +66,7 @@ unless (defined $opt_t) { | |||
66 | } | 66 | } |
67 | 67 | ||
68 | 68 | ||
69 | if ($opt_h) {print_help(); exit $ERRORS{'OK'};} | 69 | if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};} |
70 | 70 | ||
71 | unless (defined $opt_F) { | 71 | unless (defined $opt_F) { |
72 | print "Missing license.dat file\n"; | 72 | print "Missing license.dat file\n"; |
diff --git a/plugins-scripts/check_ifoperstatus.pl b/plugins-scripts/check_ifoperstatus.pl index 1a7fbba4..3eed4bcb 100755 --- a/plugins-scripts/check_ifoperstatus.pl +++ b/plugins-scripts/check_ifoperstatus.pl | |||
@@ -367,17 +367,17 @@ sub process_arguments() { | |||
367 | 367 | ||
368 | if ($status == 0){ | 368 | if ($status == 0){ |
369 | print_help(); | 369 | print_help(); |
370 | exit $ERRORS{'OK'}; | 370 | exit $ERRORS{'UNKNOWN'}; |
371 | } | 371 | } |
372 | 372 | ||
373 | if ($opt_V) { | 373 | if ($opt_V) { |
374 | print_revision($PROGNAME,'@NP_VERSION@'); | 374 | print_revision($PROGNAME,'@NP_VERSION@'); |
375 | exit $ERRORS{'OK'}; | 375 | exit $ERRORS{'UNKNOWN'}; |
376 | } | 376 | } |
377 | 377 | ||
378 | if ($opt_h) { | 378 | if ($opt_h) { |
379 | print_help(); | 379 | print_help(); |
380 | exit $ERRORS{'OK'}; | 380 | exit $ERRORS{'UNKNOWN'}; |
381 | } | 381 | } |
382 | 382 | ||
383 | if (! utils::is_hostname($hostname)){ | 383 | if (! utils::is_hostname($hostname)){ |
diff --git a/plugins-scripts/check_ifstatus.pl b/plugins-scripts/check_ifstatus.pl index 2c76d0c8..9f2f7c31 100755 --- a/plugins-scripts/check_ifstatus.pl +++ b/plugins-scripts/check_ifstatus.pl | |||
@@ -119,7 +119,7 @@ $status = process_arguments(); | |||
119 | if ($status != 0) | 119 | if ($status != 0) |
120 | { | 120 | { |
121 | print_help() ; | 121 | print_help() ; |
122 | exit $ERRORS{'OK'}; | 122 | exit $ERRORS{'UNKNOWN'}; |
123 | } | 123 | } |
124 | 124 | ||
125 | 125 | ||
@@ -313,17 +313,17 @@ sub process_arguments() { | |||
313 | 313 | ||
314 | if ($status == 0){ | 314 | if ($status == 0){ |
315 | print_help(); | 315 | print_help(); |
316 | exit $ERRORS{'OK'}; | 316 | exit $ERRORS{'UNKNOWN'}; |
317 | } | 317 | } |
318 | 318 | ||
319 | if ($opt_V) { | 319 | if ($opt_V) { |
320 | print_revision($PROGNAME,'@NP_VERSION@'); | 320 | print_revision($PROGNAME,'@NP_VERSION@'); |
321 | exit $ERRORS{'OK'}; | 321 | exit $ERRORS{'UNKNOWN'}; |
322 | } | 322 | } |
323 | 323 | ||
324 | if ($opt_h) { | 324 | if ($opt_h) { |
325 | print_help(); | 325 | print_help(); |
326 | exit $ERRORS{'OK'}; | 326 | exit $ERRORS{'UNKNOWN'}; |
327 | } | 327 | } |
328 | 328 | ||
329 | unless (defined $timeout) { | 329 | unless (defined $timeout) { |
diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl index afedfb95..22d21c2e 100755 --- a/plugins-scripts/check_ircd.pl +++ b/plugins-scripts/check_ircd.pl | |||
@@ -181,10 +181,10 @@ MAIN: | |||
181 | 181 | ||
182 | if ($opt_V) { | 182 | if ($opt_V) { |
183 | print_revision($PROGNAME,'@NP_VERSION@'); | 183 | print_revision($PROGNAME,'@NP_VERSION@'); |
184 | exit $ERRORS{'OK'}; | 184 | exit $ERRORS{'UNKNOWN'}; |
185 | } | 185 | } |
186 | 186 | ||
187 | if ($opt_h) {print_help(); exit $ERRORS{'OK'};} | 187 | if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};} |
188 | 188 | ||
189 | ($opt_H) || ($opt_H = shift @ARGV) || usage("Host name/address not specified\n"); | 189 | ($opt_H) || ($opt_H = shift @ARGV) || usage("Host name/address not specified\n"); |
190 | my $remotehost = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/); | 190 | my $remotehost = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/); |
diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl index 3086e94a..32f498d3 100755 --- a/plugins-scripts/check_mailq.pl +++ b/plugins-scripts/check_mailq.pl | |||
@@ -573,12 +573,12 @@ sub process_arguments(){ | |||
573 | 573 | ||
574 | if ($opt_V) { | 574 | if ($opt_V) { |
575 | print_revision($PROGNAME,'@NP_VERSION@'); | 575 | print_revision($PROGNAME,'@NP_VERSION@'); |
576 | exit $ERRORS{'OK'}; | 576 | exit $ERRORS{'UNKNOWN'}; |
577 | } | 577 | } |
578 | 578 | ||
579 | if ($opt_h) { | 579 | if ($opt_h) { |
580 | print_help(); | 580 | print_help(); |
581 | exit $ERRORS{'OK'}; | 581 | exit $ERRORS{'UNKNOWN'}; |
582 | } | 582 | } |
583 | 583 | ||
584 | if (defined $opt_v ){ | 584 | if (defined $opt_v ){ |
diff --git a/plugins-scripts/check_mssql.pl b/plugins-scripts/check_mssql.pl index a436a8ff..fb3952d4 100755 --- a/plugins-scripts/check_mssql.pl +++ b/plugins-scripts/check_mssql.pl | |||
@@ -130,7 +130,7 @@ sub process_arguments { | |||
130 | 130 | ||
131 | if (defined $opt_V) { | 131 | if (defined $opt_V) { |
132 | print_revision($PROGNAME,'@NP_VERSION@'); | 132 | print_revision($PROGNAME,'@NP_VERSION@'); |
133 | exit $ERRORS{'OK'}; | 133 | exit $ERRORS{'UNKNOWN'}; |
134 | } | 134 | } |
135 | 135 | ||
136 | syntax("Help:") if ($help); | 136 | syntax("Help:") if ($help); |
diff --git a/plugins-scripts/check_netdns.pl b/plugins-scripts/check_netdns.pl index af1456be..fd418734 100755 --- a/plugins-scripts/check_netdns.pl +++ b/plugins-scripts/check_netdns.pl | |||
@@ -45,10 +45,10 @@ GetOptions("V" => $opt_V, "version" => $opt_V, | |||
45 | "H=s" => $opt_H, "hostname=s" => $opt_H); | 45 | "H=s" => $opt_H, "hostname=s" => $opt_H); |
46 | 46 | ||
47 | # -h means display verbose help screen | 47 | # -h means display verbose help screen |
48 | if($opt_h){ print_help(); exit 0; } | 48 | if($opt_h){ print_help(); exit 3; } |
49 | 49 | ||
50 | # -V means display version number | 50 | # -V means display version number |
51 | if ($opt_V) { print_version(); exit 0; } | 51 | if ($opt_V) { print_version(); exit 3; } |
52 | 52 | ||
53 | # -H means host name | 53 | # -H means host name |
54 | $opt_H = shift unless ($opt_H); | 54 | $opt_H = shift unless ($opt_H); |
@@ -70,7 +70,7 @@ if ($opt_s) { | |||
70 | $server = $1; | 70 | $server = $1; |
71 | } else { | 71 | } else { |
72 | print "$opt_s is not a valid host name"; | 72 | print "$opt_s is not a valid host name"; |
73 | exit -1; | 73 | exit 3; |
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
diff --git a/plugins-scripts/check_ntp.pl b/plugins-scripts/check_ntp.pl index dd2cd6dc..f4000019 100755 --- a/plugins-scripts/check_ntp.pl +++ b/plugins-scripts/check_ntp.pl | |||
@@ -98,12 +98,12 @@ GetOptions | |||
98 | 98 | ||
99 | if ($opt_V) { | 99 | if ($opt_V) { |
100 | print_revision($PROGNAME,'@NP_VERSION@'); | 100 | print_revision($PROGNAME,'@NP_VERSION@'); |
101 | exit $ERRORS{'OK'}; | 101 | exit $ERRORS{'UNKNOWN'}; |
102 | } | 102 | } |
103 | 103 | ||
104 | if ($opt_h) { | 104 | if ($opt_h) { |
105 | print_help(); | 105 | print_help(); |
106 | exit $ERRORS{'OK'}; | 106 | exit $ERRORS{'UNKNOWN'}; |
107 | } | 107 | } |
108 | 108 | ||
109 | # jitter test params specified | 109 | # jitter test params specified |
diff --git a/plugins-scripts/check_rpc.pl b/plugins-scripts/check_rpc.pl index cbdeceb4..47d6e49e 100755 --- a/plugins-scripts/check_rpc.pl +++ b/plugins-scripts/check_rpc.pl | |||
@@ -63,12 +63,12 @@ GetOptions( | |||
63 | ); | 63 | ); |
64 | 64 | ||
65 | # -h means display verbose help screen | 65 | # -h means display verbose help screen |
66 | if ($opt_h) { print_help(); exit $ERRORS{'OK'}; } | 66 | if ($opt_h) { print_help(); exit $ERRORS{'UNKNOWN'}; } |
67 | 67 | ||
68 | # -V means display version number | 68 | # -V means display version number |
69 | if ($opt_V) { | 69 | if ($opt_V) { |
70 | print_revision($PROGNAME,'@NP_VERSION@'); | 70 | print_revision($PROGNAME,'@NP_VERSION@'); |
71 | exit $ERRORS{'OK'}; | 71 | exit $ERRORS{'UNKNOWN'}; |
72 | } | 72 | } |
73 | 73 | ||
74 | # Hash containing all RPC program names and numbers | 74 | # Hash containing all RPC program names and numbers |
diff --git a/plugins-scripts/check_wave.pl b/plugins-scripts/check_wave.pl index 979416e0..41e15f50 100755 --- a/plugins-scripts/check_wave.pl +++ b/plugins-scripts/check_wave.pl | |||
@@ -31,12 +31,12 @@ GetOptions | |||
31 | 31 | ||
32 | if ($opt_V) { | 32 | if ($opt_V) { |
33 | print_revision($PROGNAME,'@NP_VERSION@'); #' | 33 | print_revision($PROGNAME,'@NP_VERSION@'); #' |
34 | exit $ERRORS{'OK'}; | 34 | exit $ERRORS{'UNKNOWN'}; |
35 | } | 35 | } |
36 | 36 | ||
37 | if ($opt_h) { | 37 | if ($opt_h) { |
38 | print_help(); | 38 | print_help(); |
39 | exit $ERRORS{'OK'}; | 39 | exit $ERRORS{'UNKNOWN'}; |
40 | } | 40 | } |
41 | 41 | ||
42 | $opt_H = shift unless ($opt_H); | 42 | $opt_H = shift unless ($opt_H); |
diff --git a/plugins-scripts/t/check_rpc.t b/plugins-scripts/t/check_rpc.t index be8ae2f7..c58f7bf7 100644 --- a/plugins-scripts/t/check_rpc.t +++ b/plugins-scripts/t/check_rpc.t | |||
@@ -15,7 +15,7 @@ my $successOutput = '/^check_rpc/'; | |||
15 | 15 | ||
16 | my $t; | 16 | my $t; |
17 | 17 | ||
18 | $t += checkCmd( "./check_rpc -V", 0, $successOutput ); | 18 | $t += checkCmd( "./check_rpc -V", 3, $successOutput ); |
19 | 19 | ||
20 | exit(0) if defined($Test::Harness::VERSION); | 20 | exit(0) if defined($Test::Harness::VERSION); |
21 | exit($tests - $t); | 21 | exit($tests - $t); |