summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_apt.c6
-rw-r--r--plugins/check_cluster.c4
-rw-r--r--plugins/check_disk.c24
-rw-r--r--plugins/check_dns.c4
-rw-r--r--plugins/check_dummy.c2
-rw-r--r--plugins/check_game.c8
-rw-r--r--plugins/check_hpjd.c12
-rw-r--r--plugins/check_http.c22
-rw-r--r--plugins/check_ldap.c20
-rw-r--r--plugins/check_mrtg.c2
-rw-r--r--plugins/check_mysql.c6
-rw-r--r--plugins/check_nagios.c4
-rw-r--r--plugins/check_ntp.c10
-rw-r--r--plugins/check_ntp_peer.c4
-rw-r--r--plugins/check_ntp_time.c8
-rw-r--r--plugins/check_nwstat.c40
-rw-r--r--plugins/check_pgsql.c6
-rw-r--r--plugins/check_ping.c8
-rw-r--r--plugins/check_radius.c4
-rw-r--r--plugins/check_smtp.c6
-rw-r--r--plugins/check_snmp.c38
-rw-r--r--plugins/check_ssh.c6
-rw-r--r--plugins/check_swap.c2
-rw-r--r--plugins/check_tcp.c4
-rw-r--r--plugins/check_time.c2
-rw-r--r--plugins/check_ups.c6
-rw-r--r--plugins/netutils.c18
-rw-r--r--plugins/popen.c4
-rw-r--r--plugins/urlize.c4
29 files changed, 142 insertions, 142 deletions
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
370char* construct_cmdline(upgrade_type u, const char *opts){ 370char* 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){
149int process_arguments(int argc, char **argv){ 149int 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
821void 821void
822print_path (const char *mypath) 822print_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
831void 831void
832set_all_thresholds (struct parameter_list *path) 832set_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
386void 386void
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 */
82typedef struct { 82typedef 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 :( */
359double offset_request(const char *host, int *status){ 359double 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 */
83typedef struct { 83typedef 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 :( */
305double offset_request(const char *host, int *status){ 305double 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
358the tango program should eventually create an entity here based on the 358the tango program should eventually create an entity here based on the
359function prototype 359function 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
749int 749int
750my_close (void) 750my_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
691the authentication and authorization combinations based on protocol version 691the authentication and authorization combinations based on protocol version
692selected.</para> 692selected.</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
38unsigned int socket_timeout = DEFAULT_SOCKET_TIMEOUT; 38unsigned int socket_timeout = DEFAULT_SOCKET_TIMEOUT;
39int econn_refuse_state = STATE_CRITICAL; 39int econn_refuse_state = STATE_CRITICAL;
40int was_refused = FALSE; 40int 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 */
63int 63int
64process_tcp_request2 (const char *server_address, int server_port, 64process_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 */
142int 142int
143process_request (const char *server_address, int server_port, int proto, 143process_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 */