diff options
| author | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | 2003-06-30 19:47:21 +0000 |
|---|---|---|
| committer | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | 2003-06-30 19:47:21 +0000 |
| commit | f813c747a264906c066d85d220e7b0f4aab3e046 (patch) | |
| tree | ba8dd633c0a5b5e92355adb606d190cd0863023b /plugins/check_smtp.c | |
| parent | 97634d8fc6bba849f771eda24106d88104e703b9 (diff) | |
| download | monitoring-plugins-f813c747a264906c066d85d220e7b0f4aab3e046.tar.gz | |
Added -4 and -6 command line options into check_http, check_ldap and
check_smtp
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@575 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_smtp.c')
| -rw-r--r-- | plugins/check_smtp.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index dd9f19bc..7562c4c6 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c | |||
| @@ -33,11 +33,15 @@ STATE_WARNING return values.\n"; | |||
| 33 | 33 | ||
| 34 | const char *option_summary = "\ | 34 | const char *option_summary = "\ |
| 35 | -H host [-p port] [-e expect] [-C command] [-f from addr]\n\ | 35 | -H host [-p port] [-e expect] [-C command] [-f from addr]\n\ |
| 36 | [-w warn] [-c crit] [-t timeout] [-n] [-v]"; | 36 | [-w warn] [-c crit] [-t timeout] [-n] [-v] [-4|-6]"; |
| 37 | 37 | ||
| 38 | const char *options = "\ | 38 | const char *options = "\ |
| 39 | -H, --hostname=STRING or IPADDRESS\n\ | 39 | -H, --hostname=STRING or IPADDRESS\n\ |
| 40 | Check server on the indicated host\n\ | 40 | Check server on the indicated host\n\ |
| 41 | -4, --use-ipv4\n\ | ||
| 42 | Use IPv4 protocol\n\ | ||
| 43 | -6, --use-ipv6\n\ | ||
| 44 | Use IPv6 protocol\n\ | ||
| 41 | -p, --port=INTEGER\n\ | 45 | -p, --port=INTEGER\n\ |
| 42 | Make connection on the indicated port (default: %d)\n\ | 46 | Make connection on the indicated port (default: %d)\n\ |
| 43 | -e, --expect=STRING\n\ | 47 | -e, --expect=STRING\n\ |
| @@ -233,6 +237,8 @@ process_arguments (int argc, char **argv) | |||
| 233 | {"nocommand", required_argument, 0, 'n'}, | 237 | {"nocommand", required_argument, 0, 'n'}, |
| 234 | {"verbose", no_argument, 0, 'v'}, | 238 | {"verbose", no_argument, 0, 'v'}, |
| 235 | {"version", no_argument, 0, 'V'}, | 239 | {"version", no_argument, 0, 'V'}, |
| 240 | {"use-ipv4", no_argument, 0, '4'}, | ||
| 241 | {"use-ipv6", no_argument, 0, '6'}, | ||
| 236 | {"help", no_argument, 0, 'h'}, | 242 | {"help", no_argument, 0, 'h'}, |
| 237 | {0, 0, 0, 0} | 243 | {0, 0, 0, 0} |
| 238 | }; | 244 | }; |
| @@ -250,7 +256,7 @@ process_arguments (int argc, char **argv) | |||
| 250 | } | 256 | } |
| 251 | 257 | ||
| 252 | while (1) { | 258 | while (1) { |
| 253 | c = getopt_long (argc, argv, "+hVvt:p:f:e:c:w:H:C:", | 259 | c = getopt_long (argc, argv, "+hVv46t:p:f:e:c:w:H:C:", |
| 254 | long_options, &option_index); | 260 | long_options, &option_index); |
| 255 | 261 | ||
| 256 | if (c == -1 || c == EOF) | 262 | if (c == -1 || c == EOF) |
| @@ -315,6 +321,16 @@ process_arguments (int argc, char **argv) | |||
| 315 | usage ("Time interval must be a nonnegative integer\n"); | 321 | usage ("Time interval must be a nonnegative integer\n"); |
| 316 | } | 322 | } |
| 317 | break; | 323 | break; |
| 324 | case '4': | ||
| 325 | address_family = AF_INET; | ||
| 326 | break; | ||
| 327 | case '6': | ||
| 328 | #ifdef USE_IPV6 | ||
| 329 | address_family = AF_INET6; | ||
| 330 | #else | ||
| 331 | usage ("IPv6 support not available\n"); | ||
| 332 | #endif | ||
| 333 | break; | ||
| 318 | case 'V': /* version */ | 334 | case 'V': /* version */ |
| 319 | print_revision (progname, revision); | 335 | print_revision (progname, revision); |
| 320 | exit (STATE_OK); | 336 | exit (STATE_OK); |
