summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d7ba5ec)
raw | patch | inline | side by side (parent: d7ba5ec)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Tue, 11 Mar 2003 22:22:12 +0000 (22:22 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Tue, 11 Mar 2003 22:22:12 +0000 (22:22 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@396 f882894a-f735-0410-b71e-b25c423dba1c
32 files changed:
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c
index 0cffaeb2ef251c81e77bd4e5c6aa8efb6fc343f7..866044bd3b9e62975e538c908a5d149d77f19110 100644 (file)
--- a/plugins/check_by_ssh.c
+++ b/plugins/check_by_ssh.c
char *p1, *p2;
size_t len;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"version", no_argument, 0, 'V'},
{"use-ipv6", no_argument, 0, '6'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
strcpy (argv[c], "-t");
while (1) {
-#ifdef HAVE_GETOPT_H
- c =
- getopt_long (argc, argv, "Vvh46ft:H:O:p:i:u:l:C:n:s:", long_options,
+ c = getopt_long (argc, argv, "Vvh46ft:H:O:p:i:u:l:C:n:s:", long_options,
&option_index);
-#else
- c = getopt (argc, argv, "Vvh46ft:H:O:p:i:u:l:C:n:s:");
-#endif
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_dig.c b/plugins/check_dig.c
index 5c6f1e12e8bdb45985d0ac535d8c79bdcab1de42..59c3b7c8f3f3130062136e009d4f36a10224494d 100644 (file)
--- a/plugins/check_dig.c
+++ b/plugins/check_dig.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"hostname", required_argument, 0, 'H'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
while (1) {
-#ifdef HAVE_GETOPT_H
c = getopt_long (argc, argv, "hVvt:l:H:", long_options, &option_index);
-#else
- c = getopt (argc, argv, "hVvt:l:H:");
-#endif
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 1afc76208763601786ee6c9d20f6e8543cd04348..5fac4eae1b9222a891d6f5cf4e3d83ca94d4a943 100644 (file)
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"warning", required_argument, 0, 'w'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
strcpy (argv[c], "-t");
while (1) {
-#ifdef HAVE_GETOPT_H
- c =
- getopt_long (argc, argv, "+?Vqhvet:c:w:p:x:m", long_options, &option_index);
-#else
- c = getopt (argc, argv, "+?Vqhvet:c:w:p:x:m");
-#endif
+ c = getopt_long (argc, argv, "+?Vqhvet:c:w:p:x:m", long_options, &option_index);
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index ac62c45775d7ad939e0977185bf1344e6c688244..7c79893ab7dc4b6ea0d008911254a480160bd7e9 100644 (file)
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
{
int c;
-#ifdef HAVE_GETOPT_H
int opt_index = 0;
static struct option long_opts[] = {
{"help", no_argument, 0, 'h'},
{"expected-address", required_argument, 0, 'a'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
strcpy (argv[c], "-t");
while (1) {
-#ifdef HAVE_GETOPT_H
c = getopt_long (argc, argv, "hVvt:H:s:r:a:", long_opts, &opt_index);
-#else
- c = getopt (argc, argv, "hVvt:H:s:r:a:");
-#endif
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_fping.c b/plugins/check_fping.c
index 8887afe8eeaf647fe695da34b07d244aac18afdd..ac203f523d3a646cd8e2dd11f54f098857cd0426 100644 (file)
--- a/plugins/check_fping.c
+++ b/plugins/check_fping.c
int c;
char *rv[2];
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"hostname", required_argument, 0, 'H'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
rv[PL] = NULL;
rv[RTA] = NULL;
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c =
- getopt_long (argc, argv, "+hVvH:c:w:b:n:", long_options, &option_index);
-#else
- c = getopt (argc, argv, "+hVvH:c:w:b:n:");
-#endif
+ c = getopt_long (argc, argv, "+hVvH:c:w:b:n:", long_options, &option_index);
if (c == -1 || c == EOF || c == 1)
break;
diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c
index 267de2e04f6edce4d14529574fd27ef0c194b485..d8583724391aadcc644ea91fac3d9d0015b16e2d 100644 (file)
--- a/plugins/check_hpjd.c
+++ b/plugins/check_hpjd.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"hostname", required_argument, 0, 'H'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
while (1) {
-#ifdef HAVE_GETOPT_H
c = getopt_long (argc, argv, "+hVH:C:", long_options, &option_index);
-#else
- c = getopt (argc, argv, "+?hVH:C:");
-#endif
if (c == -1 || c == EOF || c == 1)
break;
diff --git a/plugins/check_http.c b/plugins/check_http.c
index cf86d469a91ff7c09c7d0eb6f27ab47dd2caa44e..d6f2c15a252d750d2ce64c4b39b9d4ec5ac4558e 100644 (file)
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
{
int c = 1;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
STD_LONG_OPTS,
{"min", required_argument, 0, 'm'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
strcpy (argv[c], "-n");
}
-#define OPTCHARS "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:"
-
while (1) {
-#ifdef HAVE_GETOPT_H
- c = getopt_long (argc, argv, OPTCHARS, long_options, &option_index);
-#else
- c = getopt (argc, argv, OPTCHARS);
-#endif
+ c = getopt_long (argc, argv, "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:", long_options, &option_index);
if (c == -1 || c == EOF)
break;
print_usage (void)
{
printf ("Usage:\n" " %s %s\n"
-#ifdef HAVE_GETOPT_H
" %s (-h | --help) for detailed help\n"
" %s (-V | --version) for version information\n",
-#else
- " %s -h for detailed help\n"
- " %s -V for version information\n",
-#endif
progname, OPTIONS, progname, progname);
}
index 869f7dc0a76eac3f874e8d25d0d30abea4fe7eee..47d9d840467362373263a7d299eb5c8fd567ee51 100644 (file)
#include <unistd.h>
#include <linux/hdreg.h>
#include <linux/types.h>
-#include <getopt.h>
#include <errno.h>
#define NR_ATTRIBUTES 30
int o, longindex;
int retval = 0;
-#ifdef HAVE_GETOPT_H
const struct option longopts[] = {
{"device", required_argument, 0, 'd'},
{"immediate", no_argument, 0, 'i'},
{"version", no_argument, 0, 'V'}, {0, 0, 0, 0}
};
-#endif /* */
while (1) {
-#ifdef HAVE_GETOPT_H
o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex);
-#else /* */
- o = getopt (argc, argv, "+d:iq10nhV");
-
-#endif /* */
if (o == -1 || o == EOF)
break;
switch (o) {
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index ac11c58f03975fd0de85fc1d08ae5e064818b881..90fe6225eefe91a6f97dedb2dbab214e023ee5d3 100644 (file)
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
/* initialize the long option struct */
static struct option longopts[] = {
{"crit", required_argument, 0, 'c'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c = getopt_long (argc, argv, "hVt:c:w:H:b:p:a:D:P:", longopts, &option_index);
-#else
- c = getopt (argc, argv, "+?hVt:c:w:H:b:p:a:D:P:");
-#endif
+ c = getopt_long (argc, argv, "hVt:c:w:H:b:p:a:D:P:", longopts, &option_index);
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_load.c b/plugins/check_load.c
index 7d60d2343a85d2ee1054c5f2f61ca09474b58b0b..ba1a59830ae8d0ec0d55b06ac33fca66cf024396 100644 (file)
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
{
int c = 0;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"warning", required_argument, 0, 'w'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
-
-#define OPTCHARS "Vhc:w:"
if (argc < 2)
return ERROR;
while (1) {
-#ifdef HAVE_GETOPT_H
- c = getopt_long (argc, argv, OPTCHARS, long_options, &option_index);
-#else
- c = getopt (argc, argv, OPTCHARS);
-#endif
+ c = getopt_long (argc, argv, "Vhc:w:", long_options, &option_index);
+
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c
index e26e2e66b7ccfae5e513ad0fce8d3773fd9f6242..095dcbc8ccd63200145e98532f20a3786cdb71b4 100644 (file)
--- a/plugins/check_mrtg.c
+++ b/plugins/check_mrtg.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"logfile", required_argument, 0, 'F'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c =
- getopt_long (argc, argv, "hVF:e:a:v:c:w:l:u:", long_options,
+ c = getopt_long (argc, argv, "hVF:e:a:v:c:w:l:u:", long_options,
&option_index);
-#else
- c = getopt (argc, argv, "hVF:e:a:v:c:w:l:u:");
-#endif
if (c == -1 || c == EOF)
break;
print_usage (void)
{
printf ("Usage:\n" " %s %s\n"
-#ifdef HAVE_GETOPT_H
" %s (-h | --help) for detailed help\n"
" %s (-V | --version) for version information\n",
-#else
- " %s -h for detailed help\n"
- " %s -V for version information\n",
-#endif
progname, OPTIONS, progname, progname);
}
index 94e6e0808102906b48cbbfccb82c5dd0674c91e1..21791ae9f25f7b89db2012872c87368fad8b5669 100644 (file)
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option longopts[] = {
{"logfile", required_argument, 0, 'F'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c = getopt_long (argc, argv, "hVF:e:a:c:w:", longopts, &option_index);
-#else
- c = getopt (argc, argv, "hVF:e:a:c:w:");
-#endif
+ c = getopt_long (argc, argv, "hVF:e:a:c:w:", longopts, &option_index);
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 18324c81784ff100ae02fc40f7a7022b943b5715..307481463371417e8f3cb36bf0294726008d7880 100644 (file)
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"hostname", required_argument, 0, 'H'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 1)
return ERROR;
while (1) {
-#ifdef HAVE_GETOPT_H
- c =
- getopt_long (argc, argv, "hVP:p:u:d:H:", long_options, &option_index);
-#else
- c = getopt (argc, argv, "hVP:p:u:d:H:");
-#endif
+ c = getopt_long (argc, argv, "hVP:p:u:d:H:", long_options, &option_index);
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c
index 5c4cd4a3a7d769126b7bea5df1d25f45a612c4e4..649bec4317b92272734e2a7a3b93a22c012f01ac 100644 (file)
--- a/plugins/check_nagios.c
+++ b/plugins/check_nagios.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"filename", required_argument, 0, 'F'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
}
while (1) {
-#ifdef HAVE_GETOPT_H
c = getopt_long (argc, argv, "+hVF:C:e:", long_options, &option_index);
-#else
- c = getopt (argc, argv, "+hVF:C:e:");
-#endif
if (c == -1 || c == EOF || c == 1)
break;
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index 1c9dc0adac0c1d29fce17a1c26093cca5f75c190..c7baa474215a9c4553657514fc280c12918710e6 100644 (file)
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
int process_arguments(int argc, char **argv){
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] =
{
{"help", no_argument, 0,'h'},
{0,0,0,0}
};
-#endif
/* no options were supplied */
if(argc<2) return ERROR;
}
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;
diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c
index 2f7ecc107cadb5400b634b9b0d555d034502a54e..100be12f9aa9f41e78e3e5d7e8422e472b272499 100644 (file)
--- a/plugins/check_nwstat.c
+++ b/plugins/check_nwstat.c
int process_arguments(int argc, char **argv){
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] =
{
{"help", no_argument, 0,'h'},
{0,0,0,0}
};
-#endif
/* no options were supplied */
if(argc<2) return ERROR;
}
while (1){
-#ifdef HAVE_GETOPT_H
c = getopt_long(argc,argv,"+hoVH:t:c:w:p:v:",long_options,&option_index);
-#else
- c = getopt(argc,argv,"+hoVH:t:c:w:p:v:");
-#endif
if (c==-1||c==EOF||c==1)
break;
printf
("Usage:\n"
" %s %s\n"
-#ifdef HAVE_GETOPT_H
" %s (-h | --help) for detailed help\n"
" %s (-V | --version) for version information\n",
-#else
- " %s -h for detailed help\n"
- " %s -V for version information\n",
-#endif
progname, OPTIONS, progname, progname);
}
diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c
index 2ff37a485b1741fdd8695e08d79d62c40dd4a694..4c3b957f3a5f040637134ba1d2b6f441d1bac65b 100644 (file)
--- a/plugins/check_overcr.c
+++ b/plugins/check_overcr.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"port", required_argument, 0, 'p'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
/* no options were supplied */
if (argc < 2)
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c =
- getopt_long (argc, argv, "+hVH:t:c:w:p:v:", long_options,
+ c = getopt_long (argc, argv, "+hVH:t:c:w:p:v:", long_options,
&option_index);
-#else
- c = getopt (argc, argv, "+hVH:t:c:w:p:v:");
-#endif
if (c == -1 || c == EOF || c == 1)
break;
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index 2033b8c19af42b0370d2b51471cb6b1ae1ebe37e..e1484566328961e69b89652e19f6e9ff53c7f6ef 100644 (file)
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"help", no_argument, 0, 'h'},
{"database", required_argument, 0, 'd'},
{0, 0, 0, 0}
};
-#endif
while (1) {
-#ifdef HAVE_GETOPT_H
c = getopt_long (argc, argv, "hVt:c:w:H:P:d:l:p:a:",
long_options, &option_index);
-#else
- c = getopt (argc, argv, "hVt:c:w:H:P:d:l:p:a:");
-#endif
+
if (c == EOF)
break;
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index 480f631e373439d9aa6c0ac1764c8dad077f30b8..2526a74f451aa8037fae927d5fb0093e856890a6 100644 (file)
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
int c = 1;
char *ptr;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
STD_LONG_OPTS,
{"link", no_argument, 0, 'L'},
{0, 0, 0, 0}
};
-#endif
-
-#define OPTCHARS "VvhnLt:c:w:H:p:"
if (argc < 2)
return ERROR;
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c = getopt_long (argc, argv, OPTCHARS, long_options, &option_index);
-#else
- c = getopt (argc, argv, OPTCHARS);
-#endif
+ c = getopt_long (argc, argv, "VvhnLt:c:w:H:p:", long_options, &option_index);
+
if (c == -1 || c == EOF)
break;
print_usage (void)
{
printf ("Usage:\n" " %s %s\n"
-#ifdef HAVE_GETOPT_H
" %s (-h | --help) for detailed help\n"
" %s (-V | --version) for version information\n",
-#else
- " %s -h for detailed help\n"
- " %s -V for version information\n",
-#endif
progname, OPTIONS, progname, progname);
}
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index 755ed8609814b3aefcd5dc7787bf1ea26321bc7c..ceaff958f74b8ad56589d53a1f8481a176470a1a 100644 (file)
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
int c = 1;
char *user;
struct passwd *pw;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"warning", required_argument, 0, 'w'},
{"verbose", no_argument, 0, 'v'},
{0, 0, 0, 0}
};
-#endif
for (c = 1; c < argc; c++)
if (strcmp ("-to", argv[c]) == 0)
strcpy (argv[c], "-t");
while (1) {
-#ifdef HAVE_GETOPT_H
- c = getopt_long (argc, argv, "Vvht:c:w:p:s:u:C:a:", long_options, &option_index);
-#else
- c = getopt (argc, argv, "Vvht:c:w:p:s:u:C:a:");
-#endif
+ c = getopt_long (argc, argv, "Vvht:c:w:p:s:u:C:a:", long_options, &option_index);
+
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_radius.c b/plugins/check_radius.c
index 0b338c2b2330e80a9309a926bb5fcfc64177f6e7..c71f3b4c37772de2d345c5c065568b77fec53d5b 100644 (file)
--- a/plugins/check_radius.c
+++ b/plugins/check_radius.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"hostname", required_argument, 0, 'H'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c =
- getopt_long (argc, argv, "+hVvH:P:F:u:p:t:r:e:", long_options,
+ c = getopt_long (argc, argv, "+hVvH:P:F:u:p:t:r:e:", long_options,
&option_index);
-#else
- c = getopt (argc, argv, "+hVvH:P:F:u:p:t:r:e:");
-#endif
if (c == -1 || c == EOF || c == 1)
break;
print_usage (void)
{
printf ("Usage:\n" " %s %s\n"
-#ifdef HAVE_GETOPT_H
" %s (-h | --help) for detailed help\n"
" %s (-V | --version) for version information\n",
-#else
- " %s -h for detailed help\n"
- " %s -V for version information\n",
-#endif
progname, OPTIONS, progname, progname);
}
diff --git a/plugins/check_real.c b/plugins/check_real.c
index ef3581b9508a361d63255c017caa363eec88b3c7..6b484eac30544b59484c21b7983b7fe67cdbc576 100644 (file)
--- a/plugins/check_real.c
+++ b/plugins/check_real.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"hostname", required_argument, 0, 'H'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c =
- getopt_long (argc, argv, "+hVI:H:e:u:p:w:c:t:", long_options,
+ c = getopt_long (argc, argv, "+hVI:H:e:u:p:w:c:t:", long_options,
&option_index);
-#else
- c = getopt (argc, argv, "+?hVI:H:e:u:p:w:c:t");
-#endif
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index f78d1126521ac20c7faf09725e2407fb192cdd4a..5e980bcc72e1545e2d2528f9fcf1ebdcb2ac49b8 100644 (file)
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"hostname", required_argument, 0, 'H'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c =
- getopt_long (argc, argv, "+hVvt:p:f:e:c:w:H:", long_options,
+ c = getopt_long (argc, argv, "+hVvt:p:f:e:c:w:H:", long_options,
&option_index);
-#else
- c = getopt (argc, argv, "+?hVvt:p:f:e:c:w:H:");
-#endif
+
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 327ef8181ca710a1d12053b6dee9da8583568602..b943379d4770bbc67d220ec258c9d6019f5abd9f 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
int c = 1;
int j = 0, jj = 0, ii = 0;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
STD_LONG_OPTS,
{"privpasswd", required_argument, 0, 'X'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c =
- getopt_long (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:m:P:L:U:a:A:X:",
+ c = getopt_long (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:m:P:L:U:a:A:X:",
long_options, &option_index);
-#else
- c = getopt (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:m:P:L:U:a:A:X:");
-#endif
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
index bd0a2451a44a9ec54d2c973ba378c75c9364e5b2..f3a351e6800d82dd24b608705c76bc4501cf7936 100644 (file)
--- a/plugins/check_ssh.c
+++ b/plugins/check_ssh.c
int c;
char *tmp = NULL;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"version", no_argument, 0, 'V'},
{"host", required_argument, 0, 'H'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
strcpy (argv[c], "-t");
while (1) {
-#ifdef HAVE_GETOPT_H
c = getopt_long (argc, argv, "+Vhvt:H:p:", long_options, &option_index);
-#else
- c = getopt (argc, argv, "+Vhvt:H:p:");
-#endif
+
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index 5645779d622fa325bb2eae368af413e138686379..ad5eb25ff972912a00d827de3267183b8b9c7dd5 100644 (file)
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
int wc = 0; /* warning counter */
int cc = 0; /* critical counter */
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"warning", required_argument, 0, 'w'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
while (1) {
-#ifdef HAVE_GETOPT_H
c = getopt_long (argc, argv, "+?Vvhac:w:", long_options, &option_index);
-#else
- c = getopt (argc, argv, "+?Vvhac:w:");
-#endif
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index 8a2dcc5c53a14d090c7aa350f075ee64cbbaaf8d..3461c333faaf292aad3d12dccef0c71285140fee 100644 (file)
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"hostname", required_argument, 0, 'H'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
usage ("No arguments found\n");
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c =
- getopt_long (argc, argv, "+hVvH:s:e:q:c:w:t:p:C:W:d:S", long_options,
+ c = getopt_long (argc, argv, "+hVvH:s:e:q:c:w:t:p:C:W:d:S", long_options,
&option_index);
-#else
- c = getopt (argc, argv, "+hVvH:s:e:q:c:w:t:p:C:W:d:S");
-#endif
if (c == -1 || c == EOF || c == 1)
break;
diff --git a/plugins/check_time.c b/plugins/check_time.c
index e4bd26d7f7fc24c5cb34eb5836d08e300dbcc07f..70bb6906d4cb5d9bcff30d09b58ac12eab2cc68f 100644 (file)
--- a/plugins/check_time.c
+++ b/plugins/check_time.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"hostname", required_argument, 0, 'H'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
usage ("\n");
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c =
- getopt_long (argc, argv, "hVH:w:c:W:C:p:t:", long_options,
+ c = getopt_long (argc, argv, "hVH:w:c:W:C:p:t:", long_options,
&option_index);
-#else
- c = getopt (argc, argv, "hVH:w:c:W:C:p:t:");
-#endif
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_udp.c b/plugins/check_udp.c
index 4ae9c1036319f96a732df3e401b6f7a4c16e7104..ac2210257d4f32d422fe2794b6a16063f89237f6 100644 (file)
--- a/plugins/check_udp.c
+++ b/plugins/check_udp.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"hostname", required_argument, 0, 'H'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
usage ("\n");
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c = getopt_long (argc, argv, "+hVvH:e:s:c:w:t:p:", long_options, &option_index);
-#else
- c = getopt (argc, argv, "+hVvH:e:s:c:w:t:p:");
-#endif
+ c = getopt_long (argc, argv, "+hVvH:e:s:c:w:t:p:", long_options, &option_index);
if (c == -1 || c == EOF || c == 1)
break;
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index 4c9032268f8a940e4cefd758aefd1269dae4e78b..b077d31fe607bfbadb3171f8b16be4d58e3abfc5 100644 (file)
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"hostname", required_argument, 0, 'H'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
}
while (1) {
-#ifdef HAVE_GETOPT_H
- c =
- getopt_long (argc, argv, "hVH:u:p:v:c:w:t:", long_options,
+ c = getopt_long (argc, argv, "hVH:u:p:v:c:w:t:", long_options,
&option_index);
-#else
- c = getopt (argc, argv, "hVH:u:p:v:c:w:t:");
-#endif
if (c == -1 || c == EOF)
break;
diff --git a/plugins/check_users.c b/plugins/check_users.c
index 565d9e7032ca1ac7c0e196a2c06a83ff526d53e2..58e8c13b10374ce8a7e05ebf740c533b8b9e2843 100644 (file)
--- a/plugins/check_users.c
+++ b/plugins/check_users.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"critical", required_argument, 0, 'c'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
usage ("\n");
while (1) {
-#ifdef HAVE_GETOPT_H
c = getopt_long (argc, argv, "+hVvc:w:", long_options, &option_index);
-#else
- c = getopt (argc, argv, "+hVvc:w:");
-#endif
if (c == -1 || c == EOF || c == 1)
break;
diff --git a/plugins/check_vsz.c b/plugins/check_vsz.c
index e6132a0f5836725c3496d45558434ecebc9caee6..7a9acb2dfea05021b6fa639f56a90f5bdfe7264e 100644 (file)
--- a/plugins/check_vsz.c
+++ b/plugins/check_vsz.c
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"help", no_argument, 0, 'h'},
{"command", required_argument, 0, 'C'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
while (1) {
-#ifdef HAVE_GETOPT_H
c = getopt_long (argc, argv, "+hVc:w:C:", long_options, &option_index);
-#else
- c = getopt (argc, argv, "+hVc:w:C:");
-#endif
+
if (c == EOF)
break;