From caa8bd6423e2d0d1b4e72c150e80b9c6a9e1b7fe Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Wed, 19 Nov 2008 06:45:18 +0000 Subject: 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 --- plugins/check_apt.c | 6 +++--- plugins/check_cluster.c | 4 ++-- plugins/check_disk.c | 24 ++++++++++++------------ plugins/check_dns.c | 4 ++-- plugins/check_dummy.c | 2 +- plugins/check_game.c | 8 ++++---- plugins/check_hpjd.c | 12 ++++++------ plugins/check_http.c | 22 +++++++++++----------- plugins/check_ldap.c | 20 ++++++++++---------- plugins/check_mrtg.c | 2 +- plugins/check_mysql.c | 6 +++--- plugins/check_nagios.c | 4 ++-- plugins/check_ntp.c | 10 +++++----- plugins/check_ntp_peer.c | 4 ++-- plugins/check_ntp_time.c | 8 ++++---- plugins/check_nwstat.c | 40 ++++++++++++++++++++-------------------- plugins/check_pgsql.c | 6 +++--- plugins/check_ping.c | 8 ++++---- plugins/check_radius.c | 4 ++-- plugins/check_smtp.c | 6 +++--- plugins/check_snmp.c | 38 +++++++++++++++++++------------------- plugins/check_ssh.c | 6 +++--- plugins/check_swap.c | 2 +- plugins/check_tcp.c | 4 ++-- plugins/check_time.c | 2 +- plugins/check_ups.c | 6 +++--- plugins/netutils.c | 18 +++++++++--------- plugins/popen.c | 4 ++-- plugins/urlize.c | 4 ++-- 29 files changed, 142 insertions(+), 142 deletions(-) (limited to 'plugins') 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) { result = max_state(result, STATE_OK); } - printf(_("APT %s: %d packages available for %s (%d critical updates). %s%s%s%s\n"), + printf(_("APT %s: %d packages available for %s (%d critical updates). %s%s%s%s\n"), state_text(result), packages_available, (upgrade==DIST_UPGRADE)?"dist-upgrade":"upgrade", @@ -305,7 +305,7 @@ int run_upgrade(int *pkgcount, int *secpkgcount){ } regfree(&ireg); regfree(&sreg); - if(do_exclude!=NULL) regfree(&ereg); + if(do_exclude!=NULL) regfree(&ereg); free(cmdline); return result; } @@ -364,7 +364,7 @@ char* add_to_regexp(char *expr, const char *next){ sprintf((char*)(re+strlen(re)-2), "|%s) ", next); } - return re; + return re; } 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){ } } } - + /* return the status of the cluster */ if(check_type==CHECK_SERVICES){ @@ -149,7 +149,7 @@ int main(int argc, char **argv){ int process_arguments(int argc, char **argv){ int c; int option=0; - static struct option longopts[]={ + static struct option longopts[]={ {"data", required_argument,0,'d'}, {"warning", required_argument,0,'w'}, {"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) /* If a list of paths has not been selected, find entire mount list and create list of paths */ - if (path_selected == FALSE) { + if (path_selected == FALSE) { for (me = mount_list; me; me = me->me_next) { if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) { path = np_add_parameter(&path_select_list, me->me_mountdir); @@ -293,8 +293,8 @@ main (int argc, char **argv) /* Skip excluded fstypes */ } else if (fs_exclude_list && np_find_name (fs_exclude_list, me->me_type)) { continue; - /* Skip excluded fs's */ - } else if (dp_exclude_list && + /* Skip excluded fs's */ + } else if (dp_exclude_list && (np_find_name (dp_exclude_list, me->me_devname) || np_find_name (dp_exclude_list, me->me_mountdir))) { continue; @@ -327,7 +327,7 @@ main (int argc, char **argv) dfree_inodes_percent = 100 - dused_inodes_percent; if (verbose >= 3) { - 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", + 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", me->me_mountdir, dused_pct, dfree_pct, dused_units, dfree_units, dtotal_units, dused_inodes_percent, dfree_inodes_percent, fsp.fsu_blocksize, mult); } @@ -430,7 +430,7 @@ double calculate_percent(uintmax_t value, uintmax_t total) { double pct = -1; /* I don't understand the below, but it is taken from coreutils' df */ /* Seems to be calculating pct, in the best possible way */ - if (value <= TYPE_MAXIMUM(uintmax_t) / 100 + if (value <= TYPE_MAXIMUM(uintmax_t) / 100 && total != 0) { uintmax_t u100 = value * 100; pct = u100 / total + (u100 % total != 0); @@ -546,7 +546,7 @@ process_arguments (int argc, char **argv) } break; - /* Awful mistake where the range values do not make sense. Normally, + /* Awful mistake where the range values do not make sense. Normally, you alert if the value is within the range, but since we are using freespace, we have to alert if outside the range. Thus we artifically force @ at the beginning of the range, so that it is backwards compatible @@ -620,10 +620,10 @@ process_arguments (int argc, char **argv) case 'L': stat_remote_fs = 1; case 'l': - show_local_fs = 1; + show_local_fs = 1; break; case 'p': /* select path */ - if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || + if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || crit_freespace_percent || warn_usedspace_units || crit_usedspace_units || warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent || crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) { @@ -714,7 +714,7 @@ process_arguments (int argc, char **argv) case 'R': cflags |= REG_ICASE; case 'r': - if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || + if (! (warn_freespace_units || crit_freespace_units || warn_freespace_percent || crit_freespace_percent || warn_usedspace_units || crit_usedspace_units || warn_usedspace_percent || crit_usedspace_percent || warn_usedinodes_percent || crit_usedinodes_percent || warn_freeinodes_percent || crit_freeinodes_percent )) { @@ -760,7 +760,7 @@ process_arguments (int argc, char **argv) if (path_selected == FALSE) { struct parameter_list *path; for (me = mount_list; me; me = me->me_next) { - if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) + if (! (path = np_find_parameter(path_select_list, me->me_mountdir))) path = np_add_parameter(&path_select_list, me->me_mountdir); path->best_match = me; path->group = group; @@ -819,7 +819,7 @@ process_arguments (int argc, char **argv) void -print_path (const char *mypath) +print_path (const char *mypath) { if (mypath == NULL) printf ("\n"); @@ -829,7 +829,7 @@ print_path (const char *mypath) void -set_all_thresholds (struct parameter_list *path) +set_all_thresholds (struct parameter_list *path) { if (path->freespace_units != NULL) free(path->freespace_units); 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) /* scan stdout */ for(i = 0; i < chld_out.lines; i++) { - if (addresses == NULL) + if (addresses == NULL) addresses = malloc(sizeof(*addresses)*10); else if (!(n_addresses % 10)) addresses = realloc(addresses,sizeof(*addresses) * (n_addresses + 10)); @@ -289,7 +289,7 @@ error_scan (char *input_buffer) strstr (input_buffer, ": REFUSED"))) die (STATE_CRITICAL, _("Connection to DNS %s was refused\n"), dns_server); - /* Query refused (usually by an ACL in the namserver) */ + /* Query refused (usually by an ACL in the namserver) */ else if (strstr (input_buffer, "Query refused")) die (STATE_CRITICAL, _("Query was refused by DNS server at %s\n"), dns_server); 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) return STATE_UNKNOWN; } - if (argc >= 3) + if (argc >= 3) printf (": %s", argv[2]); 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) /* was thinking about running qstat without any options, capturing the -default line, parsing it & making an array of all know server types but thought this would be too much hassle considering this is a tool - for intelligent sysadmins (ha). Could put a static array of known + for intelligent sysadmins (ha). Could put a static array of known server types in a header file but then we'd be limiting ourselves In the end, I figured I'd simply let an error occur & then trap it @@ -139,10 +139,10 @@ main (int argc, char **argv) result = STATE_CRITICAL; } else { - printf ("OK: %s/%s %s (%s), Ping: %s ms|%s %s\n", + printf ("OK: %s/%s %s (%s), Ping: %s ms|%s %s\n", ret[qstat_game_players], ret[qstat_game_players_max], - ret[qstat_game_field], + ret[qstat_game_field], ret[qstat_map_field], ret[qstat_ping_field], perfdata ("players", atol(ret[qstat_game_players]), "", @@ -345,7 +345,7 @@ print_usage (void) * Test Cases: * * ./check_game --players 7 -p 8 --map 5 qs 67.20.190.61 26000 - * + * * qstat -raw , -qs 67.20.190.61 * ==> QS,67.20.190.61,Nightmare.fintek.ca,67.20.190.61:26000,3,e2m1,6,0,83,0 * 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) HPJD_GD_DOOR_OPEN, HPJD_GD_PAPER_OUTPUT, HPJD_GD_STATUS_DISPLAY); /* get the command to run */ - sprintf (command_line, "%s -OQa -m : -v 1 -c %s %s %s", PATH_TO_SNMPGET, community, + sprintf (command_line, "%s -OQa -m : -v 1 -c %s %s %s", PATH_TO_SNMPGET, community, address, query_string); /* run the command */ @@ -198,7 +198,7 @@ main (int argc, char **argv) strcpy (display_message, temp_buffer + 1); break; default: /* fold multiline message */ - strncat (display_message, input_buffer, + strncat (display_message, input_buffer, sizeof (display_message) - strlen (display_message) - 1); } @@ -218,7 +218,7 @@ main (int argc, char **argv) sprintf (errmsg, "%s", input_buffer ); } - + /* close stderr */ (void) fclose (child_stderr); @@ -232,7 +232,7 @@ main (int argc, char **argv) /* might not be the problem, but most likely is. */ result = STATE_UNKNOWN ; asprintf (&errmsg, "%s : Timeout from host %s\n", errmsg, address ); - + } /* if we had no read errors, check the printer status results... */ @@ -326,7 +326,7 @@ process_arguments (int argc, char **argv) if (argc < 2) return ERROR; - + while (1) { c = getopt_long (argc, argv, "+hVH:C:", longopts, &option); @@ -365,7 +365,7 @@ process_arguments (int argc, char **argv) usage2 (_("Invalid hostname/address"), argv[c]); } } - + if (community == NULL) { if (argv[c] != NULL ) 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) usage4 (_("Could not parse arguments")); if (display_html == TRUE) - printf ("", + printf ("", use_ssl ? "https" : "http", host_name ? host_name : server_address, server_port, server_url); @@ -314,7 +314,7 @@ process_arguments (int argc, char **argv) if (!strcmp (optarg, "critical")) onredirect = STATE_CRITICAL; if (verbose) - printf(_("option f:%d \n"), onredirect); + printf(_("option f:%d \n"), onredirect); break; /* Note: H, I, and u must be malloc'd or will fail on redirects */ case 'H': /* Host Name (virtual host) */ @@ -417,7 +417,7 @@ process_arguments (int argc, char **argv) exit (STATE_WARNING); } else max_page_len = atoi(tmp); - } else + } else min_page_len = atoi (optarg); break; } @@ -556,7 +556,7 @@ parse_time_string (const char *string) if (tm.tm_mon < 0 || tm.tm_mday < 1 || tm.tm_mday > 31) return 0; - /* + /* This is actually wrong: we need to subtract the local timezone offset from GMT from this value. But, that's ok in this usage, because we only comparing these two GMT dates against each other, @@ -990,7 +990,7 @@ check_http (void) elapsed_time = (double)microsec / 1.0e6; die (onredirect, _(" - %s - %.3f second response time %s|%s %s\n"), - status_line, elapsed_time, + status_line, elapsed_time, (display_html ? "" : ""), perfd_time (elapsed_time), perfd_size (pagesize)); } /* end if (http_status >= 300) */ @@ -1006,7 +1006,7 @@ check_http (void) elapsed_time = (double)microsec / 1.0e6; asprintf (&msg, _(" - %s - %.3f second response time %s|%s %s\n"), - status_line, elapsed_time, + status_line, elapsed_time, (display_html ? "" : ""), perfd_time (elapsed_time), perfd_size (pagesize)); if (check_critical_time == TRUE && elapsed_time > critical_time) @@ -1043,9 +1043,9 @@ check_http (void) exit (STATE_OK); } else if ((errcode == REG_NOMATCH && invert_regex == 0) || (errcode == 0 && invert_regex == 1)) { - if (invert_regex == 0) + if (invert_regex == 0) msg = strdup(_("pattern not found")); - else + else msg = strdup(_("pattern found")); printf (("%s - %s%s|%s %s\n"), _("HTTP CRITICAL"), @@ -1118,7 +1118,7 @@ redir (char *pos, char *status_line) if (i == 0) { pos += (size_t) strcspn (pos, "\r\n"); pos += (size_t) strspn (pos, "\r\n"); - if (strlen(pos) == 0) + if (strlen(pos) == 0) die (STATE_UNKNOWN, _("HTTP UNKNOWN - Could not find redirect location - %s%s\n"), status_line, (display_html ? "" : "")); @@ -1151,7 +1151,7 @@ redir (char *pos, char *status_line) } /* URI_HTTP URI_HOST URI_PATH */ - else if (sscanf (pos, HD2, type, addr, url) == 3 ) { + else if (sscanf (pos, HD2, type, addr, url) == 3 ) { url = prepend_slash (url); use_ssl = server_type_check (type); i = server_port_check (use_ssl); @@ -1181,7 +1181,7 @@ redir (char *pos, char *status_line) i = server_port; strcpy (type, server_type); strcpy (addr, host_name ? host_name : server_address); - } + } else { 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[]) LDAPMessage *result; /* should be int result = STATE_UNKNOWN; */ - + int status = STATE_UNKNOWN; long microsec; double elapsed_time; - + /* for ldap tls */ - - int tls; - int version=3; + + int tls; + int version=3; setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); @@ -129,7 +129,7 @@ main (int argc, char *argv[]) printf ("Could not connect to the server at port %i\n", ld_port); return STATE_CRITICAL; } -#else +#else if (!(ld = ldap_open (ld_host, ld_port))) { if (verbose) ldap_perror(ld, "ldap_open"); @@ -137,7 +137,7 @@ main (int argc, char *argv[]) return STATE_CRITICAL; } #endif /* HAVE_LDAP_INIT */ - + #ifdef HAVE_LDAP_SET_OPTION /* set ldap options */ if (ldap_set_option (ld, LDAP_OPT_PROTOCOL_VERSION, &ld_protocol) != @@ -152,7 +152,7 @@ main (int argc, char *argv[]) #if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS) /* ldaps: set option tls */ tls = LDAP_OPT_X_TLS_HARD; - + if (ldap_set_option (ld, LDAP_OPT_X_TLS, &tls) != LDAP_SUCCESS) { if (verbose) @@ -179,7 +179,7 @@ main (int argc, char *argv[]) /* call start_tls */ if (ldap_start_tls_s(ld, NULL, NULL) != LDAP_SUCCESS) { - if (verbose) + if (verbose) ldap_perror(ld, "ldap_start_tls"); printf (_("Could not init startTLS at port %i!\n"), ld_port); return STATE_CRITICAL; @@ -189,7 +189,7 @@ main (int argc, char *argv[]) return STATE_CRITICAL; #endif /* HAVE_LDAP_START_TLS_S */ } - + /* bind to the ldap server */ if (ldap_bind_s (ld, ld_binddn, ld_passwd, LDAP_AUTH_SIMPLE) != 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) -/* original command line: +/* original command line: