summaryrefslogtreecommitdiffstats
path: root/plugins/check_ups.c
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2002-11-12 11:26:01 (GMT)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2002-11-12 11:26:01 (GMT)
commit41367d9625c1d8a854bdeef4c09511ad4d93b192 (patch)
tree89f874444ede056c67cc4b5283e7b095efa9a255 /plugins/check_ups.c
parentfb38088231efc4fc87308f54713ab91f33378c90 (diff)
downloadmonitoring-plugins-41367d9625c1d8a854bdeef4c09511ad4d93b192.tar.gz
remove call_getopt
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@188 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_ups.c')
-rw-r--r--plugins/check_ups.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index c711de2..e250ef9 100644
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
@@ -82,7 +82,7 @@
82#define UPSSTATUS_UNKOWN 32 82#define UPSSTATUS_UNKOWN 32
83 83
84int server_port = PORT; 84int server_port = PORT;
85char *server_address = NULL; 85char *server_address = "127.0.0.1";
86char *ups_name = NULL; 86char *ups_name = NULL;
87double warning_value = 0.0L; 87double warning_value = 0.0L;
88double critical_value = 0.0L; 88double critical_value = 0.0L;
@@ -103,7 +103,6 @@ int determine_supported_vars (void);
103int get_ups_variable (const char *, char *, int); 103int get_ups_variable (const char *, char *, int);
104 104
105int process_arguments (int, char **); 105int process_arguments (int, char **);
106int call_getopt (int, char **);
107int validate_arguments (void); 106int validate_arguments (void);
108void print_help (void); 107void print_help (void);
109void print_usage (void); 108void print_usage (void);
@@ -547,17 +546,13 @@ process_arguments (int argc, char **argv)
547 } 546 }
548 547
549 548
550 if (server_address == NULL) { 549 if (server_address == NULL && argc > optind) {
551 if (optind >= argc) { 550 if (is_host (argv[optind]))
552 server_address = strscpy (NULL, "127.0.0.1");
553 }
554 else if (is_host (argv[optind])) {
555 server_address = argv[optind++]; 551 server_address = argv[optind++];
556 } 552 else
557 else {
558 usage ("Invalid host name"); 553 usage ("Invalid host name");
559 }
560 } 554 }
555
561 return validate_arguments(); 556 return validate_arguments();
562} 557}
563 558