mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-15 22:00:06 -04:00
change exit code to unknown on help and version info
Signed-off-by: Sven Nierlein <sven@nierlein.de>
This commit is contained in:
parent
741710c27c
commit
d6baf9dbce
14 changed files with 30 additions and 30 deletions
|
|
@ -28,10 +28,10 @@ GetOptions
|
|||
|
||||
if ($opt_V) {
|
||||
print_revision($PROGNAME,'@NP_VERSION@');
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
|
||||
if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
|
||||
|
||||
($opt_H) || usage("Host name/address not specified\n");
|
||||
my $host = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
|
||||
|
|
|
|||
|
|
@ -54,10 +54,10 @@ GetOptions
|
|||
|
||||
if ($opt_V) {
|
||||
print_revision($PROGNAME,'@NP_VERSION@'); #'
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
|
||||
if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
|
||||
|
||||
my $smbclient = $utils::PATH_TO_SMBCLIENT;
|
||||
$smbclient || usage("check requires smbclient, smbclient not set\n");
|
||||
|
|
|
|||
|
|
@ -60,12 +60,12 @@ GetOptions(
|
|||
|
||||
if ($opt_V) {
|
||||
print_revision($PROGNAME, '@NP_VERSION@');
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
if ($opt_h) {
|
||||
print_help();
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
$opt_f = shift unless ($opt_f);
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ GetOptions
|
|||
|
||||
if ($opt_V) {
|
||||
print_revision($PROGNAME,'@NP_VERSION@');
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
unless (defined $opt_t) {
|
||||
|
|
@ -66,7 +66,7 @@ unless (defined $opt_t) {
|
|||
}
|
||||
|
||||
|
||||
if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
|
||||
if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
|
||||
|
||||
unless (defined $opt_F) {
|
||||
print "Missing license.dat file\n";
|
||||
|
|
|
|||
|
|
@ -367,17 +367,17 @@ sub process_arguments() {
|
|||
|
||||
if ($status == 0){
|
||||
print_help();
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
if ($opt_V) {
|
||||
print_revision($PROGNAME,'@NP_VERSION@');
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
if ($opt_h) {
|
||||
print_help();
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
if (! utils::is_hostname($hostname)){
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ $status = process_arguments();
|
|||
if ($status != 0)
|
||||
{
|
||||
print_help() ;
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -313,17 +313,17 @@ sub process_arguments() {
|
|||
|
||||
if ($status == 0){
|
||||
print_help();
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
if ($opt_V) {
|
||||
print_revision($PROGNAME,'@NP_VERSION@');
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
if ($opt_h) {
|
||||
print_help();
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
unless (defined $timeout) {
|
||||
|
|
|
|||
|
|
@ -181,10 +181,10 @@ MAIN:
|
|||
|
||||
if ($opt_V) {
|
||||
print_revision($PROGNAME,'@NP_VERSION@');
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
|
||||
if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
|
||||
|
||||
($opt_H) || ($opt_H = shift @ARGV) || usage("Host name/address not specified\n");
|
||||
my $remotehost = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
|
||||
|
|
|
|||
|
|
@ -573,12 +573,12 @@ sub process_arguments(){
|
|||
|
||||
if ($opt_V) {
|
||||
print_revision($PROGNAME,'@NP_VERSION@');
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
if ($opt_h) {
|
||||
print_help();
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
if (defined $opt_v ){
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ sub process_arguments {
|
|||
|
||||
if (defined $opt_V) {
|
||||
print_revision($PROGNAME,'@NP_VERSION@');
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
syntax("Help:") if ($help);
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@ GetOptions("V" => $opt_V, "version" => $opt_V,
|
|||
"H=s" => $opt_H, "hostname=s" => $opt_H);
|
||||
|
||||
# -h means display verbose help screen
|
||||
if($opt_h){ print_help(); exit 0; }
|
||||
if($opt_h){ print_help(); exit 3; }
|
||||
|
||||
# -V means display version number
|
||||
if ($opt_V) { print_version(); exit 0; }
|
||||
if ($opt_V) { print_version(); exit 3; }
|
||||
|
||||
# -H means host name
|
||||
$opt_H = shift unless ($opt_H);
|
||||
|
|
@ -70,7 +70,7 @@ if ($opt_s) {
|
|||
$server = $1;
|
||||
} else {
|
||||
print "$opt_s is not a valid host name";
|
||||
exit -1;
|
||||
exit 3;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -98,12 +98,12 @@ GetOptions
|
|||
|
||||
if ($opt_V) {
|
||||
print_revision($PROGNAME,'@NP_VERSION@');
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
if ($opt_h) {
|
||||
print_help();
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
# jitter test params specified
|
||||
|
|
|
|||
|
|
@ -63,12 +63,12 @@ GetOptions(
|
|||
);
|
||||
|
||||
# -h means display verbose help screen
|
||||
if ($opt_h) { print_help(); exit $ERRORS{'OK'}; }
|
||||
if ($opt_h) { print_help(); exit $ERRORS{'UNKNOWN'}; }
|
||||
|
||||
# -V means display version number
|
||||
if ($opt_V) {
|
||||
print_revision($PROGNAME,'@NP_VERSION@');
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
# Hash containing all RPC program names and numbers
|
||||
|
|
|
|||
|
|
@ -31,12 +31,12 @@ GetOptions
|
|||
|
||||
if ($opt_V) {
|
||||
print_revision($PROGNAME,'@NP_VERSION@'); #'
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
if ($opt_h) {
|
||||
print_help();
|
||||
exit $ERRORS{'OK'};
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
|
||||
$opt_H = shift unless ($opt_H);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ my $successOutput = '/^check_rpc/';
|
|||
|
||||
my $t;
|
||||
|
||||
$t += checkCmd( "./check_rpc -V", 0, $successOutput );
|
||||
$t += checkCmd( "./check_rpc -V", 3, $successOutput );
|
||||
|
||||
exit(0) if defined($Test::Harness::VERSION);
|
||||
exit($tests - $t);
|
||||
|
|
|
|||
Loading…
Reference in a new issue