diff options
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-11-19 06:45:18 +0000 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-11-19 06:45:18 +0000 |
commit | caa8bd6423e2d0d1b4e72c150e80b9c6a9e1b7fe (patch) | |
tree | 118fd80cc8ba27ef695a8e8ce409e5d70f4fa451 | |
parent | 16f53e0717b60660145388b0feb351628f606211 (diff) | |
download | monitoring-plugins-caa8bd6423e2d0d1b4e72c150e80b9c6a9e1b7fe.tar.gz |
Bulk EOL cleanup
$ git diff --ignore-space-change|diffstat
0 files changed
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2087 f882894a-f735-0410-b71e-b25c423dba1c
35 files changed, 183 insertions, 183 deletions
diff --git a/lib/parse_ini.c b/lib/parse_ini.c index 57321753..c19952db 100644 --- a/lib/parse_ini.c +++ b/lib/parse_ini.c | |||
@@ -82,7 +82,7 @@ static void parse_locator(const char *locator, const char *def_stanza, np_ini_in | |||
82 | } else { | 82 | } else { |
83 | i->file=strdup(&(locator[stanza_len+1])); | 83 | i->file=strdup(&(locator[stanza_len+1])); |
84 | } | 84 | } |
85 | 85 | ||
86 | if(i->file==NULL || i->stanza==NULL){ | 86 | if(i->file==NULL || i->stanza==NULL){ |
87 | die(STATE_UNKNOWN, _("malloc() failed!\n")); | 87 | die(STATE_UNKNOWN, _("malloc() failed!\n")); |
88 | } | 88 | } |
@@ -110,7 +110,7 @@ np_arg_list* np_get_defaults(const char *locator, const char *default_section){ | |||
110 | if(inifile!=stdin) fclose(inifile); | 110 | if(inifile!=stdin) fclose(inifile); |
111 | } | 111 | } |
112 | free(i.stanza); | 112 | free(i.stanza); |
113 | return defaults; | 113 | return defaults; |
114 | } | 114 | } |
115 | 115 | ||
116 | /* read_defaults is where the meat of the parsing takes place. | 116 | /* read_defaults is where the meat of the parsing takes place. |
@@ -161,7 +161,7 @@ static int read_defaults(FILE *f, const char *stanza, np_arg_list **opts){ | |||
161 | default: | 161 | default: |
162 | switch(stanzastate){ | 162 | switch(stanzastate){ |
163 | /* we never found the start of the first stanza, so | 163 | /* we never found the start of the first stanza, so |
164 | * we're dealing with a config error | 164 | * we're dealing with a config error |
165 | */ | 165 | */ |
166 | case NOSTANZA: | 166 | case NOSTANZA: |
167 | die(STATE_UNKNOWN, _("Config file error")); | 167 | die(STATE_UNKNOWN, _("Config file error")); |
diff --git a/lib/utils_base.c b/lib/utils_base.c index d1453c67..68f45675 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c | |||
@@ -89,7 +89,7 @@ range | |||
89 | set_range_end(temp_range, end); | 89 | set_range_end(temp_range, end); |
90 | } | 90 | } |
91 | 91 | ||
92 | if (temp_range->start_infinity == TRUE || | 92 | if (temp_range->start_infinity == TRUE || |
93 | temp_range->end_infinity == TRUE || | 93 | temp_range->end_infinity == TRUE || |
94 | temp_range->start <= temp_range->end) { | 94 | temp_range->start <= temp_range->end) { |
95 | return temp_range; | 95 | return temp_range; |
@@ -164,7 +164,7 @@ check_range(double value, range *my_range) | |||
164 | { | 164 | { |
165 | int no = FALSE; | 165 | int no = FALSE; |
166 | int yes = TRUE; | 166 | int yes = TRUE; |
167 | 167 | ||
168 | if (my_range->alert_on == INSIDE) { | 168 | if (my_range->alert_on == INSIDE) { |
169 | no = TRUE; | 169 | no = TRUE; |
170 | yes = FALSE; | 170 | yes = FALSE; |
diff --git a/lib/utils_disk.c b/lib/utils_disk.c index 3ce4d47d..ba2b21d7 100644 --- a/lib/utils_disk.c +++ b/lib/utils_disk.c | |||
@@ -91,7 +91,7 @@ np_del_parameter(struct parameter_list *item, struct parameter_list *prev) | |||
91 | return next; | 91 | return next; |
92 | } | 92 | } |
93 | 93 | ||
94 | 94 | ||
95 | /* returns a pointer to the struct found in the list */ | 95 | /* returns a pointer to the struct found in the list */ |
96 | struct parameter_list * | 96 | struct parameter_list * |
97 | np_find_parameter(struct parameter_list *list, const char *name) | 97 | np_find_parameter(struct parameter_list *list, const char *name) |
@@ -101,7 +101,7 @@ np_find_parameter(struct parameter_list *list, const char *name) | |||
101 | if (! strcmp(temp_list->name, name)) | 101 | if (! strcmp(temp_list->name, name)) |
102 | return temp_list; | 102 | return temp_list; |
103 | } | 103 | } |
104 | 104 | ||
105 | return NULL; | 105 | return NULL; |
106 | } | 106 | } |
107 | 107 | ||
@@ -126,7 +126,7 @@ np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list | |||
126 | if (! best_match) { | 126 | if (! best_match) { |
127 | for (me = mount_list; me; me = me->me_next) { | 127 | for (me = mount_list; me; me = me->me_next) { |
128 | size_t len = strlen (me->me_mountdir); | 128 | size_t len = strlen (me->me_mountdir); |
129 | if ((exact == FALSE && (best_match_len <= len && len <= name_len && | 129 | if ((exact == FALSE && (best_match_len <= len && len <= name_len && |
130 | (len == 1 || strncmp (me->me_mountdir, d->name, len) == 0))) | 130 | (len == 1 || strncmp (me->me_mountdir, d->name, len) == 0))) |
131 | || (exact == TRUE && strcmp(me->me_mountdir, d->name)==0)) | 131 | || (exact == TRUE && strcmp(me->me_mountdir, d->name)==0)) |
132 | { | 132 | { |
@@ -175,7 +175,7 @@ np_seen_name(struct name_list *list, const char *name) | |||
175 | } | 175 | } |
176 | 176 | ||
177 | int | 177 | int |
178 | np_regex_match_mount_entry (struct mount_entry* me, regex_t* re) | 178 | np_regex_match_mount_entry (struct mount_entry* me, regex_t* re) |
179 | { | 179 | { |
180 | if (regexec(re, me->me_devname, (size_t) 0, NULL, 0) == 0 || | 180 | if (regexec(re, me->me_devname, (size_t) 0, NULL, 0) == 0 || |
181 | regexec(re, me->me_mountdir, (size_t) 0, NULL, 0) == 0 ) { | 181 | regexec(re, me->me_mountdir, (size_t) 0, NULL, 0) == 0 ) { |
diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c index 5781f758..35874a93 100644 --- a/plugins-root/check_dhcp.c +++ b/plugins-root/check_dhcp.c | |||
@@ -79,8 +79,8 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; | |||
79 | 79 | ||
80 | #elif defined(__sun__) || defined(__solaris__) || defined(__hpux__) | 80 | #elif defined(__sun__) || defined(__solaris__) || defined(__hpux__) |
81 | 81 | ||
82 | #define INSAP 22 | 82 | #define INSAP 22 |
83 | #define OUTSAP 24 | 83 | #define OUTSAP 24 |
84 | 84 | ||
85 | #include <signal.h> | 85 | #include <signal.h> |
86 | #include <ctype.h> | 86 | #include <ctype.h> |
@@ -90,17 +90,17 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; | |||
90 | 90 | ||
91 | #define bcopy(source, destination, length) memcpy(destination, source, length) | 91 | #define bcopy(source, destination, length) memcpy(destination, source, length) |
92 | 92 | ||
93 | #define AREA_SZ 5000 /* buffer length in bytes */ | 93 | #define AREA_SZ 5000 /* buffer length in bytes */ |
94 | static u_long ctl_area[AREA_SZ]; | 94 | static u_long ctl_area[AREA_SZ]; |
95 | static u_long dat_area[AREA_SZ]; | 95 | static u_long dat_area[AREA_SZ]; |
96 | static struct strbuf ctl = {AREA_SZ, 0, (char *)ctl_area}; | 96 | static struct strbuf ctl = {AREA_SZ, 0, (char *)ctl_area}; |
97 | static struct strbuf dat = {AREA_SZ, 0, (char *)dat_area}; | 97 | static struct strbuf dat = {AREA_SZ, 0, (char *)dat_area}; |
98 | 98 | ||
99 | #define GOT_CTRL 1 | 99 | #define GOT_CTRL 1 |
100 | #define GOT_DATA 2 | 100 | #define GOT_DATA 2 |
101 | #define GOT_BOTH 3 | 101 | #define GOT_BOTH 3 |
102 | #define GOT_INTR 4 | 102 | #define GOT_INTR 4 |
103 | #define GOT_ERR 128 | 103 | #define GOT_ERR 128 |
104 | 104 | ||
105 | #define u_int8_t uint8_t | 105 | #define u_int8_t uint8_t |
106 | #define u_int16_t uint16_t | 106 | #define u_int16_t uint16_t |
@@ -222,7 +222,7 @@ dhcp_offer *dhcp_offer_list=NULL; | |||
222 | requested_server *requested_server_list=NULL; | 222 | requested_server *requested_server_list=NULL; |
223 | 223 | ||
224 | int valid_responses=0; /* number of valid DHCPOFFERs we received */ | 224 | int valid_responses=0; /* number of valid DHCPOFFERs we received */ |
225 | int requested_servers=0; | 225 | int requested_servers=0; |
226 | int requested_responses=0; | 226 | int requested_responses=0; |
227 | 227 | ||
228 | int request_specific_address=FALSE; | 228 | int request_specific_address=FALSE; |
@@ -382,7 +382,7 @@ int get_hardware_address(int sock,char *interface_name){ | |||
382 | unit = atoi(p) ; | 382 | unit = atoi(p) ; |
383 | *p = '\0' ; | 383 | *p = '\0' ; |
384 | strncat(dev, interface_name, 6) ; | 384 | strncat(dev, interface_name, 6) ; |
385 | } | 385 | } |
386 | else{ | 386 | else{ |
387 | printf(_("Error: can't find unit number in interface_name (%s) - expecting TypeNumber eg lnc0.\n"), interface_name); | 387 | printf(_("Error: can't find unit number in interface_name (%s) - expecting TypeNumber eg lnc0.\n"), interface_name); |
388 | exit(STATE_UNKNOWN); | 388 | exit(STATE_UNKNOWN); |
@@ -535,7 +535,7 @@ int send_dhcp_discover(int sock){ | |||
535 | /* send the DHCPDISCOVER packet out */ | 535 | /* send the DHCPDISCOVER packet out */ |
536 | send_dhcp_packet(&discover_packet,sizeof(discover_packet),sock,&sockaddr_broadcast); | 536 | send_dhcp_packet(&discover_packet,sizeof(discover_packet),sock,&sockaddr_broadcast); |
537 | 537 | ||
538 | if(verbose) | 538 | if(verbose) |
539 | printf("\n\n"); | 539 | printf("\n\n"); |
540 | 540 | ||
541 | return OK; | 541 | return OK; |
@@ -564,7 +564,7 @@ int get_dhcp_offer(int sock){ | |||
564 | if((current_time-start_time)>=dhcpoffer_timeout) | 564 | if((current_time-start_time)>=dhcpoffer_timeout) |
565 | break; | 565 | break; |
566 | 566 | ||
567 | if(verbose) | 567 | if(verbose) |
568 | printf("\n\n"); | 568 | printf("\n\n"); |
569 | 569 | ||
570 | bzero(&source,sizeof(source)); | 570 | bzero(&source,sizeof(source)); |
@@ -581,7 +581,7 @@ int get_dhcp_offer(int sock){ | |||
581 | continue; | 581 | continue; |
582 | } | 582 | } |
583 | else{ | 583 | else{ |
584 | if(verbose) | 584 | if(verbose) |
585 | printf(_("Result=OK\n")); | 585 | printf(_("Result=OK\n")); |
586 | 586 | ||
587 | responses++; | 587 | responses++; |
@@ -626,7 +626,7 @@ int get_dhcp_offer(int sock){ | |||
626 | printf("\n"); | 626 | printf("\n"); |
627 | 627 | ||
628 | if(result==ERROR){ | 628 | if(result==ERROR){ |
629 | if(verbose) | 629 | if(verbose) |
630 | printf(_("DHCPOFFER hardware address did not match our own - ignoring packet\n")); | 630 | printf(_("DHCPOFFER hardware address did not match our own - ignoring packet\n")); |
631 | 631 | ||
632 | continue; | 632 | continue; |
@@ -660,7 +660,7 @@ int send_dhcp_packet(void *buffer, int buffer_size, int sock, struct sockaddr_in | |||
660 | 660 | ||
661 | result=sendto(sock,(char *)buffer,buffer_size,0,(struct sockaddr *)dest,sizeof(*dest)); | 661 | result=sendto(sock,(char *)buffer,buffer_size,0,(struct sockaddr *)dest,sizeof(*dest)); |
662 | 662 | ||
663 | if(verbose) | 663 | if(verbose) |
664 | printf(_("send_dhcp_packet result: %d\n"),result); | 664 | printf(_("send_dhcp_packet result: %d\n"),result); |
665 | 665 | ||
666 | if(result<0) | 666 | if(result<0) |
@@ -853,7 +853,7 @@ int add_dhcp_offer(struct in_addr source,dhcp_packet *offer_packet){ | |||
853 | /* get option length */ | 853 | /* get option length */ |
854 | option_length=offer_packet->options[x++]; | 854 | option_length=offer_packet->options[x++]; |
855 | 855 | ||
856 | if(verbose) | 856 | if(verbose) |
857 | printf("Option: %d (0x%02X)\n",option_type,option_length); | 857 | printf("Option: %d (0x%02X)\n",option_type,option_length); |
858 | 858 | ||
859 | /* get option data */ | 859 | /* get option data */ |
@@ -989,7 +989,7 @@ int get_results(void){ | |||
989 | if(verbose){ | 989 | if(verbose){ |
990 | printf(_("DHCP Server Match: Offerer=%s"),inet_ntoa(temp_offer->server_address)); | 990 | printf(_("DHCP Server Match: Offerer=%s"),inet_ntoa(temp_offer->server_address)); |
991 | printf(_(" Requested=%s"),inet_ntoa(temp_server->server_address)); | 991 | printf(_(" Requested=%s"),inet_ntoa(temp_server->server_address)); |
992 | if(temp_server->answered) | 992 | if(temp_server->answered) |
993 | printf(_(" (duplicate)")); | 993 | printf(_(" (duplicate)")); |
994 | printf(_("\n")); | 994 | printf(_("\n")); |
995 | } | 995 | } |
@@ -1090,7 +1090,7 @@ int call_getopt(int argc, char **argv){ | |||
1090 | 1090 | ||
1091 | int option_index = 0; | 1091 | int option_index = 0; |
1092 | static struct option long_options[] = | 1092 | static struct option long_options[] = |
1093 | { | 1093 | { |
1094 | {"serverip", required_argument,0,'s'}, | 1094 | {"serverip", required_argument,0,'s'}, |
1095 | {"requestedip", required_argument,0,'r'}, | 1095 | {"requestedip", required_argument,0,'r'}, |
1096 | {"timeout", required_argument,0,'t'}, | 1096 | {"timeout", required_argument,0,'t'}, |
@@ -1306,7 +1306,7 @@ static int dl_bind(int fd, int sap, u_char *addr){ | |||
1306 | 1306 | ||
1307 | /*********************************************************************** | 1307 | /*********************************************************************** |
1308 | * interface: | 1308 | * interface: |
1309 | * function mac_addr_dlpi - get the mac address of the interface with | 1309 | * function mac_addr_dlpi - get the mac address of the interface with |
1310 | * type dev (eg lnc, hme) and unit (0, 1 ..) | 1310 | * type dev (eg lnc, hme) and unit (0, 1 ..) |
1311 | * | 1311 | * |
1312 | * parameter: addr: an array of six bytes, has to be allocated by the caller | 1312 | * parameter: addr: an array of six bytes, has to be allocated by the caller |
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index ff6c73b3..cc3f3d59 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c | |||
@@ -1313,7 +1313,7 @@ print_help(void) | |||
1313 | printf (" %s",_("timeout value (seconds, currently ")); | 1313 | printf (" %s",_("timeout value (seconds, currently ")); |
1314 | printf ("%u)\n", timeout); | 1314 | printf ("%u)\n", timeout); |
1315 | printf (" %s\n", "-b"); | 1315 | printf (" %s\n", "-b"); |
1316 | printf (" %s\n", _("Number of icmp data bytes to send")); | 1316 | printf (" %s\n", _("Number of icmp data bytes to send")); |
1317 | printf (" %s %u + %d)\n", _("Packet size will be data bytes + icmp header (currently"),icmp_data_size, ICMP_MINLEN); | 1317 | printf (" %s %u + %d)\n", _("Packet size will be data bytes + icmp header (currently"),icmp_data_size, ICMP_MINLEN); |
1318 | printf (" %s\n", "-v"); | 1318 | printf (" %s\n", "-v"); |
1319 | printf (" %s\n", _("verbose")); | 1319 | printf (" %s\n", _("verbose")); |
diff --git a/plugins-root/pst3.c b/plugins-root/pst3.c index b275a6bc..85136569 100644 --- a/plugins-root/pst3.c +++ b/plugins-root/pst3.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * Description: | 8 | * Description: |
9 | * | 9 | * |
10 | * This file contains the pst3 executable. This is a replacement ps command | 10 | * This file contains the pst3 executable. This is a replacement ps command |
11 | * for Solaris to get output which provides a long argument listing, which | 11 | * for Solaris to get output which provides a long argument listing, which |
12 | * is not possible with the standard ps command (due to truncation). /usr/ucb/ps | 12 | * is not possible with the standard ps command (due to truncation). /usr/ucb/ps |
13 | * also has issues where some fields run into each other. | 13 | * also has issues where some fields run into each other. |
14 | * | 14 | * |
@@ -17,7 +17,7 @@ | |||
17 | * | 17 | * |
18 | * Originally written by R.W.Ingraham | 18 | * Originally written by R.W.Ingraham |
19 | * Rewritten by Duncan Ferguson (Altinity Ltd, June 2008) | 19 | * Rewritten by Duncan Ferguson (Altinity Ltd, June 2008) |
20 | * The rewrite was necessary as /dev/kmem is not available within | 20 | * The rewrite was necessary as /dev/kmem is not available within |
21 | * non-global zones on Solaris 10 | 21 | * non-global zones on Solaris 10 |
22 | * | 22 | * |
23 | * Details for rewrite came from | 23 | * Details for rewrite came from |
@@ -48,7 +48,7 @@ | |||
48 | #include <fcntl.h> | 48 | #include <fcntl.h> |
49 | #include <procfs.h> | 49 | #include <procfs.h> |
50 | #include <errno.h> | 50 | #include <errno.h> |
51 | #include <sys/types32.h> | 51 | #include <sys/types32.h> |
52 | 52 | ||
53 | /* | 53 | /* |
54 | * Constants | 54 | * Constants |
@@ -125,8 +125,8 @@ int main (int argc, char **argv) | |||
125 | char *procname; | 125 | char *procname; |
126 | char *ptr; | 126 | char *ptr; |
127 | int argslen; | 127 | int argslen; |
128 | uintptr_t args_addr;; | 128 | uintptr_t args_addr;; |
129 | uintptr_t *args_vecs;; | 129 | uintptr_t *args_vecs;; |
130 | int args_count; | 130 | int args_count; |
131 | 131 | ||
132 | if(proc->d_name[0] == '.') | 132 | if(proc->d_name[0] == '.') |
@@ -146,8 +146,8 @@ try_again: | |||
146 | close(ps_fd); | 146 | close(ps_fd); |
147 | close(as_fd); | 147 | close(as_fd); |
148 | if(err == EAGAIN) goto try_again; | 148 | if(err == EAGAIN) goto try_again; |
149 | if(err != ENOENT) | 149 | if(err != ENOENT) |
150 | fprintf(stderr, "%s: read() on %s: %s\n", szProg, | 150 | fprintf(stderr, "%s: read() on %s: %s\n", szProg, |
151 | ps_name, strerror(err)); | 151 | ps_name, strerror(err)); |
152 | continue; | 152 | continue; |
153 | } | 153 | } |
@@ -185,7 +185,7 @@ try_again: | |||
185 | ); | 185 | ); |
186 | free(procname); | 186 | free(procname); |
187 | 187 | ||
188 | /* | 188 | /* |
189 | * and now for the command line stuff | 189 | * and now for the command line stuff |
190 | */ | 190 | */ |
191 | 191 | ||
@@ -195,18 +195,18 @@ try_again: | |||
195 | 195 | ||
196 | if(psinfo.pr_dmodel == PR_MODEL_NATIVE) { | 196 | if(psinfo.pr_dmodel == PR_MODEL_NATIVE) { |
197 | /* this process matches target process */ | 197 | /* this process matches target process */ |
198 | pread(as_fd,args_vecs, args_count * sizeof(uintptr_t), | 198 | pread(as_fd,args_vecs, args_count * sizeof(uintptr_t), |
199 | args_addr); | 199 | args_addr); |
200 | } else { | 200 | } else { |
201 | /* this process is 64bit, target process is 32 bit*/ | 201 | /* this process is 64bit, target process is 32 bit*/ |
202 | caddr32_t *args_vecs32 = (caddr32_t *)args_vecs; | 202 | caddr32_t *args_vecs32 = (caddr32_t *)args_vecs; |
203 | pread(as_fd,args_vecs32,args_count * sizeof(caddr32_t), | 203 | pread(as_fd,args_vecs32,args_count * sizeof(caddr32_t), |
204 | args_addr); | 204 | args_addr); |
205 | for (i=args_count-1;i>=0;--i) | 205 | for (i=args_count-1;i>=0;--i) |
206 | args_vecs[i]=args_vecs32[i]; | 206 | args_vecs[i]=args_vecs32[i]; |
207 | } | 207 | } |
208 | 208 | ||
209 | /* | 209 | /* |
210 | * now read in the args - if what we read in fills buffer | 210 | * now read in the args - if what we read in fills buffer |
211 | * resize buffer and reread that bit again | 211 | * resize buffer and reread that bit again |
212 | */ | 212 | */ |
diff --git a/plugins/check_apt.c b/plugins/check_apt.c index 440755d6..49a7c4f7 100644 --- a/plugins/check_apt.c +++ b/plugins/check_apt.c | |||
@@ -116,7 +116,7 @@ int main (int argc, char **argv) { | |||
116 | result = max_state(result, STATE_OK); | 116 | result = max_state(result, STATE_OK); |
117 | } | 117 | } |
118 | 118 | ||
119 | printf(_("APT %s: %d packages available for %s (%d critical updates). %s%s%s%s\n"), | 119 | printf(_("APT %s: %d packages available for %s (%d critical updates). %s%s%s%s\n"), |
120 | state_text(result), | 120 | state_text(result), |
121 | packages_available, | 121 | packages_available, |
122 | (upgrade==DIST_UPGRADE)?"dist-upgrade":"upgrade", | 122 | (upgrade==DIST_UPGRADE)?"dist-upgrade":"upgrade", |
@@ -305,7 +305,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount){ | |||
305 | } | 305 | } |
306 | regfree(&ireg); | 306 | regfree(&ireg); |
307 | regfree(&sreg); | 307 | regfree(&sreg); |
308 | if(do_exclude!=NULL) regfree(&ereg); | 308 | if(do_exclude!=NULL) regfree(&ereg); |
309 | free(cmdline); | 309 | free(cmdline); |
310 | return result; | 310 | return result; |
311 | } | 311 | } |
@@ -364,7 +364,7 @@ char* add_to_regexp(char *expr, const char *next){ | |||
364 | sprintf((char*)(re+strlen(re)-2), "|%s) ", next); | 364 | sprintf((char*)(re+strlen(re)-2), "|%s) ", next); |
365 | } | 365 | } |
366 | 366 | ||
367 | return re; | 367 | return re; |
368 | } | 368 | } |
369 | 369 | ||
370 | char* construct_cmdline(upgrade_type u, const char *opts){ | 370 | char* construct_cmdline(upgrade_type u, const char *opts){ |
diff --git a/plugins/check_cluster.c b/plugins/check_cluster.c index d4931499..04919e0d 100644 --- a/plugins/check_cluster.c +++ b/plugins/check_cluster.c | |||
@@ -124,7 +124,7 @@ int main(int argc, char **argv){ | |||
124 | } | 124 | } |
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | 128 | ||
129 | /* return the status of the cluster */ | 129 | /* return the status of the cluster */ |
130 | if(check_type==CHECK_SERVICES){ | 130 | if(check_type==CHECK_SERVICES){ |
@@ -149,7 +149,7 @@ int main(int argc, char **argv){ | |||
149 | int process_arguments(int argc, char **argv){ | 149 | int process_arguments(int argc, char **argv){ |
150 | int c; | 150 | int c; |
151 | int option=0; | 151 | int option=0; |
152 | static struct option longopts[]={ | 152 | static struct option longopts[]={ |
153 | {"data", required_argument,0,'d'}, | 153 | {"data", required_argument,0,'d'}, |
154 | {"warning", required_argument,0,'w'}, | 154 | {"warning", required_argument,0,'w'}, |
155 | {"critical", required_argument,0,'c'}, | 155 | {"critical", required_argument,0,'c'}, |
diff --git a/plugins/check_disk.c b/plugins/check_disk.c index f0950c95..3caf4a14 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c | |||
@@ -198,7 +198,7 @@ main (int argc, char **argv) | |||
198 | /* If a list of paths has not been selected, find entire | 198 | /* If a list of paths has not been selected, find entire |
199 | mount list and create list of paths | 199 | mount list and create list of paths |
200 | */ | 200 | */ |
201 | if (path_selected == FALSE) { | 201 | if (path_selected == FALSE) { |
202 | for (me = mount_list; me; me = me->me_next) { | 202 | for (me = mount_list; me; me = me->me_next) { |
203 | if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) { | 203 | if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) { |
204 | path = np_add_parameter(&path_select_list, me->me_mountdir); | 204 | path = np_add_parameter(&path_select_list, me->me_mountdir); |
@@ -293,8 +293,8 @@ main (int argc, char **argv) | |||
293 | /* Skip excluded fstypes */ | 293 | /* Skip excluded fstypes */ |
294 | } else if (fs_exclude_list && np_find_name (fs_exclude_list, me->me_type)) { | 294 | } else if (fs_exclude_list && np_find_name (fs_exclude_list, me->me_type)) { |
295 | continue; | 295 | continue; |
296 | /* Skip excluded fs's */ | 296 | /* Skip excluded fs's */ |
297 | } else if (dp_exclude_list && | 297 | } else if (dp_exclude_list && |
298 | (np_find_name (dp_exclude_list, me->me_devname) || | 298 | (np_find_name (dp_exclude_list, me->me_devname) || |
299 | np_find_name (dp_exclude_list, me->me_mountdir))) { | 299 | np_find_name (dp_exclude_list, me->me_mountdir))) { |
300 | continue; | 300 | continue; |
@@ -327,7 +327,7 @@ main (int argc, char **argv) | |||
327 | dfree_inodes_percent = 100 - dused_inodes_percent; | 327 | dfree_inodes_percent = 100 - dused_inodes_percent; |
328 | 328 | ||
329 | if (verbose >= 3) { | 329 | if (verbose >= 3) { |
330 | printf ("For %s, used_pct=%g free_pct=%g used_units=%g free_units=%g total_units=%g used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n", | 330 | printf ("For %s, used_pct=%g free_pct=%g used_units=%g free_units=%g total_units=%g used_inodes_pct=%g free_inodes_pct=%g fsp.fsu_blocksize=%llu mult=%llu\n", |
331 | me->me_mountdir, dused_pct, dfree_pct, dused_units, dfree_units, dtotal_units, dused_inodes_percent, dfree_inodes_percent, fsp.fsu_blocksize, mult); | 331 | me->me_mountdir, dused_pct, dfree_pct, dused_units, dfree_units, dtotal_units, dused_inodes_percent, dfree_inodes_percent, fsp.fsu_blocksize, mult); |
332 | } | 332 | } |
333 | 333 | ||
@@ -430,7 +430,7 @@ double calculate_percent(uintmax_t value, uintmax_t total) { | |||
430 | double pct = -1; | 430 | double pct = -1; |
431 | /* I don't understand the below, but it is taken from coreutils' df */ | 431 | /* I don't understand the below, but it is taken from coreutils' df */ |
432 | /* Seems to be calculating pct, in the best possible way */ | 432 | /* Seems to be calculating pct, in the best possible way */ |
433 | if (value <= TYPE_MAXIMUM(uintmax_t) / 100 | 433 | if (value <= TYPE_MAXIMUM(uintmax_t) / 100 |
434 | && total != 0) { | 434 | && total != 0) { |
435 | uintmax_t u100 = value * 100; | 435 | uintmax_t u100 = value * 100; |
436 | pct = u100 / total + (u100 % total != 0); | 436 | pct = u100 / total + (u100 % total != 0); |
@@ -546,7 +546,7 @@ process_arguments (int argc, char **argv) | |||
546 | } | 546 | } |
547 | break; | 547 | break; |
548 | 548 | ||
549 | /* Awful mistake where the range values do not make sense. Normally, | 549 | /* Awful mistake where the range values do not make sense. Normally, |
550 | you alert if the value is within the range, but since we are using | 550 | you alert if the value is within the range, but since we are using |
551 | freespace, we have to alert if outside the range. Thus we artifically | 551 | freespace, we have to alert if outside the range. Thus we artifically |
552 | force @ at the beginning of the range, so that it is backwards compatible | 552 | force @ at the beginning of the range, so that it is backwards compatible |
@@ -620,10 +620,10 @@ process_arguments (int argc, char **argv) | |||
620 | case 'L': | 620 | case 'L': |
621 | stat_remote_fs = 1; | 621 | stat_remote_fs = 1; |
622 | case 'l': | 622 | case 'l': |
623 | show_local_fs = 1; | 623 | show_local_fs = 1; |
624 | break; | 624 | break; |
625 | case 'p': /* select path */ | 625 | case 'p': /* select path */ |
626 | if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || | 626 | if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || |
627 | crit_freespace_percent || warn_usedspace_units || crit_usedspace_units || | 627 | crit_freespace_percent || warn_usedspace_units || crit_usedspace_units || |
628 | warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent || | 628 | warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent || |
629 | crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) { | 629 | crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) { |
@@ -714,7 +714,7 @@ process_arguments (int argc, char **argv) | |||
714 | case 'R': | 714 | case 'R': |
715 | cflags |= REG_ICASE; | 715 | cflags |= REG_ICASE; |
716 | case 'r': | 716 | case 'r': |
717 | if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || | 717 | if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || |
718 | crit_freespace_percent || warn_usedspace_units || crit_usedspace_units || | 718 | crit_freespace_percent || warn_usedspace_units || crit_usedspace_units || |
719 | warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent || | 719 | warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent || |
720 | crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) { | 720 | crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) { |
@@ -760,7 +760,7 @@ process_arguments (int argc, char **argv) | |||
760 | if (path_selected == FALSE) { | 760 | if (path_selected == FALSE) { |
761 | struct parameter_list *path; | 761 | struct parameter_list *path; |
762 | for (me = mount_list; me; me = me->me_next) { | 762 | for (me = mount_list; me; me = me->me_next) { |
763 | if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) | 763 | if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) |
764 | path = np_add_parameter(&path_select_list, me->me_mountdir); | 764 | path = np_add_parameter(&path_select_list, me->me_mountdir); |
765 | path->best_match = me; | 765 | path->best_match = me; |
766 | path->group = group; | 766 | path->group = group; |
@@ -819,7 +819,7 @@ process_arguments (int argc, char **argv) | |||
819 | 819 | ||
820 | 820 | ||
821 | void | 821 | void |
822 | print_path (const char *mypath) | 822 | print_path (const char *mypath) |
823 | { | 823 | { |
824 | if (mypath == NULL) | 824 | if (mypath == NULL) |
825 | printf ("\n"); | 825 | printf ("\n"); |
@@ -829,7 +829,7 @@ print_path (const char *mypath) | |||
829 | 829 | ||
830 | 830 | ||
831 | void | 831 | void |
832 | set_all_thresholds (struct parameter_list *path) | 832 | set_all_thresholds (struct parameter_list *path) |
833 | { | 833 | { |
834 | if (path->freespace_units != NULL) free(path->freespace_units); | 834 | if (path->freespace_units != NULL) free(path->freespace_units); |
835 | set_thresholds(&path->freespace_units, warn_freespace_units, crit_freespace_units); | 835 | set_thresholds(&path->freespace_units, warn_freespace_units, crit_freespace_units); |
diff --git a/plugins/check_dns.c b/plugins/check_dns.c index 19206c2c..6bedfefc 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c | |||
@@ -123,7 +123,7 @@ main (int argc, char **argv) | |||
123 | 123 | ||
124 | /* scan stdout */ | 124 | /* scan stdout */ |
125 | for(i = 0; i < chld_out.lines; i++) { | 125 | for(i = 0; i < chld_out.lines; i++) { |
126 | if (addresses == NULL) | 126 | if (addresses == NULL) |
127 | addresses = malloc(sizeof(*addresses)*10); | 127 | addresses = malloc(sizeof(*addresses)*10); |
128 | else if (!(n_addresses % 10)) | 128 | else if (!(n_addresses % 10)) |
129 | addresses = realloc(addresses,sizeof(*addresses) * (n_addresses + 10)); | 129 | addresses = realloc(addresses,sizeof(*addresses) * (n_addresses + 10)); |
@@ -289,7 +289,7 @@ error_scan (char *input_buffer) | |||
289 | strstr (input_buffer, ": REFUSED"))) | 289 | strstr (input_buffer, ": REFUSED"))) |
290 | die (STATE_CRITICAL, _("Connection to DNS %s was refused\n"), dns_server); | 290 | die (STATE_CRITICAL, _("Connection to DNS %s was refused\n"), dns_server); |
291 | 291 | ||
292 | /* Query refused (usually by an ACL in the namserver) */ | 292 | /* Query refused (usually by an ACL in the namserver) */ |
293 | else if (strstr (input_buffer, "Query refused")) | 293 | else if (strstr (input_buffer, "Query refused")) |
294 | die (STATE_CRITICAL, _("Query was refused by DNS server at %s\n"), dns_server); | 294 | die (STATE_CRITICAL, _("Query was refused by DNS server at %s\n"), dns_server); |
295 | 295 | ||
diff --git a/plugins/check_dummy.c b/plugins/check_dummy.c index 372aaff8..ff600a79 100644 --- a/plugins/check_dummy.c +++ b/plugins/check_dummy.c | |||
@@ -87,7 +87,7 @@ main (int argc, char **argv) | |||
87 | return STATE_UNKNOWN; | 87 | return STATE_UNKNOWN; |
88 | } | 88 | } |
89 | 89 | ||
90 | if (argc >= 3) | 90 | if (argc >= 3) |
91 | printf (": %s", argv[2]); | 91 | printf (": %s", argv[2]); |
92 | 92 | ||
93 | printf("\n"); | 93 | printf("\n"); |
diff --git a/plugins/check_game.c b/plugins/check_game.c index 4bc57c8f..2a23b742 100644 --- a/plugins/check_game.c +++ b/plugins/check_game.c | |||
@@ -105,7 +105,7 @@ main (int argc, char **argv) | |||
105 | /* was thinking about running qstat without any options, capturing the | 105 | /* was thinking about running qstat without any options, capturing the |
106 | -default line, parsing it & making an array of all know server types | 106 | -default line, parsing it & making an array of all know server types |
107 | but thought this would be too much hassle considering this is a tool | 107 | but thought this would be too much hassle considering this is a tool |
108 | for intelligent sysadmins (ha). Could put a static array of known | 108 | for intelligent sysadmins (ha). Could put a static array of known |
109 | server types in a header file but then we'd be limiting ourselves | 109 | server types in a header file but then we'd be limiting ourselves |
110 | 110 | ||
111 | In the end, I figured I'd simply let an error occur & then trap it | 111 | In the end, I figured I'd simply let an error occur & then trap it |
@@ -139,10 +139,10 @@ main (int argc, char **argv) | |||
139 | result = STATE_CRITICAL; | 139 | result = STATE_CRITICAL; |
140 | } | 140 | } |
141 | else { | 141 | else { |
142 | printf ("OK: %s/%s %s (%s), Ping: %s ms|%s %s\n", | 142 | printf ("OK: %s/%s %s (%s), Ping: %s ms|%s %s\n", |
143 | ret[qstat_game_players], | 143 | ret[qstat_game_players], |
144 | ret[qstat_game_players_max], | 144 | ret[qstat_game_players_max], |
145 | ret[qstat_game_field], | 145 | ret[qstat_game_field], |
146 | ret[qstat_map_field], | 146 | ret[qstat_map_field], |
147 | ret[qstat_ping_field], | 147 | ret[qstat_ping_field], |
148 | perfdata ("players", atol(ret[qstat_game_players]), "", | 148 | perfdata ("players", atol(ret[qstat_game_players]), "", |
@@ -345,7 +345,7 @@ print_usage (void) | |||
345 | * Test Cases: | 345 | * Test Cases: |
346 | * | 346 | * |
347 | * ./check_game --players 7 -p 8 --map 5 qs 67.20.190.61 26000 | 347 | * ./check_game --players 7 -p 8 --map 5 qs 67.20.190.61 26000 |
348 | * | 348 | * |
349 | * qstat -raw , -qs 67.20.190.61 | 349 | * qstat -raw , -qs 67.20.190.61 |
350 | * ==> QS,67.20.190.61,Nightmare.fintek.ca,67.20.190.61:26000,3,e2m1,6,0,83,0 | 350 | * ==> QS,67.20.190.61,Nightmare.fintek.ca,67.20.190.61:26000,3,e2m1,6,0,83,0 |
351 | * | 351 | * |
diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c index 044f08f6..c815cc70 100644 --- a/plugins/check_hpjd.c +++ b/plugins/check_hpjd.c | |||
@@ -123,7 +123,7 @@ main (int argc, char **argv) | |||
123 | HPJD_GD_DOOR_OPEN, HPJD_GD_PAPER_OUTPUT, HPJD_GD_STATUS_DISPLAY); | 123 | HPJD_GD_DOOR_OPEN, HPJD_GD_PAPER_OUTPUT, HPJD_GD_STATUS_DISPLAY); |
124 | 124 | ||
125 | /* get the command to run */ | 125 | /* get the command to run */ |
126 | sprintf (command_line, "%s -OQa -m : -v 1 -c %s %s %s", PATH_TO_SNMPGET, community, | 126 | sprintf (command_line, "%s -OQa -m : -v 1 -c %s %s %s", PATH_TO_SNMPGET, community, |
127 | address, query_string); | 127 | address, query_string); |
128 | 128 | ||
129 | /* run the command */ | 129 | /* run the command */ |
@@ -198,7 +198,7 @@ main (int argc, char **argv) | |||
198 | strcpy (display_message, temp_buffer + 1); | 198 | strcpy (display_message, temp_buffer + 1); |
199 | break; | 199 | break; |
200 | default: /* fold multiline message */ | 200 | default: /* fold multiline message */ |
201 | strncat (display_message, input_buffer, | 201 | strncat (display_message, input_buffer, |
202 | sizeof (display_message) - strlen (display_message) - 1); | 202 | sizeof (display_message) - strlen (display_message) - 1); |
203 | } | 203 | } |
204 | 204 | ||
@@ -218,7 +218,7 @@ main (int argc, char **argv) | |||
218 | sprintf (errmsg, "%s", input_buffer ); | 218 | sprintf (errmsg, "%s", input_buffer ); |
219 | 219 | ||
220 | } | 220 | } |
221 | 221 | ||
222 | /* close stderr */ | 222 | /* close stderr */ |
223 | (void) fclose (child_stderr); | 223 | (void) fclose (child_stderr); |
224 | 224 | ||
@@ -232,7 +232,7 @@ main (int argc, char **argv) | |||
232 | /* might not be the problem, but most likely is. */ | 232 | /* might not be the problem, but most likely is. */ |
233 | result = STATE_UNKNOWN ; | 233 | result = STATE_UNKNOWN ; |
234 | asprintf (&errmsg, "%s : Timeout from host %s\n", errmsg, address ); | 234 | asprintf (&errmsg, "%s : Timeout from host %s\n", errmsg, address ); |
235 | 235 | ||
236 | } | 236 | } |
237 | 237 | ||
238 | /* if we had no read errors, check the printer status results... */ | 238 | /* if we had no read errors, check the printer status results... */ |
@@ -326,7 +326,7 @@ process_arguments (int argc, char **argv) | |||
326 | if (argc < 2) | 326 | if (argc < 2) |
327 | return ERROR; | 327 | return ERROR; |
328 | 328 | ||
329 | 329 | ||
330 | while (1) { | 330 | while (1) { |
331 | c = getopt_long (argc, argv, "+hVH:C:", longopts, &option); | 331 | c = getopt_long (argc, argv, "+hVH:C:", longopts, &option); |
332 | 332 | ||
@@ -365,7 +365,7 @@ process_arguments (int argc, char **argv) | |||
365 | usage2 (_("Invalid hostname/address"), argv[c]); | 365 | usage2 (_("Invalid hostname/address"), argv[c]); |
366 | } | 366 | } |
367 | } | 367 | } |
368 | 368 | ||
369 | if (community == NULL) { | 369 | if (community == NULL) { |
370 | if (argv[c] != NULL ) | 370 | if (argv[c] != NULL ) |
371 | community = argv[c]; | 371 | community = argv[c]; |
diff --git a/plugins/check_http.c b/plugins/check_http.c index 0746741c..0d499d93 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -154,7 +154,7 @@ main (int argc, char **argv) | |||
154 | usage4 (_("Could not parse arguments")); | 154 | usage4 (_("Could not parse arguments")); |
155 | 155 | ||
156 | if (display_html == TRUE) | 156 | if (display_html == TRUE) |
157 | printf ("<A HREF=\"%s://%s:%d%s\" target=\"_blank\">", | 157 | printf ("<A HREF=\"%s://%s:%d%s\" target=\"_blank\">", |
158 | use_ssl ? "https" : "http", host_name ? host_name : server_address, | 158 | use_ssl ? "https" : "http", host_name ? host_name : server_address, |
159 | server_port, server_url); | 159 | server_port, server_url); |
160 | 160 | ||
@@ -314,7 +314,7 @@ process_arguments (int argc, char **argv) | |||
314 | if (!strcmp (optarg, "critical")) | 314 | if (!strcmp (optarg, "critical")) |
315 | onredirect = STATE_CRITICAL; | 315 | onredirect = STATE_CRITICAL; |
316 | if (verbose) | 316 | if (verbose) |
317 | printf(_("option f:%d \n"), onredirect); | 317 | printf(_("option f:%d \n"), onredirect); |
318 | break; | 318 | break; |
319 | /* Note: H, I, and u must be malloc'd or will fail on redirects */ | 319 | /* Note: H, I, and u must be malloc'd or will fail on redirects */ |
320 | case 'H': /* Host Name (virtual host) */ | 320 | case 'H': /* Host Name (virtual host) */ |
@@ -417,7 +417,7 @@ process_arguments (int argc, char **argv) | |||
417 | exit (STATE_WARNING); | 417 | exit (STATE_WARNING); |
418 | } else | 418 | } else |
419 | max_page_len = atoi(tmp); | 419 | max_page_len = atoi(tmp); |
420 | } else | 420 | } else |
421 | min_page_len = atoi (optarg); | 421 | min_page_len = atoi (optarg); |
422 | break; | 422 | break; |
423 | } | 423 | } |
@@ -556,7 +556,7 @@ parse_time_string (const char *string) | |||
556 | if (tm.tm_mon < 0 || tm.tm_mday < 1 || tm.tm_mday > 31) | 556 | if (tm.tm_mon < 0 || tm.tm_mday < 1 || tm.tm_mday > 31) |
557 | return 0; | 557 | return 0; |
558 | 558 | ||
559 | /* | 559 | /* |
560 | This is actually wrong: we need to subtract the local timezone | 560 | This is actually wrong: we need to subtract the local timezone |
561 | offset from GMT from this value. But, that's ok in this usage, | 561 | offset from GMT from this value. But, that's ok in this usage, |
562 | because we only comparing these two GMT dates against each other, | 562 | because we only comparing these two GMT dates against each other, |
@@ -990,7 +990,7 @@ check_http (void) | |||
990 | elapsed_time = (double)microsec / 1.0e6; | 990 | elapsed_time = (double)microsec / 1.0e6; |
991 | die (onredirect, | 991 | die (onredirect, |
992 | _(" - %s - %.3f second response time %s|%s %s\n"), | 992 | _(" - %s - %.3f second response time %s|%s %s\n"), |
993 | status_line, elapsed_time, | 993 | status_line, elapsed_time, |
994 | (display_html ? "</A>" : ""), | 994 | (display_html ? "</A>" : ""), |
995 | perfd_time (elapsed_time), perfd_size (pagesize)); | 995 | perfd_time (elapsed_time), perfd_size (pagesize)); |
996 | } /* end if (http_status >= 300) */ | 996 | } /* end if (http_status >= 300) */ |
@@ -1006,7 +1006,7 @@ check_http (void) | |||
1006 | elapsed_time = (double)microsec / 1.0e6; | 1006 | elapsed_time = (double)microsec / 1.0e6; |
1007 | asprintf (&msg, | 1007 | asprintf (&msg, |
1008 | _(" - %s - %.3f second response time %s|%s %s\n"), | 1008 | _(" - %s - %.3f second response time %s|%s %s\n"), |
1009 | status_line, elapsed_time, | 1009 | status_line, elapsed_time, |
1010 | (display_html ? "</A>" : ""), | 1010 | (display_html ? "</A>" : ""), |
1011 | perfd_time (elapsed_time), perfd_size (pagesize)); | 1011 | perfd_time (elapsed_time), perfd_size (pagesize)); |
1012 | if (check_critical_time == TRUE && elapsed_time > critical_time) | 1012 | if (check_critical_time == TRUE && elapsed_time > critical_time) |
@@ -1043,9 +1043,9 @@ check_http (void) | |||
1043 | exit (STATE_OK); | 1043 | exit (STATE_OK); |
1044 | } | 1044 | } |
1045 | else if ((errcode == REG_NOMATCH && invert_regex == 0) || (errcode == 0 && invert_regex == 1)) { | 1045 | else if ((errcode == REG_NOMATCH && invert_regex == 0) || (errcode == 0 && invert_regex == 1)) { |
1046 | if (invert_regex == 0) | 1046 | if (invert_regex == 0) |
1047 | msg = strdup(_("pattern not found")); | 1047 | msg = strdup(_("pattern not found")); |
1048 | else | 1048 | else |
1049 | msg = strdup(_("pattern found")); | 1049 | msg = strdup(_("pattern found")); |
1050 | printf (("%s - %s%s|%s %s\n"), | 1050 | printf (("%s - %s%s|%s %s\n"), |
1051 | _("HTTP CRITICAL"), | 1051 | _("HTTP CRITICAL"), |
@@ -1118,7 +1118,7 @@ redir (char *pos, char *status_line) | |||
1118 | if (i == 0) { | 1118 | if (i == 0) { |
1119 | pos += (size_t) strcspn (pos, "\r\n"); | 1119 | pos += (size_t) strcspn (pos, "\r\n"); |
1120 | pos += (size_t) strspn (pos, "\r\n"); | 1120 | pos += (size_t) strspn (pos, "\r\n"); |
1121 | if (strlen(pos) == 0) | 1121 | if (strlen(pos) == 0) |
1122 | die (STATE_UNKNOWN, | 1122 | die (STATE_UNKNOWN, |
1123 | _("HTTP UNKNOWN - Could not find redirect location - %s%s\n"), | 1123 | _("HTTP UNKNOWN - Could not find redirect location - %s%s\n"), |
1124 | status_line, (display_html ? "</A>" : "")); | 1124 | status_line, (display_html ? "</A>" : "")); |
@@ -1151,7 +1151,7 @@ redir (char *pos, char *status_line) | |||
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | /* URI_HTTP URI_HOST URI_PATH */ | 1153 | /* URI_HTTP URI_HOST URI_PATH */ |
1154 | else if (sscanf (pos, HD2, type, addr, url) == 3 ) { | 1154 | else if (sscanf (pos, HD2, type, addr, url) == 3 ) { |
1155 | url = prepend_slash (url); | 1155 | url = prepend_slash (url); |
1156 | use_ssl = server_type_check (type); | 1156 | use_ssl = server_type_check (type); |
1157 | i = server_port_check (use_ssl); | 1157 | i = server_port_check (use_ssl); |
@@ -1181,7 +1181,7 @@ redir (char *pos, char *status_line) | |||
1181 | i = server_port; | 1181 | i = server_port; |
1182 | strcpy (type, server_type); | 1182 | strcpy (type, server_type); |
1183 | strcpy (addr, host_name ? host_name : server_address); | 1183 | strcpy (addr, host_name ? host_name : server_address); |
1184 | } | 1184 | } |
1185 | 1185 | ||
1186 | else { | 1186 | else { |
1187 | die (STATE_UNKNOWN, | 1187 | die (STATE_UNKNOWN, |
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index 3d6f05c4..d0134a09 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c | |||
@@ -87,15 +87,15 @@ main (int argc, char *argv[]) | |||
87 | LDAPMessage *result; | 87 | LDAPMessage *result; |
88 | 88 | ||
89 | /* should be int result = STATE_UNKNOWN; */ | 89 | /* should be int result = STATE_UNKNOWN; */ |
90 | 90 | ||
91 | int status = STATE_UNKNOWN; | 91 | int status = STATE_UNKNOWN; |
92 | long microsec; | 92 | long microsec; |
93 | double elapsed_time; | 93 | double elapsed_time; |
94 | 94 | ||
95 | /* for ldap tls */ | 95 | /* for ldap tls */ |
96 | 96 | ||
97 | int tls; | 97 | int tls; |
98 | int version=3; | 98 | int version=3; |
99 | 99 | ||
100 | setlocale (LC_ALL, ""); | 100 | setlocale (LC_ALL, ""); |
101 | bindtextdomain (PACKAGE, LOCALEDIR); | 101 | bindtextdomain (PACKAGE, LOCALEDIR); |
@@ -129,7 +129,7 @@ main (int argc, char *argv[]) | |||
129 | printf ("Could not connect to the server at port %i\n", ld_port); | 129 | printf ("Could not connect to the server at port %i\n", ld_port); |
130 | return STATE_CRITICAL; | 130 | return STATE_CRITICAL; |
131 | } | 131 | } |
132 | #else | 132 | #else |
133 | if (!(ld = ldap_open (ld_host, ld_port))) { | 133 | if (!(ld = ldap_open (ld_host, ld_port))) { |
134 | if (verbose) | 134 | if (verbose) |
135 | ldap_perror(ld, "ldap_open"); | 135 | ldap_perror(ld, "ldap_open"); |
@@ -137,7 +137,7 @@ main (int argc, char *argv[]) | |||
137 | return STATE_CRITICAL; | 137 | return STATE_CRITICAL; |
138 | } | 138 | } |
139 | #endif /* HAVE_LDAP_INIT */ | 139 | #endif /* HAVE_LDAP_INIT */ |
140 | 140 | ||
141 | #ifdef HAVE_LDAP_SET_OPTION | 141 | #ifdef HAVE_LDAP_SET_OPTION |
142 | /* set ldap options */ | 142 | /* set ldap options */ |
143 | if (ldap_set_option (ld, LDAP_OPT_PROTOCOL_VERSION, &ld_protocol) != | 143 | if (ldap_set_option (ld, LDAP_OPT_PROTOCOL_VERSION, &ld_protocol) != |
@@ -152,7 +152,7 @@ main (int argc, char *argv[]) | |||
152 | #if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS) | 152 | #if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS) |
153 | /* ldaps: set option tls */ | 153 | /* ldaps: set option tls */ |
154 | tls = LDAP_OPT_X_TLS_HARD; | 154 | tls = LDAP_OPT_X_TLS_HARD; |
155 | 155 | ||
156 | if (ldap_set_option (ld, LDAP_OPT_X_TLS, &tls) != LDAP_SUCCESS) | 156 | if (ldap_set_option (ld, LDAP_OPT_X_TLS, &tls) != LDAP_SUCCESS) |
157 | { | 157 | { |
158 | if (verbose) | 158 | if (verbose) |
@@ -179,7 +179,7 @@ main (int argc, char *argv[]) | |||
179 | /* call start_tls */ | 179 | /* call start_tls */ |
180 | if (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) | 180 | if (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) |
181 | { | 181 | { |
182 | if (verbose) | 182 | if (verbose) |
183 | ldap_perror(ld, "ldap_start_tls"); | 183 | ldap_perror(ld, "ldap_start_tls"); |
184 | printf (_("Could not init startTLS at port %i!\n"), ld_port); | 184 | printf (_("Could not init startTLS at port %i!\n"), ld_port); |
185 | return STATE_CRITICAL; | 185 | return STATE_CRITICAL; |
@@ -189,7 +189,7 @@ main (int argc, char *argv[]) | |||
189 | return STATE_CRITICAL; | 189 | return STATE_CRITICAL; |
190 | #endif /* HAVE_LDAP_START_TLS_S */ | 190 | #endif /* HAVE_LDAP_START_TLS_S */ |
191 | } | 191 | } |
192 | 192 | ||
193 | /* bind to the ldap server */ | 193 | /* bind to the ldap server */ |
194 | if (ldap_bind_s (ld, ld_binddn, ld_passwd, LDAP_AUTH_SIMPLE) != | 194 | if (ldap_bind_s (ld, ld_binddn, ld_passwd, LDAP_AUTH_SIMPLE) != |
195 | LDAP_SUCCESS) { | 195 | LDAP_SUCCESS) { |
diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c index 62b0cf08..a0bdbeba 100644 --- a/plugins/check_mrtg.c +++ b/plugins/check_mrtg.c | |||
@@ -380,7 +380,7 @@ print_help (void) | |||
380 | 380 | ||
381 | 381 | ||
382 | 382 | ||
383 | /* original command line: | 383 | /* original command line: |
384 | <log_file> <expire_minutes> <AVG|MAX> <variable> <vwl> <vcl> <label> [units] */ | 384 | <log_file> <expire_minutes> <AVG|MAX> <variable> <vwl> <vcl> <label> [units] */ |
385 | 385 | ||
386 | void | 386 | void |
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c index d82dea14..77f3b89b 100644 --- a/plugins/check_mysql.c +++ b/plugins/check_mysql.c | |||
@@ -71,9 +71,9 @@ main (int argc, char **argv) | |||
71 | MYSQL mysql; | 71 | MYSQL mysql; |
72 | MYSQL_RES *res; | 72 | MYSQL_RES *res; |
73 | MYSQL_ROW row; | 73 | MYSQL_ROW row; |
74 | 74 | ||
75 | /* should be status */ | 75 | /* should be status */ |
76 | 76 | ||
77 | char *result = NULL; | 77 | char *result = NULL; |
78 | char *error = NULL; | 78 | char *error = NULL; |
79 | char slaveresult[SLAVERESULTSIZE]; | 79 | char slaveresult[SLAVERESULTSIZE]; |
@@ -186,7 +186,7 @@ main (int argc, char **argv) | |||
186 | mysql_close (&mysql); | 186 | mysql_close (&mysql); |
187 | die (STATE_CRITICAL, "Slave status unavailable\n"); | 187 | die (STATE_CRITICAL, "Slave status unavailable\n"); |
188 | } | 188 | } |
189 | 189 | ||
190 | snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s Seconds Behind Master: %s", row[slave_io_field], row[slave_sql_field], row[seconds_behind_field]); | 190 | snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s Seconds Behind Master: %s", row[slave_io_field], row[slave_sql_field], row[seconds_behind_field]); |
191 | if (strcmp (row[slave_io_field], "Yes") != 0 || strcmp (row[slave_sql_field], "Yes") != 0) { | 191 | if (strcmp (row[slave_io_field], "Yes") != 0 || strcmp (row[slave_sql_field], "Yes") != 0) { |
192 | mysql_free_result (res); | 192 | mysql_free_result (res); |
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c index dfe60808..a2debe21 100644 --- a/plugins/check_nagios.c +++ b/plugins/check_nagios.c | |||
@@ -187,8 +187,8 @@ main (int argc, char **argv) | |||
187 | printf (ngettext ("%d process", "%d processes", proc_entries), proc_entries); | 187 | printf (ngettext ("%d process", "%d processes", proc_entries), proc_entries); |
188 | printf (", "); | 188 | printf (", "); |
189 | printf ( | 189 | printf ( |
190 | ngettext ("status log updated %d second ago", | 190 | ngettext ("status log updated %d second ago", |
191 | "status log updated %d seconds ago", | 191 | "status log updated %d seconds ago", |
192 | (int) (current_time - latest_entry_time) ), | 192 | (int) (current_time - latest_entry_time) ), |
193 | (int) (current_time - latest_entry_time) ); | 193 | (int) (current_time - latest_entry_time) ); |
194 | printf ("\n"); | 194 | printf ("\n"); |
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c index 489ad60a..20ecf64f 100644 --- a/plugins/check_ntp.c +++ b/plugins/check_ntp.c | |||
@@ -80,7 +80,7 @@ typedef struct { | |||
80 | 80 | ||
81 | /* this structure holds data about results from querying offset from a peer */ | 81 | /* this structure holds data about results from querying offset from a peer */ |
82 | typedef struct { | 82 | typedef struct { |
83 | time_t waiting; /* ts set when we started waiting for a response */ | 83 | time_t waiting; /* ts set when we started waiting for a response */ |
84 | int num_responses; /* number of successfully recieved responses */ | 84 | int num_responses; /* number of successfully recieved responses */ |
85 | uint8_t stratum; /* copied verbatim from the ntp_message */ | 85 | uint8_t stratum; /* copied verbatim from the ntp_message */ |
86 | double rtdelay; /* converted from the ntp_message */ | 86 | double rtdelay; /* converted from the ntp_message */ |
@@ -150,7 +150,7 @@ typedef struct { | |||
150 | they are divided into halves, each being a 16-bit int in network byte order: | 150 | they are divided into halves, each being a 16-bit int in network byte order: |
151 | - the first 16 bits are an int on the left side of a decimal point. | 151 | - the first 16 bits are an int on the left side of a decimal point. |
152 | - the second 16 bits represent a fraction n/(2^16) | 152 | - the second 16 bits represent a fraction n/(2^16) |
153 | likewise for the 64-bit "fixed point" numbers with everything doubled :) | 153 | likewise for the 64-bit "fixed point" numbers with everything doubled :) |
154 | **/ | 154 | **/ |
155 | 155 | ||
156 | /* macros to access the left/right 16 bits of a 32-bit ntp "fixed point" | 156 | /* macros to access the left/right 16 bits of a 32-bit ntp "fixed point" |
@@ -265,7 +265,7 @@ void print_ntp_control_message(const ntp_control_message *p){ | |||
265 | if(p->op&REM_RESP && p->op&OP_READSTAT){ | 265 | if(p->op&REM_RESP && p->op&OP_READSTAT){ |
266 | peer=(ntp_assoc_status_pair*)p->data; | 266 | peer=(ntp_assoc_status_pair*)p->data; |
267 | for(i=0;i<numpeers;i++){ | 267 | for(i=0;i<numpeers;i++){ |
268 | printf("\tpeer id %.2x status %.2x", | 268 | printf("\tpeer id %.2x status %.2x", |
269 | ntohs(peer[i].assoc), ntohs(peer[i].status)); | 269 | ntohs(peer[i].assoc), ntohs(peer[i].status)); |
270 | if (PEER_SEL(peer[i].status) >= PEER_INCLUDED){ | 270 | if (PEER_SEL(peer[i].status) >= PEER_INCLUDED){ |
271 | if(PEER_SEL(peer[i].status) >= PEER_SYNCSOURCE){ | 271 | if(PEER_SEL(peer[i].status) >= PEER_SYNCSOURCE){ |
@@ -353,7 +353,7 @@ int best_offset_server(const ntp_server_results *slist, int nservers){ | |||
353 | 353 | ||
354 | /* do everything we need to get the total average offset | 354 | /* do everything we need to get the total average offset |
355 | * - we use a certain amount of parallelization with poll() to ensure | 355 | * - we use a certain amount of parallelization with poll() to ensure |
356 | * we don't waste time sitting around waiting for single packets. | 356 | * we don't waste time sitting around waiting for single packets. |
357 | * - we also "manually" handle resolving host names and connecting, because | 357 | * - we also "manually" handle resolving host names and connecting, because |
358 | * we have to do it in a way that our lazy macros don't handle currently :( */ | 358 | * we have to do it in a way that our lazy macros don't handle currently :( */ |
359 | double offset_request(const char *host, int *status){ | 359 | double offset_request(const char *host, int *status){ |
@@ -667,7 +667,7 @@ int process_arguments(int argc, char **argv){ | |||
667 | {0, 0, 0, 0} | 667 | {0, 0, 0, 0} |
668 | }; | 668 | }; |
669 | 669 | ||
670 | 670 | ||
671 | if (argc < 2) | 671 | if (argc < 2) |
672 | usage ("\n"); | 672 | usage ("\n"); |
673 | 673 | ||
diff --git a/plugins/check_ntp_peer.c b/plugins/check_ntp_peer.c index e489a580..17876dd8 100644 --- a/plugins/check_ntp_peer.c +++ b/plugins/check_ntp_peer.c | |||
@@ -162,7 +162,7 @@ void print_ntp_control_message(const ntp_control_message *p){ | |||
162 | if(p->op&REM_RESP && p->op&OP_READSTAT){ | 162 | if(p->op&REM_RESP && p->op&OP_READSTAT){ |
163 | peer=(ntp_assoc_status_pair*)p->data; | 163 | peer=(ntp_assoc_status_pair*)p->data; |
164 | for(i=0;i<numpeers;i++){ | 164 | for(i=0;i<numpeers;i++){ |
165 | printf("\tpeer id %.2x status %.2x", | 165 | printf("\tpeer id %.2x status %.2x", |
166 | ntohs(peer[i].assoc), ntohs(peer[i].status)); | 166 | ntohs(peer[i].assoc), ntohs(peer[i].status)); |
167 | if (PEER_SEL(peer[i].status) >= PEER_INCLUDED){ | 167 | if (PEER_SEL(peer[i].status) >= PEER_INCLUDED){ |
168 | if(PEER_SEL(peer[i].status) >= PEER_SYNCSOURCE){ | 168 | if(PEER_SEL(peer[i].status) >= PEER_SYNCSOURCE){ |
@@ -477,7 +477,7 @@ int process_arguments(int argc, char **argv){ | |||
477 | {0, 0, 0, 0} | 477 | {0, 0, 0, 0} |
478 | }; | 478 | }; |
479 | 479 | ||
480 | 480 | ||
481 | if (argc < 2) | 481 | if (argc < 2) |
482 | usage ("\n"); | 482 | usage ("\n"); |
483 | 483 | ||
diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c index 655541e0..a5b122f3 100644 --- a/plugins/check_ntp_time.c +++ b/plugins/check_ntp_time.c | |||
@@ -81,7 +81,7 @@ typedef struct { | |||
81 | 81 | ||
82 | /* this structure holds data about results from querying offset from a peer */ | 82 | /* this structure holds data about results from querying offset from a peer */ |
83 | typedef struct { | 83 | typedef struct { |
84 | time_t waiting; /* ts set when we started waiting for a response */ | 84 | time_t waiting; /* ts set when we started waiting for a response */ |
85 | int num_responses; /* number of successfully recieved responses */ | 85 | int num_responses; /* number of successfully recieved responses */ |
86 | uint8_t stratum; /* copied verbatim from the ntp_message */ | 86 | uint8_t stratum; /* copied verbatim from the ntp_message */ |
87 | double rtdelay; /* converted from the ntp_message */ | 87 | double rtdelay; /* converted from the ntp_message */ |
@@ -132,7 +132,7 @@ typedef struct { | |||
132 | they are divided into halves, each being a 16-bit int in network byte order: | 132 | they are divided into halves, each being a 16-bit int in network byte order: |
133 | - the first 16 bits are an int on the left side of a decimal point. | 133 | - the first 16 bits are an int on the left side of a decimal point. |
134 | - the second 16 bits represent a fraction n/(2^16) | 134 | - the second 16 bits represent a fraction n/(2^16) |
135 | likewise for the 64-bit "fixed point" numbers with everything doubled :) | 135 | likewise for the 64-bit "fixed point" numbers with everything doubled :) |
136 | **/ | 136 | **/ |
137 | 137 | ||
138 | /* macros to access the left/right 16 bits of a 32-bit ntp "fixed point" | 138 | /* macros to access the left/right 16 bits of a 32-bit ntp "fixed point" |
@@ -299,7 +299,7 @@ int best_offset_server(const ntp_server_results *slist, int nservers){ | |||
299 | 299 | ||
300 | /* do everything we need to get the total average offset | 300 | /* do everything we need to get the total average offset |
301 | * - we use a certain amount of parallelization with poll() to ensure | 301 | * - we use a certain amount of parallelization with poll() to ensure |
302 | * we don't waste time sitting around waiting for single packets. | 302 | * we don't waste time sitting around waiting for single packets. |
303 | * - we also "manually" handle resolving host names and connecting, because | 303 | * - we also "manually" handle resolving host names and connecting, because |
304 | * we have to do it in a way that our lazy macros don't handle currently :( */ | 304 | * we have to do it in a way that our lazy macros don't handle currently :( */ |
305 | double offset_request(const char *host, int *status){ | 305 | double offset_request(const char *host, int *status){ |
@@ -461,7 +461,7 @@ int process_arguments(int argc, char **argv){ | |||
461 | {0, 0, 0, 0} | 461 | {0, 0, 0, 0} |
462 | }; | 462 | }; |
463 | 463 | ||
464 | 464 | ||
465 | if (argc < 2) | 465 | if (argc < 2) |
466 | usage ("\n"); | 466 | usage ("\n"); |
467 | 467 | ||
diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c index b4fd3c73..c0e5ece9 100644 --- a/plugins/check_nwstat.c +++ b/plugins/check_nwstat.c | |||
@@ -203,7 +203,7 @@ main(int argc, char **argv) { | |||
203 | 203 | ||
204 | /* check CPU load */ | 204 | /* check CPU load */ |
205 | if (vars_to_check==LOAD1 || vars_to_check==LOAD5 || vars_to_check==LOAD15) { | 205 | if (vars_to_check==LOAD1 || vars_to_check==LOAD5 || vars_to_check==LOAD15) { |
206 | 206 | ||
207 | switch(vars_to_check) { | 207 | switch(vars_to_check) { |
208 | case LOAD1: | 208 | case LOAD1: |
209 | temp_buffer = strdup ("1"); | 209 | temp_buffer = strdup ("1"); |
@@ -249,7 +249,7 @@ main(int argc, char **argv) { | |||
249 | temp_buffer, | 249 | temp_buffer, |
250 | utilization, | 250 | utilization, |
251 | warning_value, | 251 | warning_value, |
252 | critical_value); | 252 | critical_value); |
253 | 253 | ||
254 | /* check number of user connections */ | 254 | /* check number of user connections */ |
255 | } else if (vars_to_check==CONNS) { | 255 | } else if (vars_to_check==CONNS) { |
@@ -457,7 +457,7 @@ main(int argc, char **argv) { | |||
457 | critical_value); | 457 | critical_value); |
458 | } | 458 | } |
459 | 459 | ||
460 | 460 | ||
461 | /* check % free space on volume */ | 461 | /* check % free space on volume */ |
462 | } else if (vars_to_check==VPF) { | 462 | } else if (vars_to_check==VPF) { |
463 | 463 | ||
@@ -568,11 +568,11 @@ main(int argc, char **argv) { | |||
568 | result=STATE_WARNING; | 568 | result=STATE_WARNING; |
569 | asprintf (&output_message,_("Warning - NRM Status is suspect!")); | 569 | asprintf (&output_message,_("Warning - NRM Status is suspect!")); |
570 | } | 570 | } |
571 | 571 | ||
572 | asprintf (&output_message,_("OK - NRM Status is good!")); | 572 | asprintf (&output_message,_("OK - NRM Status is good!")); |
573 | } | 573 | } |
574 | 574 | ||
575 | 575 | ||
576 | 576 | ||
577 | /* check packet receive buffers */ | 577 | /* check packet receive buffers */ |
578 | } else if (vars_to_check==UPRB || vars_to_check==PUPRB) { | 578 | } else if (vars_to_check==UPRB || vars_to_check==PUPRB) { |
@@ -827,7 +827,7 @@ main(int argc, char **argv) { | |||
827 | open_files, | 827 | open_files, |
828 | warning_value, | 828 | warning_value, |
829 | critical_value); | 829 | critical_value); |
830 | 830 | ||
831 | 831 | ||
832 | /* check # of abended threads (Netware > 5.x only) */ | 832 | /* check # of abended threads (Netware > 5.x only) */ |
833 | } else if (vars_to_check==ABENDS) { | 833 | } else if (vars_to_check==ABENDS) { |
@@ -914,7 +914,7 @@ main(int argc, char **argv) { | |||
914 | 914 | ||
915 | 915 | ||
916 | 916 | ||
917 | 917 | ||
918 | /* check LRU sitting time in secondss */ | 918 | /* check LRU sitting time in secondss */ |
919 | } else if (vars_to_check==LRUS) { | 919 | } else if (vars_to_check==LRUS) { |
920 | 920 | ||
@@ -977,7 +977,7 @@ main(int argc, char **argv) { | |||
977 | total_cache_buffers, | 977 | total_cache_buffers, |
978 | warning_value, | 978 | warning_value, |
979 | critical_value); | 979 | critical_value); |
980 | 980 | ||
981 | } else if (vars_to_check==DSVER) { | 981 | } else if (vars_to_check==DSVER) { |
982 | 982 | ||
983 | close(sd); | 983 | close(sd); |
@@ -1005,7 +1005,7 @@ main(int argc, char **argv) { | |||
1005 | 1005 | ||
1006 | recv_buffer[sizeof(recv_buffer)-1]=0; | 1006 | recv_buffer[sizeof(recv_buffer)-1]=0; |
1007 | recv_buffer[strlen(recv_buffer)-1]=0; | 1007 | recv_buffer[strlen(recv_buffer)-1]=0; |
1008 | 1008 | ||
1009 | asprintf (&output_message,_("Up %s"),recv_buffer); | 1009 | asprintf (&output_message,_("Up %s"),recv_buffer); |
1010 | 1010 | ||
1011 | } else if (vars_to_check==NLM) { | 1011 | } else if (vars_to_check==NLM) { |
@@ -1024,7 +1024,7 @@ main(int argc, char **argv) { | |||
1024 | } else { | 1024 | } else { |
1025 | result=STATE_CRITICAL; | 1025 | result=STATE_CRITICAL; |
1026 | asprintf (&output_message,_("Module %s is not loaded"),nlm_name); | 1026 | asprintf (&output_message,_("Module %s is not loaded"),nlm_name); |
1027 | 1027 | ||
1028 | } | 1028 | } |
1029 | } else if (vars_to_check==NRMP) { | 1029 | } else if (vars_to_check==NRMP) { |
1030 | 1030 | ||
@@ -1313,7 +1313,7 @@ int process_arguments(int argc, char **argv) { | |||
1313 | 1313 | ||
1314 | int option = 0; | 1314 | int option = 0; |
1315 | static struct option longopts[] = | 1315 | static struct option longopts[] = |
1316 | { | 1316 | { |
1317 | {"port", required_argument,0,'p'}, | 1317 | {"port", required_argument,0,'p'}, |
1318 | {"timeout", required_argument,0,'t'}, | 1318 | {"timeout", required_argument,0,'t'}, |
1319 | {"critical", required_argument,0,'c'}, | 1319 | {"critical", required_argument,0,'c'}, |
@@ -1498,7 +1498,7 @@ int process_arguments(int argc, char **argv) { | |||
1498 | nrmm_name = strdup (optarg+4); | 1498 | nrmm_name = strdup (optarg+4); |
1499 | if (!strcmp(nrmm_name,"")) | 1499 | if (!strcmp(nrmm_name,"")) |
1500 | nrmm_name = strdup ("AVAILABLE_CACHE_MEMORY"); | 1500 | nrmm_name = strdup ("AVAILABLE_CACHE_MEMORY"); |
1501 | 1501 | ||
1502 | } | 1502 | } |
1503 | 1503 | ||
1504 | else if (strncmp(optarg,"NRMS",4)==0) { | 1504 | else if (strncmp(optarg,"NRMS",4)==0) { |
@@ -1506,7 +1506,7 @@ int process_arguments(int argc, char **argv) { | |||
1506 | nrms_name = strdup (optarg+4); | 1506 | nrms_name = strdup (optarg+4); |
1507 | if (!strcmp(nrms_name,"")) | 1507 | if (!strcmp(nrms_name,"")) |
1508 | nrms_name = strdup ("USED_SWAP_SPACE"); | 1508 | nrms_name = strdup ("USED_SWAP_SPACE"); |
1509 | 1509 | ||
1510 | } | 1510 | } |
1511 | 1511 | ||
1512 | else if (strncmp(optarg,"NSS1",4)==0) { | 1512 | else if (strncmp(optarg,"NSS1",4)==0) { |
@@ -1514,7 +1514,7 @@ int process_arguments(int argc, char **argv) { | |||
1514 | nss1_name = strdup (optarg+4); | 1514 | nss1_name = strdup (optarg+4); |
1515 | if (!strcmp(nss1_name,"")) | 1515 | if (!strcmp(nss1_name,"")) |
1516 | nss1_name = strdup ("CURRENTBUFFERCACHESIZE"); | 1516 | nss1_name = strdup ("CURRENTBUFFERCACHESIZE"); |
1517 | 1517 | ||
1518 | } | 1518 | } |
1519 | 1519 | ||
1520 | else if (strncmp(optarg,"NSS2",4)==0) { | 1520 | else if (strncmp(optarg,"NSS2",4)==0) { |
@@ -1522,7 +1522,7 @@ int process_arguments(int argc, char **argv) { | |||
1522 | nss2_name = strdup (optarg+4); | 1522 | nss2_name = strdup (optarg+4); |
1523 | if (!strcmp(nss2_name,"")) | 1523 | if (!strcmp(nss2_name,"")) |
1524 | nss2_name = strdup ("CACHEHITS"); | 1524 | nss2_name = strdup ("CACHEHITS"); |
1525 | 1525 | ||
1526 | } | 1526 | } |
1527 | 1527 | ||
1528 | else if (strncmp(optarg,"NSS3",4)==0) { | 1528 | else if (strncmp(optarg,"NSS3",4)==0) { |
@@ -1530,7 +1530,7 @@ int process_arguments(int argc, char **argv) { | |||
1530 | nss3_name = strdup (optarg+4); | 1530 | nss3_name = strdup (optarg+4); |
1531 | if (!strcmp(nss3_name,"")) | 1531 | if (!strcmp(nss3_name,"")) |
1532 | nss3_name = strdup ("CACHEGITPERCENT"); | 1532 | nss3_name = strdup ("CACHEGITPERCENT"); |
1533 | 1533 | ||
1534 | } | 1534 | } |
1535 | 1535 | ||
1536 | else if (strncmp(optarg,"NSS4",4)==0) { | 1536 | else if (strncmp(optarg,"NSS4",4)==0) { |
@@ -1538,7 +1538,7 @@ int process_arguments(int argc, char **argv) { | |||
1538 | nss4_name = strdup (optarg+4); | 1538 | nss4_name = strdup (optarg+4); |
1539 | if (!strcmp(nss4_name,"")) | 1539 | if (!strcmp(nss4_name,"")) |
1540 | nss4_name = strdup ("CURRENTOPENCOUNT"); | 1540 | nss4_name = strdup ("CURRENTOPENCOUNT"); |
1541 | 1541 | ||
1542 | } | 1542 | } |
1543 | 1543 | ||
1544 | else if (strncmp(optarg,"NSS5",4)==0) { | 1544 | else if (strncmp(optarg,"NSS5",4)==0) { |
@@ -1546,7 +1546,7 @@ int process_arguments(int argc, char **argv) { | |||
1546 | nss5_name = strdup (optarg+4); | 1546 | nss5_name = strdup (optarg+4); |
1547 | if (!strcmp(nss5_name,"")) | 1547 | if (!strcmp(nss5_name,"")) |
1548 | nss5_name = strdup ("CACHEMISSES"); | 1548 | nss5_name = strdup ("CACHEMISSES"); |
1549 | 1549 | ||
1550 | } | 1550 | } |
1551 | 1551 | ||
1552 | 1552 | ||
@@ -1555,7 +1555,7 @@ int process_arguments(int argc, char **argv) { | |||
1555 | nss6_name = strdup (optarg+4); | 1555 | nss6_name = strdup (optarg+4); |
1556 | if (!strcmp(nss6_name,"")) | 1556 | if (!strcmp(nss6_name,"")) |
1557 | nss6_name = strdup ("PENDINGWORKSCOUNT"); | 1557 | nss6_name = strdup ("PENDINGWORKSCOUNT"); |
1558 | 1558 | ||
1559 | } | 1559 | } |
1560 | 1560 | ||
1561 | 1561 | ||
@@ -1564,7 +1564,7 @@ int process_arguments(int argc, char **argv) { | |||
1564 | nss7_name = strdup (optarg+4); | 1564 | nss7_name = strdup (optarg+4); |
1565 | if (!strcmp(nss7_name,"")) | 1565 | if (!strcmp(nss7_name,"")) |
1566 | nss7_name = strdup ("CACHESIZE"); | 1566 | nss7_name = strdup ("CACHESIZE"); |
1567 | 1567 | ||
1568 | } | 1568 | } |
1569 | 1569 | ||
1570 | 1570 | ||
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c index 1a93f6bf..869ef673 100644 --- a/plugins/check_pgsql.c +++ b/plugins/check_pgsql.c | |||
@@ -186,7 +186,7 @@ main (int argc, char **argv) | |||
186 | status = STATE_OK; | 186 | status = STATE_OK; |
187 | } | 187 | } |
188 | PQfinish (conn); | 188 | PQfinish (conn); |
189 | printf (_(" %s - database %s (%d sec.)|%s\n"), | 189 | printf (_(" %s - database %s (%d sec.)|%s\n"), |
190 | state_text(status), dbName, elapsed_time, | 190 | state_text(status), dbName, elapsed_time, |
191 | fperfdata("time", elapsed_time, "s", | 191 | fperfdata("time", elapsed_time, "s", |
192 | (int)twarn, twarn, (int)tcrit, tcrit, TRUE, 0, FALSE,0)); | 192 | (int)twarn, twarn, (int)tcrit, tcrit, TRUE, 0, FALSE,0)); |
@@ -355,7 +355,7 @@ is_pg_dbname (char *dbname) | |||
355 | 355 | ||
356 | /** | 356 | /** |
357 | 357 | ||
358 | the tango program should eventually create an entity here based on the | 358 | the tango program should eventually create an entity here based on the |
359 | function prototype | 359 | function prototype |
360 | 360 | ||
361 | @@- | 361 | @@- |
@@ -389,7 +389,7 @@ is_pg_logname (char *username) | |||
389 | 389 | ||
390 | /****************************************************************************** | 390 | /****************************************************************************** |
391 | @@- | 391 | @@- |
392 | </sect2> | 392 | </sect2> |
393 | </sect1> | 393 | </sect1> |
394 | </article> | 394 | </article> |
395 | -@@ | 395 | -@@ |
diff --git a/plugins/check_ping.c b/plugins/check_ping.c index 0f3292d0..c457ad64 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c | |||
@@ -112,7 +112,7 @@ main (int argc, char **argv) | |||
112 | #endif | 112 | #endif |
113 | 113 | ||
114 | for (i = 0 ; i < n_addresses ; i++) { | 114 | for (i = 0 ; i < n_addresses ; i++) { |
115 | 115 | ||
116 | #ifdef PING6_COMMAND | 116 | #ifdef PING6_COMMAND |
117 | if (address_family != AF_INET && is_inet6_addr(addresses[i])) | 117 | if (address_family != AF_INET && is_inet6_addr(addresses[i])) |
118 | rawcmd = strdup(PING6_COMMAND); | 118 | rawcmd = strdup(PING6_COMMAND); |
@@ -150,8 +150,8 @@ main (int argc, char **argv) | |||
150 | else if (pl >= wpl || rta >= wrta) | 150 | else if (pl >= wpl || rta >= wrta) |
151 | this_result = STATE_WARNING; | 151 | this_result = STATE_WARNING; |
152 | else if (pl >= 0 && rta >= 0) | 152 | else if (pl >= 0 && rta >= 0) |
153 | this_result = max_state (STATE_OK, this_result); | 153 | this_result = max_state (STATE_OK, this_result); |
154 | 154 | ||
155 | if (n_addresses > 1 && this_result != STATE_UNKNOWN) | 155 | if (n_addresses > 1 && this_result != STATE_UNKNOWN) |
156 | die (STATE_OK, "%s is alive\n", addresses[i]); | 156 | die (STATE_OK, "%s is alive\n", addresses[i]); |
157 | 157 | ||
@@ -370,7 +370,7 @@ get_threshold (char *arg, float *trta, int *tpl) | |||
370 | return OK; | 370 | return OK; |
371 | else if (strpbrk (arg, ",:") && strstr (arg, "%") && sscanf (arg, "%f%*[:,]%d%%", trta, tpl) == 2) | 371 | else if (strpbrk (arg, ",:") && strstr (arg, "%") && sscanf (arg, "%f%*[:,]%d%%", trta, tpl) == 2) |
372 | return OK; | 372 | return OK; |
373 | else if (strstr (arg, "%") && sscanf (arg, "%d%%", tpl) == 1) | 373 | else if (strstr (arg, "%") && sscanf (arg, "%d%%", tpl) == 1) |
374 | return OK; | 374 | return OK; |
375 | 375 | ||
376 | usage2 (_("%s: Warning threshold must be integer or percentage!\n\n"), arg); | 376 | usage2 (_("%s: Warning threshold must be integer or percentage!\n\n"), arg); |
diff --git a/plugins/check_radius.c b/plugins/check_radius.c index 5021a57a..e0b0e2c2 100644 --- a/plugins/check_radius.c +++ b/plugins/check_radius.c | |||
@@ -169,8 +169,8 @@ main (int argc, char **argv) | |||
169 | (nasid==NULL || my_rc_avpair_add (&data.send_pairs, PW_NAS_IDENTIFIER, nasid, 0)))) | 169 | (nasid==NULL || my_rc_avpair_add (&data.send_pairs, PW_NAS_IDENTIFIER, nasid, 0)))) |
170 | die (STATE_UNKNOWN, _("Out of Memory?")); | 170 | die (STATE_UNKNOWN, _("Out of Memory?")); |
171 | 171 | ||
172 | /* | 172 | /* |
173 | * Fill in NAS-IP-Address | 173 | * Fill in NAS-IP-Address |
174 | */ | 174 | */ |
175 | 175 | ||
176 | if ((client_id = my_rc_own_ipaddress ()) == 0) | 176 | if ((client_id = my_rc_own_ipaddress ()) == 0) |
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index 8ff10b82..4986fe65 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c | |||
@@ -168,7 +168,7 @@ main (int argc, char **argv) | |||
168 | 168 | ||
169 | if (verbose && smtp_use_dummycmd) | 169 | if (verbose && smtp_use_dummycmd) |
170 | printf ("FROM CMD: %s", cmd_str); | 170 | printf ("FROM CMD: %s", cmd_str); |
171 | 171 | ||
172 | /* initialize alarm signal handling */ | 172 | /* initialize alarm signal handling */ |
173 | (void) signal (SIGALRM, socket_timeout_alarm_handler); | 173 | (void) signal (SIGALRM, socket_timeout_alarm_handler); |
174 | 174 | ||
@@ -285,7 +285,7 @@ main (int argc, char **argv) | |||
285 | # endif /* USE_OPENSSL */ | 285 | # endif /* USE_OPENSSL */ |
286 | } | 286 | } |
287 | #endif | 287 | #endif |
288 | 288 | ||
289 | /* sendmail will syslog a "NOQUEUE" error if session does not attempt | 289 | /* sendmail will syslog a "NOQUEUE" error if session does not attempt |
290 | * to do something useful. This can be prevented by giving a command | 290 | * to do something useful. This can be prevented by giving a command |
291 | * even if syntax is illegal (MAIL requires a FROM:<...> argument) | 291 | * even if syntax is illegal (MAIL requires a FROM:<...> argument) |
@@ -746,7 +746,7 @@ recvlines(char *buf, size_t bufsize) | |||
746 | } | 746 | } |
747 | 747 | ||
748 | 748 | ||
749 | int | 749 | int |
750 | my_close (void) | 750 | my_close (void) |
751 | { | 751 | { |
752 | #ifdef HAVE_SSL | 752 | #ifdef HAVE_SSL |
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 544c5c0b..0aafd951 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c | |||
@@ -199,10 +199,10 @@ main (int argc, char **argv) | |||
199 | PATH_TO_SNMPGET, timeout_interval, retries, miblist, proto, | 199 | PATH_TO_SNMPGET, timeout_interval, retries, miblist, proto, |
200 | "[authpriv]", server_address, port, oid); | 200 | "[authpriv]", server_address, port, oid); |
201 | } | 201 | } |
202 | 202 | ||
203 | if (verbose) | 203 | if (verbose) |
204 | printf ("%s\n", command_line); | 204 | printf ("%s\n", command_line); |
205 | 205 | ||
206 | 206 | ||
207 | /* run the command */ | 207 | /* run the command */ |
208 | child_process = spopen (command_line); | 208 | child_process = spopen (command_line); |
@@ -236,7 +236,7 @@ main (int argc, char **argv) | |||
236 | if (copylen > sizeof(perfstr)-strlen(perfstr)-1) | 236 | if (copylen > sizeof(perfstr)-strlen(perfstr)-1) |
237 | copylen = sizeof(perfstr)-strlen(perfstr)-1; | 237 | copylen = sizeof(perfstr)-strlen(perfstr)-1; |
238 | ptr2 = ptr; | 238 | ptr2 = ptr; |
239 | ptr = foo; | 239 | ptr = foo; |
240 | 240 | ||
241 | if (ptr == NULL) | 241 | if (ptr == NULL) |
242 | break; | 242 | break; |
@@ -309,7 +309,7 @@ main (int argc, char **argv) | |||
309 | eval_method[i] & WARN_EQ || | 309 | eval_method[i] & WARN_EQ || |
310 | eval_method[i] & WARN_NE) { | 310 | eval_method[i] & WARN_NE) { |
311 | p2 = strpbrk (p2, "0123456789"); | 311 | p2 = strpbrk (p2, "0123456789"); |
312 | if (p2 == NULL) | 312 | if (p2 == NULL) |
313 | die (STATE_UNKNOWN,_("No valid data returned")); | 313 | die (STATE_UNKNOWN,_("No valid data returned")); |
314 | response_value[i] = strtoul (p2, NULL, 10); | 314 | response_value[i] = strtoul (p2, NULL, 10); |
315 | iresult = check_num (i); | 315 | iresult = check_num (i); |
@@ -346,7 +346,7 @@ main (int argc, char **argv) | |||
346 | iresult = STATE_CRITICAL; | 346 | iresult = STATE_CRITICAL; |
347 | else if (eval_method[i] & WARN_PRESENT) | 347 | else if (eval_method[i] & WARN_PRESENT) |
348 | iresult = STATE_WARNING; | 348 | iresult = STATE_WARNING; |
349 | else if (response && iresult == STATE_DEPENDENT) | 349 | else if (response && iresult == STATE_DEPENDENT) |
350 | iresult = STATE_OK; | 350 | iresult = STATE_OK; |
351 | } | 351 | } |
352 | 352 | ||
@@ -473,7 +473,7 @@ process_arguments (int argc, char **argv) | |||
473 | usage5 (); | 473 | usage5 (); |
474 | case 'h': /* help */ | 474 | case 'h': /* help */ |
475 | print_help (); | 475 | print_help (); |
476 | exit (STATE_OK); | 476 | exit (STATE_OK); |
477 | case 'V': /* version */ | 477 | case 'V': /* version */ |
478 | print_revision (progname, revision); | 478 | print_revision (progname, revision); |
479 | exit (STATE_OK); | 479 | exit (STATE_OK); |
@@ -571,7 +571,7 @@ process_arguments (int argc, char **argv) | |||
571 | jj++; | 571 | jj++; |
572 | ii++; | 572 | ii++; |
573 | } | 573 | } |
574 | if (c == 'E') | 574 | if (c == 'E') |
575 | eval_method[j+1] |= WARN_PRESENT; | 575 | eval_method[j+1] |= WARN_PRESENT; |
576 | else if (c == 'e') | 576 | else if (c == 'e') |
577 | eval_method[j+1] |= CRIT_PRESENT; | 577 | eval_method[j+1] |= CRIT_PRESENT; |
@@ -672,7 +672,7 @@ process_arguments (int argc, char **argv) | |||
672 | 672 | ||
673 | if (community == NULL) | 673 | if (community == NULL) |
674 | community = strdup (DEFAULT_COMMUNITY); | 674 | community = strdup (DEFAULT_COMMUNITY); |
675 | 675 | ||
676 | 676 | ||
677 | 677 | ||
678 | return validate_arguments (); | 678 | return validate_arguments (); |
@@ -687,8 +687,8 @@ process_arguments (int argc, char **argv) | |||
687 | 687 | ||
688 | <para>&PROTO_validate_arguments;</para> | 688 | <para>&PROTO_validate_arguments;</para> |
689 | 689 | ||
690 | <para>Checks to see if the default miblist needs to be loaded. Also verifies | 690 | <para>Checks to see if the default miblist needs to be loaded. Also verifies |
691 | the authentication and authorization combinations based on protocol version | 691 | the authentication and authorization combinations based on protocol version |
692 | selected.</para> | 692 | selected.</para> |
693 | 693 | ||
694 | <para></para> | 694 | <para></para> |
@@ -713,16 +713,16 @@ validate_arguments () | |||
713 | 713 | ||
714 | 714 | ||
715 | /* Need better checks to verify seclevel and authproto choices */ | 715 | /* Need better checks to verify seclevel and authproto choices */ |
716 | 716 | ||
717 | if (seclevel == NULL) | 717 | if (seclevel == NULL) |
718 | asprintf (&seclevel, "noAuthNoPriv"); | 718 | asprintf (&seclevel, "noAuthNoPriv"); |
719 | 719 | ||
720 | 720 | ||
721 | if (authproto == NULL ) | 721 | if (authproto == NULL ) |
722 | asprintf(&authproto, DEFAULT_AUTH_PROTOCOL); | 722 | asprintf(&authproto, DEFAULT_AUTH_PROTOCOL); |
723 | 723 | ||
724 | 724 | ||
725 | 725 | ||
726 | if (proto == NULL || (strcmp(proto,DEFAULT_PROTOCOL) == 0) ) { /* default protocol version */ | 726 | if (proto == NULL || (strcmp(proto,DEFAULT_PROTOCOL) == 0) ) { /* default protocol version */ |
727 | asprintf(&proto, DEFAULT_PROTOCOL); | 727 | asprintf(&proto, DEFAULT_PROTOCOL); |
728 | asprintf(&authpriv, "%s%s", "-c ", community); | 728 | asprintf(&authpriv, "%s%s", "-c ", community); |
@@ -732,7 +732,7 @@ validate_arguments () | |||
732 | } | 732 | } |
733 | else if ( strcmp (proto, "3") == 0 ) { /* snmpv3 args */ | 733 | else if ( strcmp (proto, "3") == 0 ) { /* snmpv3 args */ |
734 | asprintf(&proto, "%s", "3"); | 734 | asprintf(&proto, "%s", "3"); |
735 | 735 | ||
736 | if ( (strcmp(seclevel, "noAuthNoPriv") == 0) || seclevel == NULL ) { | 736 | if ( (strcmp(seclevel, "noAuthNoPriv") == 0) || seclevel == NULL ) { |
737 | asprintf(&authpriv, "%s", "-l noAuthNoPriv" ); | 737 | asprintf(&authpriv, "%s", "-l noAuthNoPriv" ); |
738 | } | 738 | } |
@@ -752,12 +752,12 @@ validate_arguments () | |||
752 | } | 752 | } |
753 | asprintf(&authpriv, "-l authPriv -a %s -u %s -A %s -x DES -X %s ", authproto, secname, authpasswd, privpasswd); | 753 | asprintf(&authpriv, "-l authPriv -a %s -u %s -A %s -x DES -X %s ", authproto, secname, authpasswd, privpasswd); |
754 | } | 754 | } |
755 | 755 | ||
756 | } | 756 | } |
757 | else { | 757 | else { |
758 | usage2 (_("Invalid SNMP version"), proto); | 758 | usage2 (_("Invalid SNMP version"), proto); |
759 | } | 759 | } |
760 | 760 | ||
761 | return OK; | 761 | return OK; |
762 | } | 762 | } |
763 | 763 | ||
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c index 4b5f6b76..2e16e651 100644 --- a/plugins/check_ssh.c +++ b/plugins/check_ssh.c | |||
@@ -78,7 +78,7 @@ main (int argc, char **argv) | |||
78 | 78 | ||
79 | /* initialize alarm signal handling */ | 79 | /* initialize alarm signal handling */ |
80 | signal (SIGALRM, socket_timeout_alarm_handler); | 80 | signal (SIGALRM, socket_timeout_alarm_handler); |
81 | 81 | ||
82 | alarm (socket_timeout); | 82 | alarm (socket_timeout); |
83 | 83 | ||
84 | /* ssh_connect exits if error is found */ | 84 | /* ssh_connect exits if error is found */ |
@@ -255,7 +255,7 @@ ssh_connect (char *haddr, int hport, char *remote_version) | |||
255 | close(sd); | 255 | close(sd); |
256 | exit (STATE_WARNING); | 256 | exit (STATE_WARNING); |
257 | } | 257 | } |
258 | 258 | ||
259 | printf | 259 | printf |
260 | (_("SSH OK - %s (protocol %s)\n"), | 260 | (_("SSH OK - %s (protocol %s)\n"), |
261 | ssh_server, ssh_proto); | 261 | ssh_server, ssh_proto); |
@@ -294,7 +294,7 @@ print_help (void) | |||
294 | 294 | ||
295 | printf (" %s\n", "-r, --remote-version=STRING"); | 295 | printf (" %s\n", "-r, --remote-version=STRING"); |
296 | printf (" %s\n", _("Warn if string doesn't match expected server version (ex: OpenSSH_3.9p1)")); | 296 | printf (" %s\n", _("Warn if string doesn't match expected server version (ex: OpenSSH_3.9p1)")); |
297 | 297 | ||
298 | printf (_(UT_VERBOSE)); | 298 | printf (_(UT_VERBOSE)); |
299 | 299 | ||
300 | #ifdef NP_EXTRA_OPTS | 300 | #ifdef NP_EXTRA_OPTS |
diff --git a/plugins/check_swap.c b/plugins/check_swap.c index 04cc1aee..f0269633 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c | |||
@@ -507,7 +507,7 @@ validate_arguments (void) | |||
507 | return ERROR; | 507 | return ERROR; |
508 | } | 508 | } |
509 | else if (warn_percent < crit_percent) { | 509 | else if (warn_percent < crit_percent) { |
510 | usage4 | 510 | usage4 |
511 | (_("Warning percentage should be more than critical percentage")); | 511 | (_("Warning percentage should be more than critical percentage")); |
512 | } | 512 | } |
513 | else if (warn_size_bytes < crit_size_bytes) { | 513 | else if (warn_size_bytes < crit_size_bytes) { |
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index f5ef7818..0d81497e 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c | |||
@@ -24,7 +24,7 @@ | |||
24 | * | 24 | * |
25 | * You should have received a copy of the GNU General Public License | 25 | * You should have received a copy of the GNU General Public License |
26 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 26 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
27 | * | 27 | * |
28 | * $Id$ | 28 | * $Id$ |
29 | * | 29 | * |
30 | *****************************************************************************/ | 30 | *****************************************************************************/ |
@@ -315,7 +315,7 @@ main (int argc, char **argv) | |||
315 | } | 315 | } |
316 | #ifdef HAVE_SSL | 316 | #ifdef HAVE_SSL |
317 | np_net_ssl_cleanup(); | 317 | np_net_ssl_cleanup(); |
318 | #endif | 318 | #endif |
319 | if (sd) close (sd); | 319 | if (sd) close (sd); |
320 | 320 | ||
321 | microsec = deltime (tv); | 321 | microsec = deltime (tv); |
diff --git a/plugins/check_time.c b/plugins/check_time.c index b6d9e38a..f9a292c0 100644 --- a/plugins/check_time.c +++ b/plugins/check_time.c | |||
@@ -115,7 +115,7 @@ main (int argc, char **argv) | |||
115 | result = STATE_WARNING; | 115 | result = STATE_WARNING; |
116 | else | 116 | else |
117 | result = STATE_UNKNOWN; | 117 | result = STATE_UNKNOWN; |
118 | die (result, | 118 | die (result, |
119 | _("TIME UNKNOWN - could not send UDP request to server %s, port %d\n"), | 119 | _("TIME UNKNOWN - could not send UDP request to server %s, port %d\n"), |
120 | server_address, server_port); | 120 | server_address, server_port); |
121 | } | 121 | } |
diff --git a/plugins/check_ups.c b/plugins/check_ups.c index bbd963a9..a498d203 100644 --- a/plugins/check_ups.c +++ b/plugins/check_ups.c | |||
@@ -403,7 +403,7 @@ get_ups_variable (const char *varname, char *buf, size_t buflen) | |||
403 | int len; | 403 | int len; |
404 | 404 | ||
405 | *buf=0; | 405 | *buf=0; |
406 | 406 | ||
407 | /* create the command string to send to the UPS daemon */ | 407 | /* create the command string to send to the UPS daemon */ |
408 | /* Add LOGOUT to avoid read failure logs */ | 408 | /* Add LOGOUT to avoid read failure logs */ |
409 | sprintf (send_buffer, "GET VAR %s %s\nLOGOUT\n", ups_name, varname); | 409 | sprintf (send_buffer, "GET VAR %s %s\nLOGOUT\n", ups_name, varname); |
@@ -453,7 +453,7 @@ get_ups_variable (const char *varname, char *buf, size_t buflen) | |||
453 | } | 453 | } |
454 | 454 | ||
455 | 455 | ||
456 | /* Command line: CHECK_UPS -H <host_address> -u ups [-p port] [-v variable] | 456 | /* Command line: CHECK_UPS -H <host_address> -u ups [-p port] [-v variable] |
457 | [-wv warn_value] [-cv crit_value] [-to to_sec] */ | 457 | [-wv warn_value] [-cv crit_value] [-to to_sec] */ |
458 | 458 | ||
459 | 459 | ||
@@ -508,7 +508,7 @@ process_arguments (int argc, char **argv) | |||
508 | usage2 (_("Invalid hostname/address"), optarg); | 508 | usage2 (_("Invalid hostname/address"), optarg); |
509 | } | 509 | } |
510 | break; | 510 | break; |
511 | case 'T': /* FIXME: to be improved (ie "-T C" for Celsius or "-T F" for Farenheit) */ | 511 | case 'T': /* FIXME: to be improved (ie "-T C" for Celsius or "-T F" for Farenheit) */ |
512 | temp_output_c = 1; | 512 | temp_output_c = 1; |
513 | break; | 513 | break; |
514 | case 'u': /* ups name */ | 514 | case 'u': /* ups name */ |
diff --git a/plugins/netutils.c b/plugins/netutils.c index 5e00723e..1a5547e9 100644 --- a/plugins/netutils.c +++ b/plugins/netutils.c | |||
@@ -35,7 +35,7 @@ | |||
35 | #include "common.h" | 35 | #include "common.h" |
36 | #include "netutils.h" | 36 | #include "netutils.h" |
37 | 37 | ||
38 | unsigned int socket_timeout = DEFAULT_SOCKET_TIMEOUT; | 38 | unsigned int socket_timeout = DEFAULT_SOCKET_TIMEOUT; |
39 | int econn_refuse_state = STATE_CRITICAL; | 39 | int econn_refuse_state = STATE_CRITICAL; |
40 | int was_refused = FALSE; | 40 | int was_refused = FALSE; |
41 | #if USE_IPV6 | 41 | #if USE_IPV6 |
@@ -57,8 +57,8 @@ socket_timeout_alarm_handler (int sig) | |||
57 | } | 57 | } |
58 | 58 | ||
59 | 59 | ||
60 | /* connects to a host on a specified tcp port, sends a string, and gets a | 60 | /* connects to a host on a specified tcp port, sends a string, and gets a |
61 | response. loops on select-recv until timeout or eof to get all of a | 61 | response. loops on select-recv until timeout or eof to get all of a |
62 | multi-packet answer */ | 62 | multi-packet answer */ |
63 | int | 63 | int |
64 | process_tcp_request2 (const char *server_address, int server_port, | 64 | process_tcp_request2 (const char *server_address, int server_port, |
@@ -106,7 +106,7 @@ process_tcp_request2 (const char *server_address, int server_port, | |||
106 | } | 106 | } |
107 | else { /* it has */ | 107 | else { /* it has */ |
108 | recv_result = | 108 | recv_result = |
109 | recv (sd, recv_buffer + recv_length, | 109 | recv (sd, recv_buffer + recv_length, |
110 | (size_t)recv_size - recv_length - 1, 0); | 110 | (size_t)recv_size - recv_length - 1, 0); |
111 | if (recv_result == -1) { | 111 | if (recv_result == -1) { |
112 | /* recv failed, bail out */ | 112 | /* recv failed, bail out */ |
@@ -137,7 +137,7 @@ process_tcp_request2 (const char *server_address, int server_port, | |||
137 | } | 137 | } |
138 | 138 | ||
139 | 139 | ||
140 | /* connects to a host on a specified port, sends a string, and gets a | 140 | /* connects to a host on a specified port, sends a string, and gets a |
141 | response */ | 141 | response */ |
142 | int | 142 | int |
143 | process_request (const char *server_address, int server_port, int proto, | 143 | process_request (const char *server_address, int server_port, int proto, |
@@ -229,7 +229,7 @@ np_net_connect (const char *host_name, int port, int *sd, int proto) | |||
229 | r = r->ai_next; | 229 | r = r->ai_next; |
230 | } | 230 | } |
231 | freeaddrinfo (res); | 231 | freeaddrinfo (res); |
232 | } | 232 | } |
233 | /* else the hostname is interpreted as a path to a unix socket */ | 233 | /* else the hostname is interpreted as a path to a unix socket */ |
234 | else { | 234 | else { |
235 | if(strlen(host_name) >= UNIX_PATH_MAX){ | 235 | if(strlen(host_name) >= UNIX_PATH_MAX){ |
@@ -251,7 +251,7 @@ np_net_connect (const char *host_name, int port, int *sd, int proto) | |||
251 | return STATE_OK; | 251 | return STATE_OK; |
252 | else if (was_refused) { | 252 | else if (was_refused) { |
253 | switch (econn_refuse_state) { /* a user-defined expected outcome */ | 253 | switch (econn_refuse_state) { /* a user-defined expected outcome */ |
254 | case STATE_OK: | 254 | case STATE_OK: |
255 | case STATE_WARNING: /* user wants WARN or OK on refusal */ | 255 | case STATE_WARNING: /* user wants WARN or OK on refusal */ |
256 | return econn_refuse_state; | 256 | return econn_refuse_state; |
257 | break; | 257 | break; |
@@ -285,7 +285,7 @@ send_request (int sd, int proto, const char *send_buffer, char *recv_buffer, int | |||
285 | result = STATE_WARNING; | 285 | result = STATE_WARNING; |
286 | } | 286 | } |
287 | 287 | ||
288 | /* wait up to the number of seconds for socket timeout minus one | 288 | /* wait up to the number of seconds for socket timeout minus one |
289 | for data from the host */ | 289 | for data from the host */ |
290 | tv.tv_sec = socket_timeout - 1; | 290 | tv.tv_sec = socket_timeout - 1; |
291 | tv.tv_usec = 0; | 291 | tv.tv_usec = 0; |
@@ -340,7 +340,7 @@ is_addr (const char *address) | |||
340 | #ifdef USE_IPV6 | 340 | #ifdef USE_IPV6 |
341 | if (address_family == AF_INET && is_inet_addr (address)) | 341 | if (address_family == AF_INET && is_inet_addr (address)) |
342 | return TRUE; | 342 | return TRUE; |
343 | else if (address_family == AF_INET6 && is_inet6_addr (address)) | 343 | else if (address_family == AF_INET6 && is_inet6_addr (address)) |
344 | return TRUE; | 344 | return TRUE; |
345 | #else | 345 | #else |
346 | if (is_inet_addr (address)) | 346 | if (is_inet_addr (address)) |
diff --git a/plugins/popen.c b/plugins/popen.c index df00ebeb..a27aecc9 100644 --- a/plugins/popen.c +++ b/plugins/popen.c | |||
@@ -140,7 +140,7 @@ spopen (const char *cmdstring) | |||
140 | /* there cannot be more args than characters */ | 140 | /* there cannot be more args than characters */ |
141 | argc = strlen (cmdstring) + 1; /* add 1 for NULL termination */ | 141 | argc = strlen (cmdstring) + 1; /* add 1 for NULL termination */ |
142 | argv = malloc (sizeof(char*)*argc); | 142 | argv = malloc (sizeof(char*)*argc); |
143 | 143 | ||
144 | if (argv == NULL) { | 144 | if (argv == NULL) { |
145 | printf ("%s\n", _("Could not malloc argv array in popen()")); | 145 | printf ("%s\n", _("Could not malloc argv array in popen()")); |
146 | return NULL; | 146 | return NULL; |
@@ -165,7 +165,7 @@ spopen (const char *cmdstring) | |||
165 | } | 165 | } |
166 | else if (strcspn(str,"'") < strcspn (str, " \t\r\n")) { | 166 | else if (strcspn(str,"'") < strcspn (str, " \t\r\n")) { |
167 | /* handle --option='foo bar' strings */ | 167 | /* handle --option='foo bar' strings */ |
168 | tmp = str + strcspn(str, "'") + 1; | 168 | tmp = str + strcspn(str, "'") + 1; |
169 | if (!strstr (tmp, "'")) | 169 | if (!strstr (tmp, "'")) |
170 | return NULL; /* balanced? */ | 170 | return NULL; /* balanced? */ |
171 | tmp += strcspn(tmp,"'") + 1; | 171 | tmp += strcspn(tmp,"'") + 1; |
diff --git a/plugins/urlize.c b/plugins/urlize.c index 34e25c4e..aeabafd0 100644 --- a/plugins/urlize.c +++ b/plugins/urlize.c | |||
@@ -79,7 +79,7 @@ main (int argc, char **argv) | |||
79 | 79 | ||
80 | while (1) { | 80 | while (1) { |
81 | c = getopt_long (argc, argv, "+hVu:", longopts, &option); | 81 | c = getopt_long (argc, argv, "+hVu:", longopts, &option); |
82 | 82 | ||
83 | if (c == -1 || c == EOF) | 83 | if (c == -1 || c == EOF) |
84 | break; | 84 | break; |
85 | 85 | ||
@@ -144,7 +144,7 @@ main (int argc, char **argv) | |||
144 | printf ("%s", nstr); | 144 | printf ("%s", nstr); |
145 | printf ("</A>"); | 145 | printf ("</A>"); |
146 | nstr = strtok(NULL, PERF_CHARACTER); | 146 | nstr = strtok(NULL, PERF_CHARACTER); |
147 | if (nstr != NULL) | 147 | if (nstr != NULL) |
148 | printf (" | %s", nstr); | 148 | printf (" | %s", nstr); |
149 | 149 | ||
150 | /* close the pipe */ | 150 | /* close the pipe */ |