X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fcheck_nt.c;h=c7baa474215a9c4553657514fc280c12918710e6;hb=11b35b92e3195d230bef359f6a0679ae4414716b;hp=4d43f545f45f8f0b7530f8ff761a9c3aeb63b58c;hpb=d0df392e2b858d3ae633f701db92a8b15843cc38;p=nagiosplug.git diff --git a/plugins/check_nt.c b/plugins/check_nt.c index 4d43f54..c7baa47 100644 --- a/plugins/check_nt.c +++ b/plugins/check_nt.c @@ -148,9 +148,9 @@ int main(int argc, char **argv){ else if(utilization >= lvalue_list[1+offset] && return_code10) { // we had at least on loop @@ -387,7 +387,6 @@ int main(int argc, char **argv){ int process_arguments(int argc, char **argv){ int c; -#ifdef HAVE_GETOPT_H int option_index = 0; static struct option long_options[] = { @@ -401,7 +400,6 @@ int process_arguments(int argc, char **argv){ {"help", no_argument, 0,'h'}, {0,0,0,0} }; -#endif /* no options were supplied */ if(argc<2) return ERROR; @@ -424,11 +422,7 @@ int process_arguments(int argc, char **argv){ } while (1){ -#ifdef HAVE_GETOPT_H c = getopt_long(argc,argv,"+hVH:t:c:w:p:v:l:s:d:",long_options,&option_index); -#else - c = getopt(argc,argv,"+hVH:t:c:w:p:v:l:s:d:"); -#endif if (c==-1||c==EOF||c==1) break; @@ -482,7 +476,7 @@ int process_arguments(int argc, char **argv){ return ERROR; break; case 'l': /* value list */ - asprintf(&value_list,optarg); + asprintf(&value_list,"%s",optarg); check_value_list=TRUE; break; case 'w': /* warning threshold */ @@ -505,13 +499,16 @@ int process_arguments(int argc, char **argv){ } + if (vars_to_check==CHECK_NONE) + return ERROR; + return OK; } void print_usage(void) { - printf("Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical] [-l params] [-d SHOWALL] [-t timeout]\n",progname); + printf("Usage: %s -H host -v variable [-p port] [-w warning] [-c critical] [-l params] [-d SHOWALL] [-t timeout]\n",progname); }