From 3f9b22ab16b5a9b74d62d7fff9b6bf3a51ed93f7 Mon Sep 17 00:00:00 2001 From: Aksel Sjögren Date: Mon, 15 Nov 2021 14:29:51 +0100 Subject: check_icmp: Fix pkt perfdata in check_host mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing "warn" threshold field in "pkt" perfdata output. Perfdata should be interpreted as; 'label'=value[UOM];[warn];[crit];[min];[max] With one field missing, the hardcoded min value '0' ended up in the "crit" field, making applications interpreting the perfdata thining that critical threshold is always exceeded. Signed-off-by: Aksel Sjögren --- plugins-root/check_icmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins-root') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 31eb4c65..519b93c6 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -921,7 +921,7 @@ wait_for_reply(int sock, u_int t) /* if we're in hostcheck mode, exit with limited printouts */ if(mode == MODE_HOSTCHECK) { printf("OK - %s responds to ICMP. Packet %u, rta %0.3fms|" - "pkt=%u;;0;%u rta=%0.3f;%0.3f;%0.3f;;\n", + "pkt=%u;;;0;%u rta=%0.3f;%0.3f;%0.3f;;\n", host->name, icmp_recv, (float)tdiff / 1000, icmp_recv, packets, (float)tdiff / 1000, (float)warn.rta / 1000, (float)crit.rta / 1000); -- cgit v1.2.3-74-g34f1 From e2f24a5af3fe407035c8c57f539148f2d694973b Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Wed, 24 Nov 2021 14:25:42 +0100 Subject: Fix CodeQL checks --- plugins-root/check_icmp.c | 4 ++-- plugins/check_disk.c | 16 ++++++++++------ plugins/check_hpjd.c | 2 +- plugins/check_swap.c | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) (limited to 'plugins-root') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 519b93c6..bcf6c5f5 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -502,7 +502,7 @@ main(int argc, char **argv) icmp_data_size = size; icmp_pkt_size = size + ICMP_MINLEN; } else - usage_va("ICMP data length must be between: %d and %d", + usage_va("ICMP data length must be between: %ul and %ul", sizeof(struct icmp) + sizeof(struct icmp_ping_data), MAX_PING_DATA - 1); break; @@ -1293,7 +1293,7 @@ add_target_ip(char *arg, struct sockaddr_storage *in) if(!host) { char straddr[INET6_ADDRSTRLEN]; parse_address((struct sockaddr_storage*)&in, straddr, sizeof(straddr)); - crash("add_target_ip(%s, %s): malloc(%d) failed", + crash("add_target_ip(%s, %s): malloc(%ul) failed", arg, straddr, sizeof(struct rta_host)); } memset(host, 0, sizeof(struct rta_host)); diff --git a/plugins/check_disk.c b/plugins/check_disk.c index c526d056..f032378c 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c @@ -1040,9 +1040,15 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) { get_fs_usage (p_list->best_match->me_mountdir, p_list->best_match->me_devname, &tmpfsp); get_path_stats(p_list, &tmpfsp); if (verbose >= 3) - printf("Group %s: adding %llu blocks sized %llu, (%s) used_units=%g free_units=%g total_units=%g fsu_blocksize=%llu mult=%llu\n", - p_list->group, tmpfsp.fsu_bavail, tmpfsp.fsu_blocksize, p_list->best_match->me_mountdir, p_list->dused_units, p_list->dfree_units, - p_list->dtotal_units, mult); + printf("Group %s: adding %llu blocks sized %llu, (%s) used_units=%g free_units=%g total_units=%g mult=%llu\n", + p_list->group, + tmpfsp.fsu_blocks, + tmpfsp.fsu_blocksize, + p_list->best_match->me_mountdir, + p_list->dused_units, + p_list->dfree_units, + p_list->dtotal_units, + mult); /* prevent counting the first FS of a group twice since its parameter_list entry * is used to carry the information of all file systems of the entire group */ @@ -1065,12 +1071,10 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) { if (verbose >= 3) printf("Group %s now has: used_units=%g free_units=%g total_units=%g fsu_blocksize=%llu mult=%llu\n", p->group, - tmpfsp.fsu_bavail, - tmpfsp.fsu_blocksize, - p->best_match->me_mountdir, p->dused_units, p->dfree_units, p->dtotal_units, + tmpfsp.fsu_blocksize, mult); } /* modify devname and mountdir for output */ diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c index 65465567..d3d72d7e 100644 --- a/plugins/check_hpjd.c +++ b/plugins/check_hpjd.c @@ -121,7 +121,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:%hd %s", PATH_TO_SNMPGET, community, + sprintf (command_line, "%s -OQa -m : -v 1 -c %s %s:%s %s", PATH_TO_SNMPGET, community, address, port, query_string); /* run the command */ diff --git a/plugins/check_swap.c b/plugins/check_swap.c index 7f71bf7e..00bdcdd8 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c @@ -142,7 +142,7 @@ main (int argc, char **argv) percent = 100 * (((double) dskused_mb) / ((double) dsktotal_mb)); result = max_state (result, check_swap (dskfree_mb, dsktotal_mb)); if (verbose) - xasprintf (&status, "%s [%.0f (%d%%)]", status, dskfree_mb, 100 - percent); + xasprintf (&status, "%s [%ul (%d%%)]", status, dskfree_mb, 100 - percent); } } /* -- cgit v1.2.3-74-g34f1 From d28bab4dbdf5b5be37b70164dd4a6d55e0ca9380 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Wed, 24 Nov 2021 19:02:17 +0100 Subject: More wrong printf formatting --- plugins-root/check_icmp.c | 4 ++-- plugins/check_disk.c | 4 ++-- plugins/check_swap.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins-root') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index bcf6c5f5..01ae174a 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -502,7 +502,7 @@ main(int argc, char **argv) icmp_data_size = size; icmp_pkt_size = size + ICMP_MINLEN; } else - usage_va("ICMP data length must be between: %ul and %ul", + usage_va("ICMP data length must be between: %lu and %lu", sizeof(struct icmp) + sizeof(struct icmp_ping_data), MAX_PING_DATA - 1); break; @@ -1293,7 +1293,7 @@ add_target_ip(char *arg, struct sockaddr_storage *in) if(!host) { char straddr[INET6_ADDRSTRLEN]; parse_address((struct sockaddr_storage*)&in, straddr, sizeof(straddr)); - crash("add_target_ip(%s, %s): malloc(%ul) failed", + crash("add_target_ip(%s, %s): malloc(%lu) failed", arg, straddr, sizeof(struct rta_host)); } memset(host, 0, sizeof(struct rta_host)); diff --git a/plugins/check_disk.c b/plugins/check_disk.c index f032378c..54befcad 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c @@ -1040,7 +1040,7 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) { get_fs_usage (p_list->best_match->me_mountdir, p_list->best_match->me_devname, &tmpfsp); get_path_stats(p_list, &tmpfsp); if (verbose >= 3) - printf("Group %s: adding %llu blocks sized %llu, (%s) used_units=%g free_units=%g total_units=%g mult=%llu\n", + printf("Group %s: adding %llu blocks sized %llu, (%s) used_units=%lu free_units=%llu total_units=%llu mult=%llu\n", p_list->group, tmpfsp.fsu_blocks, tmpfsp.fsu_blocksize, @@ -1069,7 +1069,7 @@ get_stats (struct parameter_list *p, struct fs_usage *fsp) { first = 0; } if (verbose >= 3) - printf("Group %s now has: used_units=%g free_units=%g total_units=%g fsu_blocksize=%llu mult=%llu\n", + printf("Group %s now has: used_units=%llu free_units=%llu total_units=%llu fsu_blocksize=%llu mult=%llu\n", p->group, p->dused_units, p->dfree_units, diff --git a/plugins/check_swap.c b/plugins/check_swap.c index 00bdcdd8..7da26cfc 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c @@ -142,7 +142,7 @@ main (int argc, char **argv) percent = 100 * (((double) dskused_mb) / ((double) dsktotal_mb)); result = max_state (result, check_swap (dskfree_mb, dsktotal_mb)); if (verbose) - xasprintf (&status, "%s [%ul (%d%%)]", status, dskfree_mb, 100 - percent); + xasprintf (&status, "%s [%lu (%d%%)]", status, dskfree_mb, 100 - percent); } } /* -- cgit v1.2.3-74-g34f1 From 986b2479465648c49a7eefc3fbf4df8860e3e4b7 Mon Sep 17 00:00:00 2001 From: ghciv6 Date: Mon, 20 Dec 2021 22:39:57 +0000 Subject: - delay set_source_ip() until address_family is detected - add a test to check '-s' --- plugins-root/check_icmp.c | 5 ++++- plugins-root/t/check_icmp.t | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'plugins-root') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 01ae174a..f97b0ed7 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -410,6 +410,7 @@ main(int argc, char **argv) #ifdef SO_TIMESTAMP int on = 1; #endif + char *source_ip = NULL; char * opts_str = "vhVw:c:n:p:t:H:s:i:b:I:l:m:64"; setlocale (LC_ALL, ""); @@ -542,7 +543,7 @@ main(int argc, char **argv) } break; case 's': /* specify source IP address */ - set_source_ip(optarg); + source_ip = optarg; break; case 'V': /* version */ print_revision (progname, NP_VERSION); @@ -597,6 +598,8 @@ main(int argc, char **argv) sockets |= HAVE_ICMP; else icmp_sockerrno = errno; + if( source_ip ) + set_source_ip(source_ip); #ifdef SO_TIMESTAMP if(setsockopt(icmp_sock, SOL_SOCKET, SO_TIMESTAMP, &on, sizeof(on))) diff --git a/plugins-root/t/check_icmp.t b/plugins-root/t/check_icmp.t index e043d4ed..55edc31b 100644 --- a/plugins-root/t/check_icmp.t +++ b/plugins-root/t/check_icmp.t @@ -12,7 +12,7 @@ my $allow_sudo = getTestParameter( "NP_ALLOW_SUDO", "no" ); if ($allow_sudo eq "yes" or $> == 0) { - plan tests => 16; + plan tests => 18; } else { plan skip_all => "Need sudo to test check_icmp"; } @@ -83,3 +83,9 @@ $res = NPTest->testCmd( is( $res->return_code, 2, "One of two host nonresponsive - two required" ); like( $res->output, $failureOutput, "Output OK" ); +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -s 127.0.15.15 -w 10000ms,100% -c 10000ms,100% -n 1 -m 2" + ); +is( $res->return_code, 0, "IPv4 source_ip accepted" ); +like( $res->output, $successOutput, "Output OK" ); + -- cgit v1.2.3-74-g34f1 From 605405557102c04e740fc3249675cc5154436d11 Mon Sep 17 00:00:00 2001 From: Lorenz <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 15 Mar 2022 22:00:55 +0100 Subject: check_icmp: buffer offerflow (#1733) * Fix different overflows * Less includes * Add testcases * Remove unused variable * Remove unused and commented includes --- plugins-root/check_icmp.c | 66 +++++++++++++++++++++++++-------------------- plugins-root/t/check_icmp.t | 7 ++++- 2 files changed, 43 insertions(+), 30 deletions(-) (limited to 'plugins-root') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index f97b0ed7..61198237 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -50,19 +50,11 @@ const char *email = "devel@monitoring-plugins.org"; #if HAVE_SYS_SOCKIO_H #include #endif -#include + #include -#include -#include -#include -#include -#include -#include #include -#include +#include #include -#include -#include #include #include #include @@ -71,8 +63,6 @@ const char *email = "devel@monitoring-plugins.org"; #include #include #include -#include -#include /** sometimes undefined system macros (quite a few, actually) **/ @@ -207,7 +197,7 @@ static int add_target(char *); static int add_target_ip(char *, struct sockaddr_storage *); static int handle_random_icmp(unsigned char *, struct sockaddr_storage *); static void parse_address(struct sockaddr_storage *, char *, int); -static unsigned short icmp_checksum(unsigned short *, int); +static unsigned short icmp_checksum(uint16_t *, size_t); static void finish(int); static void crash(const char *, ...); @@ -465,7 +455,6 @@ main(int argc, char **argv) /* Parse protocol arguments first */ for(i = 1; i < argc; i++) { while((arg = getopt(argc, argv, opts_str)) != EOF) { - unsigned short size; switch(arg) { case '4': if (address_family != -1) @@ -488,10 +477,10 @@ main(int argc, char **argv) /* Reset argument scanning */ optind = 1; + unsigned short size; /* parse the arguments */ for(i = 1; i < argc; i++) { while((arg = getopt(argc, argv, opts_str)) != EOF) { - unsigned short size; switch(arg) { case 'v': debug++; @@ -720,7 +709,7 @@ main(int argc, char **argv) static void run_checks() { - u_int i, t, result; + u_int i, t; u_int final_wait, time_passed; /* this loop might actually violate the pkt_interval or target_interval @@ -738,9 +727,9 @@ run_checks() /* we're still in the game, so send next packet */ (void)send_icmp_ping(icmp_sock, table[t]); - result = wait_for_reply(icmp_sock, target_interval); + wait_for_reply(icmp_sock, target_interval); } - result = wait_for_reply(icmp_sock, pkt_interval * targets); + wait_for_reply(icmp_sock, pkt_interval * targets); } if(icmp_pkts_en_route && targets_alive) { @@ -760,7 +749,7 @@ run_checks() * haven't yet */ if(debug) printf("Waiting for %u micro-seconds (%0.3f msecs)\n", final_wait, (float)final_wait / 1000); - result = wait_for_reply(icmp_sock, final_wait); + wait_for_reply(icmp_sock, final_wait); } } @@ -779,7 +768,7 @@ static int wait_for_reply(int sock, u_int t) { int n, hlen; - static unsigned char buf[4096]; + static unsigned char buf[65536]; struct sockaddr_storage resp_addr; union ip_hdr *ip; union icmp_packet packet; @@ -916,9 +905,27 @@ wait_for_reply(int sock, u_int t) if(debug) { char address[INET6_ADDRSTRLEN]; parse_address(&resp_addr, address, sizeof(address)); - printf("%0.3f ms rtt from %s, outgoing ttl: %u, incoming ttl: %u, max: %0.3f, min: %0.3f\n", - (float)tdiff / 1000, address, - ttl, ip->ip.ip_ttl, (float)host->rtmax / 1000, (float)host->rtmin / 1000); + + switch(address_family) { + case AF_INET: { + printf("%0.3f ms rtt from %s, outgoing ttl: %u, incoming ttl: %u, max: %0.3f, min: %0.3f\n", + (float)tdiff / 1000, + address, + ttl, + ip->ip.ip_ttl, + (float)host->rtmax / 1000, + (float)host->rtmin / 1000); + break; + }; + case AF_INET6: { + printf("%0.3f ms rtt from %s, outgoing ttl: %u, max: %0.3f, min: %0.3f\n", + (float)tdiff / 1000, + address, + ttl, + (float)host->rtmax / 1000, + (float)host->rtmin / 1000); + }; + } } /* if we're in hostcheck mode, exit with limited printouts */ @@ -980,7 +987,7 @@ send_icmp_ping(int sock, struct rta_host *host) icp->icmp_cksum = 0; icp->icmp_id = htons(pid); icp->icmp_seq = htons(host->id++); - icp->icmp_cksum = icmp_checksum((unsigned short*)buf, icmp_pkt_size); + icp->icmp_cksum = icmp_checksum((uint16_t*)buf, (size_t)icmp_pkt_size); if (debug > 2) printf("Sending ICMP echo-request of len %lu, id %u, seq %u, cksum 0x%X to host %s\n", @@ -1517,18 +1524,19 @@ get_threshold(char *str, threshold *th) } unsigned short -icmp_checksum(unsigned short *p, int n) +icmp_checksum(uint16_t *p, size_t n) { unsigned short cksum; long sum = 0; - while(n > 2) { - sum += *p++; - n -= sizeof(unsigned short); + /* sizeof(uint16_t) == 2 */ + while(n >= 2) { + sum += *(p++); + n -= 2; } /* mop up the occasional odd byte */ - if(n == 1) sum += (unsigned char)*p; + if(n == 1) sum += *((uint8_t *)p -1); sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */ sum += (sum >> 16); /* add carry */ diff --git a/plugins-root/t/check_icmp.t b/plugins-root/t/check_icmp.t index 55edc31b..f6aa6813 100644 --- a/plugins-root/t/check_icmp.t +++ b/plugins-root/t/check_icmp.t @@ -12,7 +12,7 @@ my $allow_sudo = getTestParameter( "NP_ALLOW_SUDO", "no" ); if ($allow_sudo eq "yes" or $> == 0) { - plan tests => 18; + plan tests => 20; } else { plan skip_all => "Need sudo to test check_icmp"; } @@ -89,3 +89,8 @@ $res = NPTest->testCmd( is( $res->return_code, 0, "IPv4 source_ip accepted" ); like( $res->output, $successOutput, "Output OK" ); +$res = NPTest->testCmd( + "$sudo ./check_icmp -H $host_responsive -b 65507" + ); +is( $res->return_code, 0, "Try max paket size" ); +like( $res->output, $successOutput, "Output OK - Didn't overflow" ); -- cgit v1.2.3-74-g34f1 From ee50ddf6988e9d14502ed3fa4645dcd679f347f8 Mon Sep 17 00:00:00 2001 From: eriksejr Date: Thu, 14 Jul 2022 04:25:51 -0400 Subject: Set msg_namelen to the size of the sockaddr struct for the appropriate address family and not sockaddr_storage (#1771) Co-authored-by: Erik Sejr Co-authored-by: Lorenz <12514511+RincewindsHat@users.noreply.github.com> --- plugins-root/check_icmp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'plugins-root') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 61198237..f8f15351 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -213,7 +213,7 @@ static int mode, protocols, sockets, debug = 0, timeout = 10; static unsigned short icmp_data_size = DEFAULT_PING_DATA_SIZE; static unsigned short icmp_pkt_size = DEFAULT_PING_DATA_SIZE + ICMP_MINLEN; -static unsigned int icmp_sent = 0, icmp_recv = 0, icmp_lost = 0; +static unsigned int icmp_sent = 0, icmp_recv = 0, icmp_lost = 0, ttl = 0; #define icmp_pkts_en_route (icmp_sent - (icmp_recv + icmp_lost)) static unsigned short targets_down = 0, targets = 0, packets = 0; #define targets_alive (targets - targets_down) @@ -223,7 +223,6 @@ static pid_t pid; static struct timezone tz; static struct timeval prog_start; static unsigned long long max_completion_time = 0; -static unsigned char ttl = 0; /* outgoing ttl */ static unsigned int warn_down = 1, crit_down = 1; /* host down threshold values */ static int min_hosts_alive = -1; float pkt_backoff_factor = 1.5; @@ -520,7 +519,7 @@ main(int argc, char **argv) add_target(optarg); break; case 'l': - ttl = (unsigned char)strtoul(optarg, NULL, 0); + ttl = (int)strtoul(optarg, NULL, 0); break; case 'm': min_hosts_alive = (int)strtoul(optarg, NULL, 0); @@ -948,6 +947,7 @@ static int send_icmp_ping(int sock, struct rta_host *host) { long int len; + size_t addrlen; struct icmp_ping_data data; struct msghdr hdr; struct iovec iov; @@ -979,6 +979,7 @@ send_icmp_ping(int sock, struct rta_host *host) if (address_family == AF_INET) { struct icmp *icp = (struct icmp*)buf; + addrlen = sizeof(struct sockaddr_in); memcpy(&icp->icmp_data, &data, sizeof(data)); @@ -995,7 +996,10 @@ send_icmp_ping(int sock, struct rta_host *host) } else { struct icmp6_hdr *icp6 = (struct icmp6_hdr*)buf; + addrlen = sizeof(struct sockaddr_in6); + memcpy(&icp6->icmp6_dataun.icmp6_un_data8[4], &data, sizeof(data)); + icp6->icmp6_type = ICMP6_ECHO_REQUEST; icp6->icmp6_code = 0; icp6->icmp6_cksum = 0; @@ -1016,7 +1020,7 @@ send_icmp_ping(int sock, struct rta_host *host) memset(&hdr, 0, sizeof(hdr)); hdr.msg_name = (struct sockaddr *)&host->saddr_in; - hdr.msg_namelen = sizeof(struct sockaddr_storage); + hdr.msg_namelen = addrlen; hdr.msg_iov = &iov; hdr.msg_iovlen = 1; -- cgit v1.2.3-74-g34f1 From 413af1955538b06803458c628099f1ba9da1966b Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Fri, 4 Nov 2022 16:51:32 +0100 Subject: Remove trailing whitespaces --- plugins-root/check_icmp.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'plugins-root') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index f8f15351..abd88c4e 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -1,39 +1,39 @@ /***************************************************************************** -* +* * Monitoring check_icmp plugin -* +* * License: GPL * Copyright (c) 2005-2008 Monitoring Plugins Development Team * Original Author : Andreas Ericsson -* +* * Description: -* +* * This file contains the check_icmp plugin -* +* * Relevant RFC's: 792 (ICMP), 791 (IP) -* +* * This program was modeled somewhat after the check_icmp program, * which was in turn a hack of fping (www.fping.org) but has been * completely rewritten since to generate higher precision rta values, * and support several different modes as well as setting ttl to control. * redundant routes. The only remainders of fping is currently a few * function names. -* -* +* +* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. -* +* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. -* +* * You should have received a copy of the GNU General Public License * along with this program. If not, see . -* -* +* +* *****************************************************************************/ /* progname may change */ -- cgit v1.2.3-74-g34f1 From 7d074091dba8c1d4081971bf62e694d0b1a03d41 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Fri, 4 Nov 2022 16:53:57 +0100 Subject: Remove hardcoded DBL_MAX definition --- plugins-root/check_icmp.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'plugins-root') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index abd88c4e..0d10d22d 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -95,10 +95,6 @@ const char *email = "devel@monitoring-plugins.org"; # define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 #endif -#ifndef DBL_MAX -# define DBL_MAX 9.9999999999e999 -#endif - typedef unsigned short range_t; /* type for get_range() -- unimplemented */ typedef struct rta_host { -- cgit v1.2.3-74-g34f1 From 9a73a94258689cd9337fe7a7937fe85e4670aaeb Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Fri, 4 Nov 2022 17:08:36 +0100 Subject: Replace DBL_MAX with INFITY to check if value was set --- plugins-root/check_icmp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins-root') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 0d10d22d..7f3c4b5b 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -55,6 +55,7 @@ const char *email = "devel@monitoring-plugins.org"; #include #include #include +#include #include #include #include @@ -1220,7 +1221,7 @@ finish(int sig) host->rta / 1000, (float)warn.rta / 1000, (float)crit.rta / 1000, (targets > 1) ? host->name : "", host->pl, warn.pl, crit.pl, (targets > 1) ? host->name : "", (float)host->rtmax / 1000, - (targets > 1) ? host->name : "", (host->rtmin < DBL_MAX) ? (float)host->rtmin / 1000 : (float)0); + (targets > 1) ? host->name : "", (host->rtmin < INFINITY) ? (float)host->rtmin / 1000 : (float)0); host = host->next; } @@ -1323,7 +1324,7 @@ add_target_ip(char *arg, struct sockaddr_storage *in) memcpy(host_sin6->sin6_addr.s6_addr, sin6->sin6_addr.s6_addr, sizeof host_sin6->sin6_addr.s6_addr); } - host->rtmin = DBL_MAX; + host->rtmin = INFINITY; if(!list) list = cursor = host; else cursor->next = host; -- cgit v1.2.3-74-g34f1 From e5db81bb29544b1be6500ad4a4dec5b4002c9962 Mon Sep 17 00:00:00 2001 From: Aksel Sjögren Date: Tue, 29 Nov 2022 13:55:32 +0100 Subject: check_icmp: fix parsing help/version long options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix parsing of the long options --help and --version. The special handling must be done before calling getopt(). This fixes erroneous output like: ./check_icmp --version ./check_icmp: invalid option -- '-' ./check_icmp: invalid option -- 'e' ./check_icmp: invalid option -- 'r' ./check_icmp: invalid option -- '-' ./check_icmp: invalid option -- 'e' ./check_icmp: invalid option -- 'r' Signed-off-by: Aksel Sjögren --- plugins-root/check_icmp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'plugins-root') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index f8f15351..1f87b75f 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -451,6 +451,14 @@ main(int argc, char **argv) packets = 5; } + /* support "--help" and "--version" */ + if(argc == 2) { + if(!strcmp(argv[1], "--help")) + strcpy(argv[1], "-h"); + if(!strcmp(argv[1], "--version")) + strcpy(argv[1], "-V"); + } + /* Parse protocol arguments first */ for(i = 1; i < argc; i++) { while((arg = getopt(argc, argv, opts_str)) != EOF) { @@ -555,14 +563,6 @@ main(int argc, char **argv) /* Parse extra opts if any */ argv=np_extra_opts(&argc, argv, progname); - /* support "--help" and "--version" */ - if(argc == 2) { - if(!strcmp(argv[1], "--help")) - strcpy(argv[1], "-h"); - if(!strcmp(argv[1], "--version")) - strcpy(argv[1], "-V"); - } - argv = &argv[optind]; while(*argv) { add_target(*argv); -- cgit v1.2.3-74-g34f1 From f79eb4f2caf168e0599be3702244771791e23934 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Wed, 1 Feb 2023 00:57:42 +0100 Subject: Link plugins against libcrypto to make hashes available --- plugins-root/Makefile.am | 2 +- plugins/Makefile.am | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins-root') diff --git a/plugins-root/Makefile.am b/plugins-root/Makefile.am index 7cd2675a..40aa020d 100644 --- a/plugins-root/Makefile.am +++ b/plugins-root/Makefile.am @@ -26,7 +26,7 @@ EXTRA_PROGRAMS = pst3 EXTRA_DIST = t pst3.c -BASEOBJS = ../plugins/utils.o ../lib/libmonitoringplug.a ../gl/libgnu.a +BASEOBJS = ../plugins/utils.o ../lib/libmonitoringplug.a ../gl/libgnu.a $(LIB_CRYPTO) NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS) NETLIBS = $(NETOBJS) $(SOCKETLIBS) diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 3fde54d6..ab59eb73 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -51,10 +51,10 @@ noinst_LIBRARIES = libnpcommon.a libnpcommon_a_SOURCES = utils.c netutils.c sslutils.c runcmd.c \ popen.c utils.h netutils.h popen.h common.h runcmd.c runcmd.h -BASEOBJS = libnpcommon.a ../lib/libmonitoringplug.a ../gl/libgnu.a +BASEOBJS = libnpcommon.a ../lib/libmonitoringplug.a ../gl/libgnu.a $(LIB_CRYPTO) NETOBJS = $(BASEOBJS) $(EXTRA_NETOBLS) NETLIBS = $(NETOBJS) $(SOCKETLIBS) -SSLOBJS = $(BASEOBJS) $(NETLIBS) $(SSLLIBS) +SSLOBJS = $(BASEOBJS) $(NETLIBS) $(SSLLIBS) $(LIB_CRYPTO) TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir) -- cgit v1.2.3-74-g34f1 From d3a4bad51d72a3c5bcc06ceb5e0a823dcc24bf49 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 19 Feb 2023 14:31:21 +0100 Subject: check_icmp: Fix compiler warning This fixes a compiler warning with no real world impact. The compiler complains about a missing return, which is correct, but in that scenario the program would crash anyways, so this has no impact. --- plugins-root/check_icmp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins-root') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 7f3c4b5b..317cd535 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -1430,20 +1430,21 @@ set_source_ip(char *arg) static in_addr_t get_ip_address(const char *ifname) { + // TODO: Rewrite this so the function return an error and we exit somewhere else + struct sockaddr_in ip; #if defined(SIOCGIFADDR) struct ifreq ifr; - struct sockaddr_in ip; strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name) - 1); ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0'; if(ioctl(icmp_sock, SIOCGIFADDR, &ifr) == -1) crash("Cannot determine IP address of interface %s", ifname); memcpy(&ip, &ifr.ifr_addr, sizeof(ip)); - return ip.sin_addr.s_addr; #else errno = 0; crash("Cannot get interface IP address on this platform."); #endif + return ip.sin_addr.s_addr; } /* -- cgit v1.2.3-74-g34f1 From 423284edfa980fc3fdb51ab20af96685a988ba97 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 19 Feb 2023 14:34:29 +0100 Subject: check_icmp: Fix compiler warning This fixes a compiler warning which complains about an uninitialized value for a variable which is then returned. This had no real world impact, since the program would crash in the branch where result is not set. The variable is initialized to "-1" which would be the error for inet_pton. --- plugins-root/check_icmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins-root') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 317cd535..e59e92d3 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -1339,7 +1339,7 @@ add_target_ip(char *arg, struct sockaddr_storage *in) static int add_target(char *arg) { - int error, result; + int error, result = -1; struct sockaddr_storage ip; struct addrinfo hints, *res, *p; struct sockaddr_in *sin; -- cgit v1.2.3-74-g34f1 From 0f3703e641f0f995a8abb40056cb5430b6c228c4 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Fri, 14 Apr 2023 14:37:47 +0000 Subject: Fix a lot of typos reported by codespell --- ACKNOWLEDGEMENTS | 2 +- NEWS | 30 +++++++++++++++--------------- NPTest.pm | 6 +++--- ROADMAP | 14 +++++++------- build-aux/ltmain.sh | 6 +++--- config_test/child_test.c | 2 +- configure.ac | 10 +++++----- doc/developer-guidelines.sgml | 12 ++++++------ lib/parse_ini.c | 4 ++-- lib/tests/test_cmd.c | 14 +++++++------- lib/tests/test_disk.c | 4 ++-- lib/tests/test_ini3.t | 2 +- lib/tests/test_opts3.t | 2 +- lib/tests/test_utils.c | 2 +- lib/utils_cmd.c | 2 +- m4/np_mysqlclient.m4 | 2 +- m4/uriparser.m4 | 2 +- plugins-root/check_icmp.c | 2 +- plugins-root/pst3.c | 2 +- plugins-root/t/check_icmp.t | 2 +- plugins-scripts/check_disk_smb.pl | 2 +- plugins-scripts/check_ifoperstatus.pl | 8 ++++---- plugins-scripts/check_ifstatus.pl | 2 +- plugins-scripts/check_ircd.pl | 4 ++-- plugins-scripts/check_mailq.pl | 2 +- plugins-scripts/check_rpc.pl | 2 +- plugins-scripts/check_uptime.pl | 2 +- plugins/check_curl.c | 6 +++--- plugins/check_disk.c | 6 +++--- plugins/check_dns.c | 2 +- plugins/check_fping.c | 2 +- plugins/check_http.c | 4 ++-- plugins/check_ldap.c | 2 +- plugins/check_load.c | 2 +- plugins/check_ntp.c | 10 +++++----- plugins/check_ntp_peer.c | 8 ++++---- plugins/check_ntp_time.c | 2 +- plugins/check_procs.c | 4 ++-- plugins/check_real.c | 4 ++-- plugins/check_smtp.c | 2 +- plugins/check_snmp.c | 2 +- plugins/check_swap.c | 2 +- plugins/check_tcp.c | 2 +- plugins/check_ups.c | 2 +- plugins/picohttpparser/picohttpparser.c | 4 ++-- plugins/popen.c | 2 +- plugins/runcmd.c | 2 +- plugins/t/check_by_ssh.t | 18 +++++++++--------- plugins/t/check_disk.t | 12 ++++++------ plugins/t/check_http.t | 6 +++--- plugins/t/check_mysql.t | 6 +++--- plugins/t/check_mysql_query.t | 2 +- plugins/t/check_nagios.t | 2 +- plugins/t/negate.t | 2 +- plugins/tests/check_snmp.t | 4 ++-- plugins/utils.h | 2 +- po/de.po | 12 ++++++------ po/fr.po | 6 +++--- po/monitoring-plugins.pot | 6 +++--- tap/tap.3 | 4 ++-- tap/tap.h | 2 +- tools/build_perl_modules | 6 +++--- tools/p1.pl | 2 +- tools/tinderbox_build | 2 +- 64 files changed, 154 insertions(+), 154 deletions(-) (limited to 'plugins-root') diff --git a/ACKNOWLEDGEMENTS b/ACKNOWLEDGEMENTS index d73be549..af29c154 100644 --- a/ACKNOWLEDGEMENTS +++ b/ACKNOWLEDGEMENTS @@ -20,7 +20,7 @@ Using the DLPI support on SysV systems to get the host MAC address in check_dhcp Stenberg, Daniel Copyright (c) 1996 - 2004, Daniel Stenberg, http://curl.haxx.se/ -Use of duplication of macros in m4/np_curl.m4 (slighly adapted for m4/uriparser.m4 too) +Use of duplication of macros in m4/np_curl.m4 (slightly adapted for m4/uriparser.m4 too) Coreutils team Copyright (C) 91, 1995-2004 Free Software Foundation, Inc. diff --git a/NEWS b/NEWS index 83d522e7..9ec3c5e0 100644 --- a/NEWS +++ b/NEWS @@ -9,12 +9,12 @@ This file documents the major additions and syntax changes between releases. check_http/check_curl: add chunked encoding test check_log: Added --exclude to exclude patterns check_log: Add tests - check_disk: Clarify usage possibilites + check_disk: Clarify usage possibilities FIXES fixed two PRId64 to PRIu64 in perfdata_uint64 - check_pgsql: Removing is_pg_dbname alltogether,using postgres API. - check_http: Remove superflous CRLF in HTTP-Requests + check_pgsql: Removing is_pg_dbname altogether,using postgres API. + check_http: Remove superfluous CRLF in HTTP-Requests check_curl: detect ipv6 check_icmp: fix parsing help/version long options check_http: fix test plan @@ -40,7 +40,7 @@ This file documents the major additions and syntax changes between releases. 2.3.2 20th Oct 2022 GENERAL - Use netcat-openbsd for debian explicitely (by @RincewindsHat #1704) + Use netcat-openbsd for debian explicitly (by @RincewindsHat #1704) Replace egrep with grep -E (by @RincewindsHat #1791) Use silent automake by default (by @RincewindsHat #1747) @@ -123,7 +123,7 @@ This file documents the major additions and syntax changes between releases. check_log: Modernize check log (by @RincewindsHat #1692) check_mailq: remove duplicate W=i/C=i args in check_mailq.pl (by @ichdasich #1755) check_ntp: Check ntp remove unused variables (by @RincewindsHat #1781) - check_pgsql: Using snprintf which honors the buffers size and guarantees null temination. (Closes: #1601) (by @waja #1663) + check_pgsql: Using snprintf which honors the buffers size and guarantees null termination. (Closes: #1601) (by @waja #1663) check_procs: Fix double percentage sign in usage (by @RincewindsHat #1743) check_sensors.sh: Make shellcheck happier (by @RincewindsHat #1679) check_snmp: Fixed option description authpassword -> authpasswd + whitespaces (by @RincewindsHat #1676) @@ -165,7 +165,7 @@ This file documents the major additions and syntax changes between releases. check_apt: adding packages-warning option check_load: Adding top consuming processes option check_http: Adding Proxy-Authorization and extra headers - check_snmp: make calcualtion of timeout value in help output more clear + check_snmp: make calculation of timeout value in help output more clear check_uptime: new plugin for checking uptime to see how long the system is running check_curl: check_http replacement based on libcurl check_http: Allow user to specify HTTP method after proxy CONNECT @@ -195,7 +195,7 @@ This file documents the major additions and syntax changes between releases. check_procs: improve command examples for 'at least' processes check_swap: repaired "-n" behaviour check_disk: include -P switch in help - check_mailq: restore accidentially removed options + check_mailq: restore accidentally removed options 2.2 29th November 2016 ENHANCEMENTS @@ -236,7 +236,7 @@ This file documents the major additions and syntax changes between releases. check_ssh now returns CRITICAL for protocol/version errors If a plugin is invoked with -h/--help or -V/--version, the exit status is now UNKNOWN - The superseeded check_ntp.pl was removed, please use check_ntp_peer or + The superseded check_ntp.pl was removed, please use check_ntp_peer or check_ntp_time instead 2.1.2 16th October 2015 @@ -263,7 +263,7 @@ This file documents the major additions and syntax changes between releases. New check_mysql -n option to ignore authentication failures Added IP and port or socket name to error messages New check_ntp_time -o option to add expected offset - check_disk shows now troubled partions in verbose mode + check_disk shows now troubled partitions in verbose mode check_dig has now support for drill and dig check_dig has now support for -6 option Add performance data to check_file_age @@ -357,10 +357,10 @@ This file documents the major additions and syntax changes between releases. New check_procs -k option to ignore kernel threads (on Linux) Let check_procs use /proc//exe (if available) instead of getpid(2), unless -T is specified Let check_mysql support SSL - Let check_mysql add perfromance metrics for all checks + Let check_mysql add performance metrics for all checks New check_mysql -f option to specify a client options file New check_mysql -g option to specify a client options group - New check_snmp --offset option to allow for adding/substracting an offset value to sensor data + New check_snmp --offset option to allow for adding/subtracting an offset value to sensor data Let check_snmp support an arbitrary number of OIDs Let check_ide_smart support NetBSD @@ -375,7 +375,7 @@ This file documents the major additions and syntax changes between releases. Fix deprecated imports of check_nmap.py WARNINGS - check_http behaviour of -k/--header changed since it does not seperate multiple headers by semicolons anymore. Use multiple -k switches instead. + check_http behaviour of -k/--header changed since it does not separate multiple headers by semicolons anymore. Use multiple -k switches instead. check_http's --proxy_authorization option is now called --proxy-authorization (it was always documented this way) The contrib directory has been removed from this distribution @@ -526,7 +526,7 @@ This file documents the major additions and syntax changes between releases. check_ntp and check_ntp_peer now show proper jitter/stratum thresholds longopts in --help check_dns now allow to repeat -a to match multiple possibly returned address (common with load balancers) check_mysql and check_radius now try clearing password in processlist just like check_mysql_query - check_mysql and check_mysql_query now support sockets explicitely (-s, --socket) + check_mysql and check_mysql_query now support sockets explicitly (-s, --socket) negate now has the ability to replace the status text as well (-s, --substitute) Added performance data to check_ping Added support for --extra-opts in all C plugins (disabled by default, see configure --help) @@ -566,7 +566,7 @@ This file documents the major additions and syntax changes between releases. New check_disk option -L: Only check local filesystems, but call stat() on remote ones, too. Thus accessibility of remote filesystems can be checked without any threshold comparison. Check_disk's --help now prints some examples for the new features introduced in 1.4.8 - New check_disk -i/-I option to ignore pathes/partitions based on regular expressions + New check_disk -i/-I option to ignore paths/partitions based on regular expressions New check_disk -A option to select all filesystems explicitly WARNING: check_disk's -E option must now be passed before -p or -r/-R arguments Passing -E after -p or -r results in UNKNOWN state, now @@ -615,7 +615,7 @@ This file documents the major additions and syntax changes between releases. Fixed MKINSTALLDIRS problem in po/ ./configure now detects if possible to compile check_mysql Fixed broken HELO in check_smtp - check_icmp now allows to set a minimum number of hosts required for successs (-m) + check_icmp now allows to set a minimum number of hosts required for success (-m) check_icmp fix for *BSD when running for long time check_ping times out 1 second quicker if host is unreachable Root plugins installed with world executable diff --git a/NPTest.pm b/NPTest.pm index 4b2de39b..9b25ac3e 100644 --- a/NPTest.pm +++ b/NPTest.pm @@ -151,14 +151,14 @@ of testing against a set of desired exit status values. =item * Firstly, if C<$desiredExitStatus> is a reference to an array of exit -stati, if the actual exit status of the command is present in the +statuses, if the actual exit status of the command is present in the array, it is used in the call to C when testing the exit status. =item * Alternatively, if C<$desiredExitStatus> is a reference to a hash of -exit stati (mapped to the strings "continue" or "skip"), similar +exit statuses(mapped to the strings "continue" or "skip"), similar processing to the above occurs with the side affect of determining if any generated output testing should proceed. Note: only the string "skip" will result in generated output testing being skipped. @@ -207,7 +207,7 @@ under the same terms as the Monitoring Plugins release. my( %CACHE ) = (); -# I'm not really sure wether to house a site-specific cache inside +# I'm not really sure whether to house a site-specific cache inside # or outside of the extracted source / build tree - lets default to outside my( $CACHEFILENAME ) = ( exists( $ENV{'NPTEST_CACHE'} ) && $ENV{'NPTEST_CACHE'} ) ? $ENV{'NPTEST_CACHE'} : "/var/tmp/NPTest.cache"; # "../Cache.pdd"; diff --git a/ROADMAP b/ROADMAP index 28f9b31c..6378ec74 100644 --- a/ROADMAP +++ b/ROADMAP @@ -7,7 +7,7 @@ With that done, it's time to figure out what we are doing for release 1.3 development. I have a few ideas. Maybe others do as well. DOCUMENTATION: - We pretty much have decieded that we will doing something along + We pretty much have decided that we will doing something along the lines of a literate programming model. So far, we have site documentation in DocBook. I have some ideas here, which I will discuss in a separate thread. @@ -39,9 +39,9 @@ inconsistent mess and I'd love to ditch it. I only created it to satisfy people that wanted reverse compatibility and did not have GNU getopt. -Bu I would like to urge that all standard plugins contain +But I would like to urge that all standard plugins contain validate_arguments(). I think this will help convey the idea that -validations hould be done, even if we don't insist on the specific +validations should be done, even if we don't insist on the specific extent that each plugin must do that validation. This is the set of standard options I envision: @@ -59,7 +59,7 @@ Reserved: -F, --file = STRING (usually input) -O, --output = STRING (output file) -Recommended, but not reserverd: +Recommended, but not reserved: -I, --ipaddress = STRING -C, --community = STRING @@ -69,7 +69,7 @@ Recommended, but not reserverd: -P, --port = INT -u, --url = STRING (also --username if --url is not needed) -I am suggesting that port alway be '-P' (uppercase) -- we are +I am suggesting that port always be '-P' (uppercase) -- we are currently inconsistent in that regard. I am also adding '-q' for silent running. This is totally self @@ -87,12 +87,12 @@ Programming: length character assignments, at least to the extent possible, from the C-based plugins. To that end, I have made strscpy and friends in utils.c -- I'd like to deploy them. I have comments - that there is alot of duplicated code, and techniques used that + that there is a lot of duplicated code, and techniques used that should be cleaned up. Details in a separate thread. Remote checks: I have a proposal in hand to incorporate ssh check into spopen() - so that remote machine checks can be seemless. A nice idea, but + so that remote machine checks can be seamless. A nice idea, but complex enough to require discussion. Another thread. I also have a wish list, and I'm sure I've forgot some items. I'll diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh index 33f642a0..2e8548d3 100644 --- a/build-aux/ltmain.sh +++ b/build-aux/ltmain.sh @@ -189,7 +189,7 @@ func_basename () # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. -# value retuned in "$func_basename_result" +# value returned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. @@ -522,7 +522,7 @@ func_mkdir_p () # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. + # list in case some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done @@ -4394,7 +4394,7 @@ EOF { /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX namespace, but it is not one of the ones we know about and - have already dealt with, above (inluding dump-script), then + have already dealt with, above (including dump-script), then report an error. Otherwise, targets might begin to believe they are allowed to use options in the LTWRAPPER_OPTION_PREFIX namespace. The first time any user complains about this, we'll diff --git a/config_test/child_test.c b/config_test/child_test.c index 4bf85049..2add3bcf 100644 --- a/config_test/child_test.c +++ b/config_test/child_test.c @@ -30,7 +30,7 @@ int main(){ /* pipefd[1] is for writing to the pipe. We want the output * that used to go to the standard output (file descriptor 1) * to be written to the pipe. The following command does this, - * creating a new file descripter 1 (the lowest available) + * creating a new file descriptor 1 (the lowest available) * that writes where pipefd[1] goes. */ dup (pipefd[1]); /* points pipefd at file descriptor */ /* the child isn't going to read from the pipe, so diff --git a/configure.ac b/configure.ac index 0c7169e8..bad5c53c 100644 --- a/configure.ac +++ b/configure.ac @@ -932,7 +932,7 @@ elif ps -Ao 's comm vsz rss uid user pid ppid args' 2>/dev/null | \ then ac_cv_ps_varlist="[procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos]" ac_cv_ps_command="$PATH_TO_PS -Ao 's uid pid ppid vsz rss pcpu comm args'" - # There must be no space between the %s and %n due to a wierd problem in sscanf where + # There must be no space between the %s and %n due to a weird problem in sscanf where # it will return %n as longer than the line length ac_cv_ps_format="%s %d %d %d %d %d %f %s%n" ac_cv_ps_cols=9 @@ -1552,7 +1552,7 @@ if test -n "$PATH_TO_SUDO" then AC_DEFINE_UNQUOTED(PATH_TO_SUDO,"$PATH_TO_SUDO",[path to sudo]) else - AC_MSG_WARN([Could not find sudo or eqivalent]) + AC_MSG_WARN([Could not find sudo or equivalent]) fi AC_PATH_PROG(PATH_TO_MAILQ,mailq) @@ -1563,7 +1563,7 @@ if test -n "$PATH_TO_MAILQ" then AC_DEFINE_UNQUOTED(PATH_TO_MAILQ,"$PATH_TO_MAILQ",[path to mailq]) else - AC_MSG_WARN([Could not find mailq or eqivalent]) + AC_MSG_WARN([Could not find mailq or equivalent]) fi AC_PATH_PROG(PATH_TO_QMAIL_QSTAT,qmail-qstat) @@ -1574,7 +1574,7 @@ if test -n "$PATH_TO_QMAIL_QSTAT" then AC_DEFINE_UNQUOTED(PATH_TO_QMAIL_QSTAT,"$PATH_TO_QMAIL_QSTAT",[path to qmail-qstat]) else - AC_MSG_WARN([Could not find qmail-qstat or eqivalent]) + AC_MSG_WARN([Could not find qmail-qstat or equivalent]) fi dnl SWAP info required is amount allocated/available and amount free @@ -1832,7 +1832,7 @@ AM_GNU_GETTEXT([external], [need-ngettext]) AM_GNU_GETTEXT_VERSION(0.15) dnl Check for Redhat spopen problem -dnl Wierd problem where ECHILD is returned from a wait call in error +dnl Weird problem where ECHILD is returned from a wait call in error dnl Only appears to affect nslookup and dig calls. Only affects redhat around dnl 2.6.9-11 (okay in 2.6.9-5). Redhat investigating root cause dnl We patch plugins/popen.c diff --git a/doc/developer-guidelines.sgml b/doc/developer-guidelines.sgml index 28674e05..1982974f 100644 --- a/doc/developer-guidelines.sgml +++ b/doc/developer-guidelines.sgml @@ -31,7 +31,7 @@ Preface The purpose of this guidelines is to provide a reference for - the plugin developers and encourage the standarization of the + the plugin developers and encourage the standardization of the different kind of plugins: C, shell, perl, python, etc. Monitoring Plugins Development Guidelines Copyright (C) 2000-2013 @@ -374,7 +374,7 @@ s - seconds (also us, ms) % - percentage B - bytes (also KB, MB, TB) - c - a continous counter (such as bytes + c - a continuous counter (such as bytes transmitted on an interface) @@ -397,7 +397,7 @@
Don't execute system commands without specifying their full path Don't use exec(), popen(), etc. to execute external - commands without explicity using the full path of the external + commands without explicitly using the full path of the external program. Doing otherwise makes the plugin vulnerable to hijacking @@ -655,7 +655,7 @@ If possible when writing lists, use tokens to make the list easy to remember and non-order dependent - so check_disk uses '-c 10000,10%' so that it is clear which is - the precentage and which is the KB values (note that due to + the percentage and which is the KB values (note that due to my own lack of foresight, that used to be '-c 10000:10%' but such constructs should all be changed for consistency, though providing reverse compatibility is fairly @@ -686,7 +686,7 @@ all the current tests and report an overall success rate. These use perl's Test::More. To do a one time test, run "cd plugins && perl t/check_disk.t". -There will somtimes be failures seen in this output which are known failures that +There will sometimes be failures seen in this output which are known failures that need to be fixed. As long as the return code is 0, it will be reported as "test pass". (If you have a fix so that the specific test passes, that will be gratefully received!) @@ -846,7 +846,7 @@ setup the tests. Run "make test" to run all the tests. It is determined to be not redundant (for instance, we would not add a new version of check_disk just because someone had provide a plugin that had perf checking - we would incorporate the features - into an exisiting plugin) + into an existing plugin) One of the developers has had the time to audit the code and declare diff --git a/lib/parse_ini.c b/lib/parse_ini.c index 25abc89b..547af433 100644 --- a/lib/parse_ini.c +++ b/lib/parse_ini.c @@ -78,7 +78,7 @@ static char *default_file_in_path(void); /* * Parse_locator decomposes a string of the form * [stanza][@filename] - * into its seperate parts. + * into its separate parts. */ static void parse_locator(const char *locator, const char *def_stanza, np_ini_info *i) @@ -169,7 +169,7 @@ read_defaults(FILE *f, const char *stanza, np_arg_list **opts) if (isspace(c)) continue; switch (c) { - /* globble up coment lines */ + /* globble up comment lines */ case ';': case '#': GOBBLE_TO(f, c, '\n'); diff --git a/lib/tests/test_cmd.c b/lib/tests/test_cmd.c index 29ca42ac..4bb60aac 100644 --- a/lib/tests/test_cmd.c +++ b/lib/tests/test_cmd.c @@ -176,14 +176,14 @@ main (int argc, char **argv) ok (result == UNSET, "(initialised) Checking exit code is reset"); command = (char *)malloc(COMMAND_LINE); - strcpy(command, "/bin/echo3456 non-existant command"); + strcpy(command, "/bin/echo3456 non-existent command"); result = cmd_run (command, &chld_out, &chld_err, 0); ok (chld_out.lines == 0, - "Non existant command, so no output"); + "Non existent command, so no output"); ok (chld_err.lines == 0, "No stderr either"); - ok (result == 3, "Get return code 3 (?) for non-existant command"); + ok (result == 3, "Get return code 3 (?) for non-existent command"); /* ensure everything is empty again */ @@ -192,14 +192,14 @@ main (int argc, char **argv) result = UNSET; command = (char *)malloc(COMMAND_LINE); - strcpy(command, "/bin/sh non-existant-file"); + strcpy(command, "/bin/sh non-existent-file"); result = cmd_run (command, &chld_out, &chld_err, 0); ok (chld_out.lines == 0, "/bin/sh returns no stdout when file is missing..."); ok (chld_err.lines == 1, "...but does give an error line"); - ok (strstr(chld_err.line[0],"non-existant-file") != NULL, "And missing filename is in error message"); + ok (strstr(chld_err.line[0],"non-existent-file") != NULL, "And missing filename is in error message"); ok (result != 0, "Get non-zero return code from /bin/sh"); @@ -219,11 +219,11 @@ main (int argc, char **argv) result = UNSET; command = (char *)malloc(COMMAND_LINE); - strcpy(command, "/bin/non-existant-command"); + strcpy(command, "/bin/non-existent-command"); result = cmd_run (command, &chld_out, &chld_err, 0); ok (chld_out.lines == 0, - "/bin/non-existant-command returns no stdout..."); + "/bin/non-existent-command returns no stdout..."); ok (chld_err.lines == 0, "...and no stderr output either"); ok (result == 3, "Get return code 3 = UNKNOWN when command does not exist"); diff --git a/lib/tests/test_disk.c b/lib/tests/test_disk.c index f6477ac4..9bd68c7a 100644 --- a/lib/tests/test_disk.c +++ b/lib/tests/test_disk.c @@ -88,10 +88,10 @@ main (int argc, char **argv) cflags, 3,strdup("regex on dev names:")); np_test_mount_entry_regex(dummy_mount_list, strdup("/foo"), cflags, 0, - strdup("regex on non existant dev/path:")); + strdup("regex on non existent dev/path:")); np_test_mount_entry_regex(dummy_mount_list, strdup("/Foo"), cflags | REG_ICASE,0, - strdup("regi on non existant dev/path:")); + strdup("regi on non existent dev/path:")); np_test_mount_entry_regex(dummy_mount_list, strdup("/c.t0"), cflags, 3, strdup("partial devname regex match:")); diff --git a/lib/tests/test_ini3.t b/lib/tests/test_ini3.t index a2ca94a4..41169dbc 100755 --- a/lib/tests/test_ini3.t +++ b/lib/tests/test_ini3.t @@ -10,7 +10,7 @@ if (! -e "./test_ini3") { # array of argument arrays # - First value is the expected return code # - 2nd value is the NAGIOS_CONFIG_PATH -# TODO: looks like we look in default path after looking trough this variable - shall we? +# TODO: looks like we look in default path after looking through this variable - shall we? # - 3rd value is the plugin name # - 4th is the ini locator my @TESTS = ( diff --git a/lib/tests/test_opts3.t b/lib/tests/test_opts3.t index 8d974ca0..d77a35ce 100755 --- a/lib/tests/test_opts3.t +++ b/lib/tests/test_opts3.t @@ -10,7 +10,7 @@ if (! -e "./test_opts3") { # array of argument arrays # - First value is the expected return code # - 2nd value is the NAGIOS_CONFIG_PATH -# TODO: looks like we look in default path after looking trough this variable - shall we? +# TODO: looks like we look in default path after looking through this variable - shall we? # - 3rd value is the plugin name # - 4th and up are arguments my @TESTS = ( diff --git a/lib/tests/test_utils.c b/lib/tests/test_utils.c index bc00fac1..7b10494c 100644 --- a/lib/tests/test_utils.c +++ b/lib/tests/test_utils.c @@ -395,7 +395,7 @@ main (int argc, char **argv) ok( temp_state_data==NULL, "Older data version gives NULL" ); temp_state_key->data_version=54; - temp_state_key->_filename="var/nonexistant"; + temp_state_key->_filename="var/nonexistent"; temp_state_data = np_state_read(); ok( temp_state_data==NULL, "Missing file gives NULL" ); ok( this_monitoring_plugin->state->state_data==NULL, "No state information" ); diff --git a/lib/utils_cmd.c b/lib/utils_cmd.c index 795840d3..8b8e5708 100644 --- a/lib/utils_cmd.c +++ b/lib/utils_cmd.c @@ -161,7 +161,7 @@ _cmd_open (char *const *argv, int *pfd, int *pfderr) } /* parent picks up execution here */ - /* close childs descriptors in our address space */ + /* close children descriptors in our address space */ close (pfd[1]); close (pfderr[1]); diff --git a/m4/np_mysqlclient.m4 b/m4/np_mysqlclient.m4 index 5099a02b..9f533ea3 100644 --- a/m4/np_mysqlclient.m4 +++ b/m4/np_mysqlclient.m4 @@ -81,7 +81,7 @@ AC_DEFUN([np_check_lib_mariadbclient], ], [with_mysql=no], [$np_mysql_libs]) ]) -dnl Will take $1, find last occurrance of -LDIR and add DIR to LD_RUN_PATH +dnl Will take $1, find last occurrence of -LDIR and add DIR to LD_RUN_PATH AC_DEFUN([np_add_to_runpath], [ dnl Need [[ ]] so autoconf gives us just one set diff --git a/m4/uriparser.m4 b/m4/uriparser.m4 index dbb8a551..5113638f 100644 --- a/m4/uriparser.m4 +++ b/m4/uriparser.m4 @@ -1,4 +1,4 @@ -# (this check is rougly based on and inspired libcurl.m4) +# (this check is roughly based on and inspired libcurl.m4) # URIPARSER_CHECK ([DEFAULT-ACTION], [MINIMUM-VERSION], # [ACTION-IF-YES], [ACTION-IF-NO]) # Checks for uriparser library. DEFAULT-ACTION is the string yes or no to diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index c3be2efd..9ceb35b2 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -274,7 +274,7 @@ get_icmp_error_msg(unsigned char icmp_type, unsigned char icmp_code) break; case ICMP_TIMXCEED: - /* really 'out of reach', or non-existant host behind a router serving + /* really 'out of reach', or non-existent host behind a router serving * two different subnets */ switch(icmp_code) { case ICMP_TIMXCEED_INTRANS: msg = "Time to live exceeded in transit"; break; diff --git a/plugins-root/pst3.c b/plugins-root/pst3.c index c3589f0a..1f69f3a6 100644 --- a/plugins-root/pst3.c +++ b/plugins-root/pst3.c @@ -257,6 +257,6 @@ void usage() { printf("\tRSS - Real memory usage (kilobytes)\n"); printf("\t%%CPU - CPU usage\n"); printf("\tCOMMAND - Command being run\n"); - printf("\tARGS - Full command line with arguements\n"); + printf("\tARGS - Full command line with arguments\n"); return; } diff --git a/plugins-root/t/check_icmp.t b/plugins-root/t/check_icmp.t index f6aa6813..96addd3b 100644 --- a/plugins-root/t/check_icmp.t +++ b/plugins-root/t/check_icmp.t @@ -92,5 +92,5 @@ like( $res->output, $successOutput, "Output OK" ); $res = NPTest->testCmd( "$sudo ./check_icmp -H $host_responsive -b 65507" ); -is( $res->return_code, 0, "Try max paket size" ); +is( $res->return_code, 0, "Try max packet size" ); like( $res->output, $successOutput, "Output OK - Didn't overflow" ); diff --git a/plugins-scripts/check_disk_smb.pl b/plugins-scripts/check_disk_smb.pl index 15d16340..f4d33a7b 100644 --- a/plugins-scripts/check_disk_smb.pl +++ b/plugins-scripts/check_disk_smb.pl @@ -28,7 +28,7 @@ use FindBin; use lib "$FindBin::Bin"; use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); -# make us session leader which makes all childs exit if we do +# make us session leader which makes all children exit if we do setsid; sub print_help (); diff --git a/plugins-scripts/check_ifoperstatus.pl b/plugins-scripts/check_ifoperstatus.pl index c190ce95..e335cdad 100755 --- a/plugins-scripts/check_ifoperstatus.pl +++ b/plugins-scripts/check_ifoperstatus.pl @@ -134,7 +134,7 @@ if (defined $ifdescr || defined $iftype) { } if ($status==0) { $state = "UNKNOWN"; - printf "$state: could not retrive ifdescr/iftype snmpkey - $status-$snmpkey\n"; + printf "$state: could not retrieve ifdescr/iftype snmpkey - $status-$snmpkey\n"; $session->close; exit $ERRORS{$state}; } @@ -187,7 +187,7 @@ if (defined $ifXTable) { $name = $response->{$snmpIfDescr} ; } -## if AdminStatus is down - some one made a consious effort to change config +## if AdminStatus is down - some one made a conscious effort to change config ## if ( not ($response->{$snmpIfAdminStatus} == 1) ) { $answer = "Interface $name (index $snmpkey) is administratively down."; @@ -286,7 +286,7 @@ sub print_usage() { printf "check_ifoperstatus -k -H [-C ]\n"; printf "Copyright (C) 2000 Christoph Kron\n"; printf "check_ifoperstatus.pl comes with ABSOLUTELY NO WARRANTY\n"; - printf "This programm is licensed under the terms of the "; + printf "This program is licensed under the terms of the "; printf "GNU General Public License\n(check source code for details)\n"; printf "\n\n"; } @@ -424,7 +424,7 @@ sub process_arguments() { if (defined $seclevel && defined $secname) { $session_opts{'-username'} = $secname; - # Must define a security level even though defualt is noAuthNoPriv + # Must define a security level even though default is noAuthNoPriv unless ( grep /^$seclevel$/, qw(noAuthNoPriv authNoPriv authPriv) ) { usage("Must define a valid security level even though default is noAuthNoPriv"); } diff --git a/plugins-scripts/check_ifstatus.pl b/plugins-scripts/check_ifstatus.pl index 32984e53..38b87fcc 100755 --- a/plugins-scripts/check_ifstatus.pl +++ b/plugins-scripts/check_ifstatus.pl @@ -354,7 +354,7 @@ sub process_arguments() { if (defined $seclevel && defined $secname) { $session_opts{'-username'} = $secname; - # Must define a security level even though defualt is noAuthNoPriv + # Must define a security level even though default is noAuthNoPriv unless ( grep /^$seclevel$/, qw(noAuthNoPriv authNoPriv authPriv) ) { usage("Must define a valid security level even though default is noAuthNoPriv"); } diff --git a/plugins-scripts/check_ircd.pl b/plugins-scripts/check_ircd.pl index d869ae7b..84f20229 100755 --- a/plugins-scripts/check_ircd.pl +++ b/plugins-scripts/check_ircd.pl @@ -60,7 +60,7 @@ sub print_usage (); sub connection ($$$$); sub bindRemote ($$); -# -------------------------------------------------------------[ Enviroment ]-- +# -------------------------------------------------------------[ Environment ]-- $ENV{'PATH'}='@TRUSTED_PATH@'; $ENV{'BASH_ENV'}=''; @@ -208,7 +208,7 @@ MAIN: # Just in case of problems, let's not hang the monitoring system $SIG{'ALRM'} = sub { - print "Somthing is Taking a Long Time, Increase Your TIMEOUT (Currently Set At $TIMEOUT Seconds)\n"; + print "Something is Taking a Long Time, Increase Your TIMEOUT (Currently Set At $TIMEOUT Seconds)\n"; exit $ERRORS{"UNKNOWN"}; }; diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl index f02c90fb..49156af3 100755 --- a/plugins-scripts/check_mailq.pl +++ b/plugins-scripts/check_mailq.pl @@ -4,7 +4,7 @@ # transmittal. # # Initial version support sendmail's mailq command -# Support for mutiple sendmail queues (Carlos Canau) +# Support for multiple sendmail queues (Carlos Canau) # Support for qmail (Benjamin Schmid) # License Information: diff --git a/plugins-scripts/check_rpc.pl b/plugins-scripts/check_rpc.pl index 47d6e49e..8a56b9fc 100755 --- a/plugins-scripts/check_rpc.pl +++ b/plugins-scripts/check_rpc.pl @@ -5,7 +5,7 @@ # usage: # check_rpc host service # -# Check if an rpc serice is registered and running +# Check if an rpc service is registered and running # using rpcinfo - $proto $host $prognum 2>&1 |"; # # Use these hosts.cfg entries as examples diff --git a/plugins-scripts/check_uptime.pl b/plugins-scripts/check_uptime.pl index f9542872..d73e40e1 100755 --- a/plugins-scripts/check_uptime.pl +++ b/plugins-scripts/check_uptime.pl @@ -110,7 +110,7 @@ $pretty_uptime .= sprintf( "%d week%s, ", $weeks, $weeks == 1 ? "" : "s" ) if $pretty_uptime .= sprintf( "%d day%s, ", $days, $days == 1 ? "" : "s" ) if $days; $pretty_uptime .= sprintf( "%d hour%s, ", $hours, $hours == 1 ? "" : "s" ) if $hours; $pretty_uptime .= sprintf( "%d minute%s, ", $mins, $mins == 1 ? "" : "s" ) if $mins; -# Replace last occurence of comma with "and" +# Replace last occurrence of comma with "and" $pretty_uptime =~ s/, $/ and /; # Always print the seconds (though it may be 0 seconds) $pretty_uptime .= sprintf( "%d second%s", $secs, $secs == 1 ? "" : "s" ); diff --git a/plugins/check_curl.c b/plugins/check_curl.c index c51914a9..be5740d7 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c @@ -618,7 +618,7 @@ check_http (void) #ifdef LIBCURL_FEATURE_SSL - /* set SSL version, warn about unsecure or unsupported versions */ + /* set SSL version, warn about insecure or unsupported versions */ if (use_ssl) { handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_SSLVERSION, ssl_version), "CURLOPT_SSLVERSION"); } @@ -986,7 +986,7 @@ GOT_FIRST_CERT: } } else { /* this is a specific code in the command line to - * be returned when a redirection is encoutered + * be returned when a redirection is encountered */ } result = max_state_alt (onredirect, result); @@ -2051,7 +2051,7 @@ print_usage (void) printf (" %s -H | -I [-u ] [-p ]\n",progname); printf (" [-J ] [-K ] [--ca-cert ] [-D]\n"); printf (" [-w ] [-c ] [-t ] [-L] [-E] [-a auth]\n"); - printf (" [-b proxy_auth] [-f ]\n"); + printf (" [-b proxy_auth] [-f ]\n"); printf (" [-e ] [-d string] [-s string] [-l] [-r | -R ]\n"); printf (" [-P string] [-m :] [-4|-6] [-N] [-M ]\n"); printf (" [-A string] [-k string] [-S ] [--sni]\n"); diff --git a/plugins/check_disk.c b/plugins/check_disk.c index bd84c825..a99f35e3 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c @@ -587,7 +587,7 @@ process_arguments (int argc, char **argv) /* 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 + freespace, we have to alert if outside the range. Thus we artificially force @ at the beginning of the range, so that it is backwards compatible */ case 'c': /* critical threshold */ @@ -1115,7 +1115,7 @@ get_path_stats (struct parameter_list *p, struct fs_usage *fsp) { p->available_to_root = fsp->fsu_bfree; p->used = fsp->fsu_blocks - fsp->fsu_bfree; if (freespace_ignore_reserved) { - /* option activated : we substract the root-reserved space from the total */ + /* option activated : we subtract the root-reserved space from the total */ p->total = fsp->fsu_blocks - p->available_to_root + p->available; } else { /* default behaviour : take all the blocks into account */ @@ -1130,7 +1130,7 @@ get_path_stats (struct parameter_list *p, struct fs_usage *fsp) { p->inodes_free_to_root = fsp->fsu_ffree; /* Free file nodes for root. */ p->inodes_used = fsp->fsu_files - fsp->fsu_ffree; if (freespace_ignore_reserved) { - /* option activated : we substract the root-reserved inodes from the total */ + /* option activated : we subtract the root-reserved inodes from the total */ /* not all OS report fsp->fsu_favail, only the ones with statvfs syscall */ /* for others, fsp->fsu_ffree == fsp->fsu_favail */ p->inodes_total = fsp->fsu_files - p->inodes_free_to_root + p->inodes_free; diff --git a/plugins/check_dns.c b/plugins/check_dns.c index 9de6caf5..7ffce98b 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c @@ -75,7 +75,7 @@ main (int argc, char **argv) { char *command_line = NULL; char input_buffer[MAX_INPUT_BUFFER]; - char *address = NULL; /* comma seperated str with addrs/ptrs (sorted) */ + char *address = NULL; /* comma separated str with addrs/ptrs (sorted) */ char **addresses = NULL; int n_addresses = 0; char *msg = NULL; diff --git a/plugins/check_fping.c b/plugins/check_fping.c index db433162..6f5656ef 100644 --- a/plugins/check_fping.c +++ b/plugins/check_fping.c @@ -73,7 +73,7 @@ int wrta_p = FALSE; int main (int argc, char **argv) { -/* normaly should be int result = STATE_UNKNOWN; */ +/* normally should be int result = STATE_UNKNOWN; */ int status = STATE_UNKNOWN; int result = 0; diff --git a/plugins/check_http.c b/plugins/check_http.c index 8dda046f..8c03bc8b 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -198,7 +198,7 @@ test_file (char *path) /* * process command-line arguments - * returns true on succes, false otherwise + * returns true on success, false otherwise */ bool process_arguments (int argc, char **argv) { @@ -1885,7 +1885,7 @@ print_usage (void) printf (" %s -H | -I [-u ] [-p ]\n",progname); printf (" [-J ] [-K ]\n"); printf (" [-w ] [-c ] [-t ] [-L] [-E] [-a auth]\n"); - printf (" [-b proxy_auth] [-f ]\n"); + printf (" [-b proxy_auth] [-f ]\n"); printf (" [-e ] [-d string] [-s string] [-l] [-r | -R ]\n"); printf (" [-P string] [-m :] [-4|-6] [-N] [-M ]\n"); printf (" [-A string] [-k string] [-S ] [--sni]\n"); diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index 845a4f52..a1bfe1be 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c @@ -222,7 +222,7 @@ main (int argc, char *argv[]) /* reset the alarm handler */ alarm (0); - /* calcutate the elapsed time and compare to thresholds */ + /* calculate the elapsed time and compare to thresholds */ microsec = deltime (tv); elapsed_time = (double)microsec / 1.0e6; diff --git a/plugins/check_load.c b/plugins/check_load.c index 00f7c877..313df8ad 100644 --- a/plugins/check_load.c +++ b/plugins/check_load.c @@ -107,7 +107,7 @@ main (int argc, char **argv) int i; long numcpus; - double la[3] = { 0.0, 0.0, 0.0 }; /* NetBSD complains about unitialized arrays */ + double la[3] = { 0.0, 0.0, 0.0 }; /* NetBSD complains about uninitialized arrays */ #ifndef HAVE_GETLOADAVG char input_buffer[MAX_INPUT_BUFFER]; # ifdef HAVE_PROC_LOADAVG diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c index 8b776ba1..36146505 100644 --- a/plugins/check_ntp.c +++ b/plugins/check_ntp.c @@ -10,7 +10,7 @@ * * This file contains the check_ntp plugin * -* This plugin to check ntp servers independant of any commandline +* This plugin to check ntp servers independent of any commandline * programs or external libraries. * * @@ -79,7 +79,7 @@ typedef struct { /* this structure holds data about results from querying offset from a peer */ typedef struct { time_t waiting; /* ts set when we started waiting for a response */ - int num_responses; /* number of successfully recieved responses */ + int num_responses; /* number of successfully received responses */ uint8_t stratum; /* copied verbatim from the ntp_message */ double rtdelay; /* converted from the ntp_message */ double rtdisp; /* converted from the ntp_message */ @@ -100,7 +100,7 @@ typedef struct { /* NB: not necessarily NULL terminated! */ } ntp_control_message; -/* this is an association/status-word pair found in control packet reponses */ +/* this is an association/status-word pair found in control packet responses */ typedef struct { uint16_t assoc; uint16_t status; @@ -575,7 +575,7 @@ double jitter_request(int *status){ } } } - if(verbose) printf("%d candiate peers available\n", num_candidates); + if(verbose) printf("%d candidate peers available\n", num_candidates); if(verbose && syncsource_found) printf("synchronization source found\n"); if(! syncsource_found){ *status = STATE_UNKNOWN; @@ -597,7 +597,7 @@ double jitter_request(int *status){ /* By spec, putting the variable name "jitter" in the request * should cause the server to provide _only_ the jitter value. * thus reducing net traffic, guaranteeing us only a single - * datagram in reply, and making intepretation much simpler + * datagram in reply, and making interpretation much simpler */ /* Older servers doesn't know what jitter is, so if we get an * error on the first pass we redo it with "dispersion" */ diff --git a/plugins/check_ntp_peer.c b/plugins/check_ntp_peer.c index 6842842f..eafafdc0 100644 --- a/plugins/check_ntp_peer.c +++ b/plugins/check_ntp_peer.c @@ -86,7 +86,7 @@ typedef struct { /* NB: not necessarily NULL terminated! */ } ntp_control_message; -/* this is an association/status-word pair found in control packet reponses */ +/* this is an association/status-word pair found in control packet responses */ typedef struct { uint16_t assoc; uint16_t status; @@ -189,7 +189,7 @@ setup_control_request(ntp_control_message *p, uint8_t opcode, uint16_t seq){ } /* This function does all the actual work; roughly here's what it does - * beside setting the offest, jitter and stratum passed as argument: + * beside setting the offset, jitter and stratum passed as argument: * - offset can be negative, so if it cannot get the offset, offset_result * is set to UNKNOWN, otherwise OK. * - jitter and stratum are set to -1 if they cannot be retrieved so any @@ -306,7 +306,7 @@ int ntp_request(const char *host, double *offset, int *offset_result, double *ji /* Putting the wanted variable names in the request * cause the server to provide _only_ the requested values. * thus reducing net traffic, guaranteeing us only a single - * datagram in reply, and making intepretation much simpler + * datagram in reply, and making interpretation much simpler */ /* Older servers doesn't know what jitter is, so if we get an * error on the first pass we redo it with "dispersion" */ @@ -585,7 +585,7 @@ int main(int argc, char *argv[]){ /* set socket timeout */ alarm (socket_timeout); - /* This returns either OK or WARNING (See comment preceeding ntp_request) */ + /* This returns either OK or WARNING (See comment proceeding ntp_request) */ result = ntp_request(server_address, &offset, &offset_result, &jitter, &stratum, &num_truechimers); if(offset_result == STATE_UNKNOWN) { diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c index 391b2df2..46cc604f 100644 --- a/plugins/check_ntp_time.c +++ b/plugins/check_ntp_time.c @@ -81,7 +81,7 @@ typedef struct { /* this structure holds data about results from querying offset from a peer */ typedef struct { time_t waiting; /* ts set when we started waiting for a response */ - int num_responses; /* number of successfully recieved responses */ + int num_responses; /* number of successfully received responses */ uint8_t stratum; /* copied verbatim from the ntp_message */ double rtdelay; /* converted from the ntp_message */ double rtdisp; /* converted from the ntp_message */ diff --git a/plugins/check_procs.c b/plugins/check_procs.c index d672dd44..c17c6996 100644 --- a/plugins/check_procs.c +++ b/plugins/check_procs.c @@ -273,7 +273,7 @@ main (int argc, char **argv) } } - /* filter kernel threads (childs of KTHREAD_PARENT)*/ + /* filter kernel threads (children of KTHREAD_PARENT)*/ /* TODO adapt for other OSes than GNU/Linux sorry for not doing that, but I've no other OSes to test :-( */ if (kthread_filter == 1) { @@ -787,7 +787,7 @@ print_help (void) printf (" %s\n", "-C, --command=COMMAND"); printf (" %s\n", _("Only scan for exact matches of COMMAND (without path).")); printf (" %s\n", "-X, --exclude-process"); - printf (" %s\n", _("Exclude processes which match this comma seperated list")); + printf (" %s\n", _("Exclude processes which match this comma separated list")); printf (" %s\n", "-k, --no-kthreads"); printf (" %s\n", _("Only scan for non kernel threads (works on Linux only).")); diff --git a/plugins/check_real.c b/plugins/check_real.c index 0f1a1ba7..fbdb70f3 100644 --- a/plugins/check_real.c +++ b/plugins/check_real.c @@ -178,7 +178,7 @@ main (int argc, char **argv) /* watch for the REAL connection string */ result = recv (sd, buffer, MAX_INPUT_BUFFER - 1, 0); - buffer[result] = '\0'; /* null terminate recieved buffer */ + buffer[result] = '\0'; /* null terminate received buffer */ /* return a CRITICAL status if we couldn't read any data */ if (result == -1) { @@ -436,7 +436,7 @@ print_help (void) printf ("\n"); printf ("%s\n", _("This plugin will attempt to open an RTSP connection with the host.")); - printf ("%s\n", _("Successul connects return STATE_OK, refusals and timeouts return")); + printf ("%s\n", _("Successful connects return STATE_OK, refusals and timeouts return")); printf ("%s\n", _("STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful connects,")); printf ("%s\n", _("but incorrect response messages from the host result in STATE_WARNING return")); printf ("%s\n", _("values.")); diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index c1e92dff..eaa7eeba 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c @@ -844,7 +844,7 @@ print_help (void) printf (UT_VERBOSE); printf("\n"); - printf ("%s\n", _("Successul connects return STATE_OK, refusals and timeouts return")); + printf ("%s\n", _("Successful connects return STATE_OK, refusals and timeouts return")); printf ("%s\n", _("STATE_CRITICAL, other errors return STATE_UNKNOWN. Successful")); printf ("%s\n", _("connects, but incorrect response messages from the host result in")); printf ("%s\n", _("STATE_WARNING return values.")); diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index aefda3d2..c425df3c 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -1274,7 +1274,7 @@ print_help (void) printf (" %s\n", "--rate-multiplier"); printf (" %s\n", _("Converts rate per second. For example, set to 60 to convert to per minute")); printf (" %s\n", "--offset=OFFSET"); - printf (" %s\n", _("Add/substract the specified OFFSET to numeric sensor data")); + printf (" %s\n", _("Add/subtract the specified OFFSET to numeric sensor data")); /* Tests Against Strings */ printf (" %s\n", "-s, --string=STRING"); diff --git a/plugins/check_swap.c b/plugins/check_swap.c index 25d5f21d..05f19ad4 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c @@ -552,7 +552,7 @@ validate_arguments (void) } else if ((warn.is_percentage == crit.is_percentage) && (warn.value < crit.value)) { /* This is NOT triggered if warn and crit are different units, e.g warn is percentage - * and crit is absolut. We cannot determine the condition at this point since we + * and crit is absolute. We cannot determine the condition at this point since we * dont know the value of total swap yet */ usage4(_("Warning should be more than critical")); diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index 1365b9cb..1d307cf3 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c @@ -128,7 +128,7 @@ main (int argc, char **argv) SERVICE[i] = toupper(SERVICE[i]); } - /* set up a resonable buffer at first (will be realloc()'ed if + /* set up a reasonable buffer at first (will be realloc()'ed if * user specifies other options) */ server_expect = calloc(sizeof(char *), 2); diff --git a/plugins/check_ups.c b/plugins/check_ups.c index 0de37a20..12bce217 100644 --- a/plugins/check_ups.c +++ b/plugins/check_ups.c @@ -507,7 +507,7 @@ process_arguments (int argc, char **argv) usage2 (_("Invalid hostname/address"), optarg); } break; - case 'T': /* FIXME: to be improved (ie "-T C" for Celsius or "-T F" for Farenheit) */ + case 'T': /* FIXME: to be improved (ie "-T C" for Celsius or "-T F" for Fahrenheit) */ temp_output_c = 1; break; case 'u': /* ups name */ diff --git a/plugins/picohttpparser/picohttpparser.c b/plugins/picohttpparser/picohttpparser.c index d9680b79..d0bfac62 100644 --- a/plugins/picohttpparser/picohttpparser.c +++ b/plugins/picohttpparser/picohttpparser.c @@ -400,7 +400,7 @@ int phr_parse_request(const char *buf_start, size_t len, const char **method, si *num_headers = 0; /* if last_len != 0, check if the request is complete (a fast countermeasure - againt slowloris */ + against slowloris */ if (last_len != 0 && is_complete(buf, buf_end, last_len, &r) == NULL) { return r; } @@ -435,7 +435,7 @@ static const char *parse_response(const char *buf, const char *buf_end, int *maj } PARSE_INT_3(status); - /* get message includig preceding space */ + /* get message including preceding space */ if ((buf = get_token_to_eol(buf, buf_end, msg, msg_len, ret)) == NULL) { return NULL; } diff --git a/plugins/popen.c b/plugins/popen.c index 9eb49b62..723817d5 100644 --- a/plugins/popen.c +++ b/plugins/popen.c @@ -14,7 +14,7 @@ * FILE * spopen(const char *); * int spclose(FILE *); * -* Code taken with liitle modification from "Advanced Programming for the Unix +* Code taken with little modification from "Advanced Programming for the Unix * Environment" by W. Richard Stevens * * This is considered safe in that no shell is spawned, and the environment diff --git a/plugins/runcmd.c b/plugins/runcmd.c index a7155d27..1bd2ca1f 100644 --- a/plugins/runcmd.c +++ b/plugins/runcmd.c @@ -203,7 +203,7 @@ np_runcmd_open(const char *cmdstring, int *pfd, int *pfderr) } /* parent picks up execution here */ - /* close childs descriptors in our address space */ + /* close children descriptors in our address space */ close(pfd[1]); close(pfderr[1]); diff --git a/plugins/t/check_by_ssh.t b/plugins/t/check_by_ssh.t index 1d2939e9..b6479f1f 100644 --- a/plugins/t/check_by_ssh.t +++ b/plugins/t/check_by_ssh.t @@ -19,19 +19,19 @@ plan skip_all => "SSH_HOST and SSH_IDENTITY must be defined" unless ($ssh_servic plan tests => 42; # Some random check strings/response -my @responce = ('OK: Everything is fine', +my @response = ('OK: Everything is fine', 'WARNING: Hey, pick me, pick me', 'CRITICAL: Shit happens', 'UNKNOWN: What can I do for ya', 'WOOPS: What did I smoke', ); -my @responce_re; +my @response_re; my @check; -for (@responce) { +for (@response) { push(@check, "echo $_"); my $re_str = $_; $re_str =~ s{(.)} { "\Q$1" }ge; - push(@responce_re, $re_str); + push(@response_re, $re_str); } my $result; @@ -47,7 +47,7 @@ for (my $i=0; $i<4; $i++) { "./check_by_ssh -i $ssh_key -H $ssh_service -C '$check[$i]; exit $i'" ); cmp_ok($result->return_code, '==', $i, "Exit with return code $i"); - is($result->output, $responce[$i], "Status text is correct for check $i"); + is($result->output, $response[$i], "Status text is correct for check $i"); } $result = NPTest->testCmd( @@ -84,7 +84,7 @@ $result = NPTest->testCmd( "./check_by_ssh -i $ssh_key -H $ssh_service -C '$check[4]; exit 8'" ); cmp_ok($result->return_code, '==', 8, "Exit with return code 8 (out of bounds)"); -is($result->output, $responce[4], "Return proper status text even with unknown status codes"); +is($result->output, $response[4], "Return proper status text even with unknown status codes"); $result = NPTest->testCmd( "./check_by_ssh -i $ssh_key -H $ssh_service -F $ssh_conf -C 'exit 0'" @@ -108,7 +108,7 @@ my %linemap = ( foreach my $line (0, 2, 4, 6) { my $code = $linemap{$line}; my $statline = $line+1; - is($lines[$line], "$responce[$code]", "multiple checks status text is correct for line $line"); + is($lines[$line], "$response[$code]", "multiple checks status text is correct for line $line"); is($lines[$statline], "STATUS CODE: $code", "multiple check status code is correct for line $line"); } @@ -124,7 +124,7 @@ close(PASV) or die("Unable to close '/tmp/check_by_ssh.$$': $!"); cmp_ok(scalar(@pasv), '==', 1, 'One passive result for one check performed'); for (0) { if ($pasv[$_]) { - like($pasv[$_], '/^\[\d+\] PROCESS_SERVICE_CHECK_RESULT;flint;serv;2;' . $responce_re[2] . '$/', 'proper result for passive check'); + like($pasv[$_], '/^\[\d+\] PROCESS_SERVICE_CHECK_RESULT;flint;serv;2;' . $response_re[2] . '$/', 'proper result for passive check'); } else { fail('proper result for passive check'); } @@ -144,7 +144,7 @@ for (0, 1, 2, 3, 4) { if ($pasv[$_]) { my $ret = $_; $ret = 9 if ($_ == 4); - like($pasv[$_], '/^\[\d+\] PROCESS_SERVICE_CHECK_RESULT;flint;c' . $_ . ';' . $ret . ';' . $responce_re[$_] . '$/', "proper result for passive check $_"); + like($pasv[$_], '/^\[\d+\] PROCESS_SERVICE_CHECK_RESULT;flint;c' . $_ . ';' . $ret . ';' . $response_re[$_] . '$/', "proper result for passive check $_"); } else { fail("proper result for passive check $_"); } diff --git a/plugins/t/check_disk.t b/plugins/t/check_disk.t index c8f08f51..ca035ce7 100644 --- a/plugins/t/check_disk.t +++ b/plugins/t/check_disk.t @@ -326,19 +326,19 @@ cmp_ok( $result->return_code, '==', 0, "grouping: exit ok if the sum of free meg $result = NPTest->testCmd( "./check_disk -w ". ($free_mb_on_all - 1) ." -c ". ($free_mb_on_all - 1) ." -p $mountpoint_valid -g group -p $mountpoint2_valid" ); cmp_ok( $result->return_code, '==', 3, "Invalid options: -p must come after groupname"); -# regex: exit unknown if given regex is not compileable +# regex: exit unknown if given regex is not compilable $result = NPTest->testCmd( "./check_disk -w 1 -c 1 -r '('" ); -cmp_ok( $result->return_code, '==', 3, "Exit UNKNOWN if regex is not compileable"); +cmp_ok( $result->return_code, '==', 3, "Exit UNKNOWN if regex is not compilable"); -# ignore: exit unknown, if all pathes are deselected using -i +# ignore: exit unknown, if all paths are deselected using -i $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -i '$mountpoint_valid' -i '$mountpoint2_valid'" ); cmp_ok( $result->return_code, '==', 3, "ignore-ereg: Unknown if all fs are ignored (case sensitive)"); -# ignore: exit unknown, if all pathes are deselected using -I +# ignore: exit unknown, if all paths are deselected using -I $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -I '".uc($mountpoint_valid)."' -I '".uc($mountpoint2_valid)."'" ); cmp_ok( $result->return_code, '==', 3, "ignore-ereg: Unknown if all fs are ignored (case insensitive)"); -# ignore: exit unknown, if all pathes are deselected using -i +# ignore: exit unknown, if all paths are deselected using -i $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -i '.*'" ); cmp_ok( $result->return_code, '==', 3, "ignore-ereg: Unknown if all fs are ignored using -i '.*'"); @@ -347,7 +347,7 @@ $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mo like( $result->output, qr/$mountpoint_valid/, "output data does have $mountpoint_valid in it"); unlike( $result->output, qr/$mountpoint2_valid/, "output data does not have $mountpoint2_valid in it"); -# ignore: test if all pathes are listed when ignore regex doesn't match +# ignore: test if all paths are listed when ignore regex doesn't match $result = NPTest->testCmd( "./check_disk -w 0% -c 0% -p $mountpoint_valid -p $mountpoint2_valid -i '^barbazJodsf\$'"); like( $result->output, qr/$mountpoint_valid/, "ignore: output data does have $mountpoint_valid when regex doesn't match"); like( $result->output, qr/$mountpoint2_valid/,"ignore: output data does have $mountpoint2_valid when regex doesn't match"); diff --git a/plugins/t/check_http.t b/plugins/t/check_http.t index 1ca52f61..1f2fbdfd 100644 --- a/plugins/t/check_http.t +++ b/plugins/t/check_http.t @@ -178,13 +178,13 @@ SKIP: { $res = NPTest->testCmd( "./$plugin -I $host_tcp_proxy -p $port_tcp_proxy -u http://$host_tcp_http -e 200,301,302"); is( $res->return_code, 0, "Proxy HTTP works"); - like($res->output, qr/OK: Status line output matched/, "Proxy HTTP Output is sufficent"); + like($res->output, qr/OK: Status line output matched/, "Proxy HTTP Output is sufficient"); $res = NPTest->testCmd( "./$plugin -I $host_tcp_proxy -p $port_tcp_proxy -H $host_tls_http -S -j CONNECT"); is( $res->return_code, 0, "Proxy HTTP CONNECT works"); - like($res->output, qr/HTTP OK:/, "Proxy HTTP CONNECT output sufficent"); + like($res->output, qr/HTTP OK:/, "Proxy HTTP CONNECT output sufficient"); $res = NPTest->testCmd( "./$plugin -I $host_tcp_proxy -p $port_tcp_proxy -H $host_tls_http -S -j CONNECT:HEAD"); is( $res->return_code, 0, "Proxy HTTP CONNECT works with override method"); - like($res->output, qr/HTTP OK:/, "Proxy HTTP CONNECT output sufficent"); + like($res->output, qr/HTTP OK:/, "Proxy HTTP CONNECT output sufficient"); } diff --git a/plugins/t/check_mysql.t b/plugins/t/check_mysql.t index e426bf59..baf3acc6 100644 --- a/plugins/t/check_mysql.t +++ b/plugins/t/check_mysql.t @@ -5,7 +5,7 @@ # # # These are the database permissions required for this test: -# GRANT SELECT ON $db.* TO $user@$host INDENTIFIED BY '$password'; +# GRANT SELECT ON $db.* TO $user@$host IDENTIFIED BY '$password'; # GRANT SUPER, REPLICATION CLIENT ON *.* TO $user@$host; # Check with: # mysql -u$user -p$password -h$host $db @@ -23,9 +23,9 @@ plan tests => 15; my $bad_login_output = '/Access denied for user /'; my $mysqlserver = getTestParameter("NP_MYSQL_SERVER", "A MySQL Server hostname or IP with no slaves setup"); my $mysqlsocket = getTestParameter("NP_MYSQL_SOCKET", "Full path to a MySQL Server socket with no slaves setup"); -my $mysql_login_details = getTestParameter("NP_MYSQL_LOGIN_DETAILS", "Command line parameters to specify login access (requires REPLICATION CLIENT privleges)", "-u test -ptest"); +my $mysql_login_details = getTestParameter("NP_MYSQL_LOGIN_DETAILS", "Command line parameters to specify login access (requires REPLICATION CLIENT privileges)", "-u test -ptest"); my $with_slave = getTestParameter("NP_MYSQL_WITH_SLAVE", "MySQL server with slaves setup"); -my $with_slave_login = getTestParameter("NP_MYSQL_WITH_SLAVE_LOGIN", "Login details for server with slave (requires REPLICATION CLIENT privleges)", $mysql_login_details || "-u test -ptest"); +my $with_slave_login = getTestParameter("NP_MYSQL_WITH_SLAVE_LOGIN", "Login details for server with slave (requires REPLICATION CLIENT privileges)", $mysql_login_details || "-u test -ptest"); my $result; diff --git a/plugins/t/check_mysql_query.t b/plugins/t/check_mysql_query.t index 96899ac6..c30245b2 100644 --- a/plugins/t/check_mysql_query.t +++ b/plugins/t/check_mysql_query.t @@ -31,7 +31,7 @@ $result = NPTest->testCmd("./check_mysql_query -q 'SELECT 1+1' -H $mysqlserver $ cmp_ok( $result->return_code, '==', 0, "Can run query"); $result = NPTest->testCmd("./check_mysql_query -H $mysqlserver $mysql_login_details"); -cmp_ok( $result->return_code, '==', 3, "Missing query parmeter"); +cmp_ok( $result->return_code, '==', 3, "Missing query parameter"); like( $result->output, "/Must specify a SQL query to run/", "Missing query error message"); $result = NPTest->testCmd("./check_mysql_query -q 'SELECT 1+1' -H $mysqlserver -u dummy -d mysql"); diff --git a/plugins/t/check_nagios.t b/plugins/t/check_nagios.t index 81fc24d8..f38f5e9c 100644 --- a/plugins/t/check_nagios.t +++ b/plugins/t/check_nagios.t @@ -36,7 +36,7 @@ cmp_ok( $result->return_code, '==', 1, "Log over 5 minutes old" ); like ( $result->output, $warningOutput, "Output for warning correct" ); my $now = time; -# This substitution is dependant on the testcase +# This substitution is dependent on the testcase system( "perl -pe 's/1133537544/$now/' $nagios1 > $nagios1.tmp" ) == 0 or die "Problem with munging $nagios1"; $result = NPTest->testCmd( diff --git a/plugins/t/negate.t b/plugins/t/negate.t index d96a109b..5ec1c843 100644 --- a/plugins/t/negate.t +++ b/plugins/t/negate.t @@ -84,7 +84,7 @@ foreach my $current_state (keys(%state)) { foreach my $new_state (keys(%state)) { $res = NPTest->testCmd( "./negate -s --$current_state=$new_state ./check_dummy ".$state{$current_state}." 'Fake $new_state'" ); is( $res->return_code, $state{$new_state}, "Got fake $new_state (with substitute)" ); - is( $res->output, uc($new_state).": Fake $new_state", "Substitued fake $new_state output"); + is( $res->output, uc($new_state).": Fake $new_state", "Substituted fake $new_state output"); } } diff --git a/plugins/tests/check_snmp.t b/plugins/tests/check_snmp.t index bc03ec60..bfe42e16 100755 --- a/plugins/tests/check_snmp.t +++ b/plugins/tests/check_snmp.t @@ -53,7 +53,7 @@ if ($pid) { #print "child\n"; print "Please contact SNMP at: $port_snmp\n"; - close(STDERR); # Coment out to debug snmpd problems (most errors sent there are OK) + close(STDERR); # Comment out to debug snmpd problems (most errors sent there are OK) exec("snmpd -c tests/conf/snmpd.conf -C -f -r udp:$port_snmp"); } @@ -227,7 +227,7 @@ is($res->output, 'SNMP OK - "555\"I said\"" | ', "Check string with a double quo $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.15 -r 'CUSTOM CHECK OK'" ); is($res->return_code, 0, "String check should check whole string, not a parsed number" ); -is($res->output, 'SNMP OK - "CUSTOM CHECK OK: foo is 12345" | ', "String check witn numbers returns whole string"); +is($res->output, 'SNMP OK - "CUSTOM CHECK OK: foo is 12345" | ', "String check with numbers returns whole string"); $res = NPTest->testCmd( "./check_snmp -H 127.0.0.1 -C public -p $port_snmp -o .1.3.6.1.4.1.8072.3.2.67.16 -w -2: -c -3:" ); is($res->return_code, 0, "Negative integer check OK" ); diff --git a/plugins/utils.h b/plugins/utils.h index 5b54da3c..c76b3216 100644 --- a/plugins/utils.h +++ b/plugins/utils.h @@ -7,7 +7,7 @@ /* The purpose of this package is to provide safer alternatives to C functions that might otherwise be vulnerable to hacking. This currently includes a standard suite of validation routines to be sure -that an string argument acually converts to its intended type and a +that an string argument actually converts to its intended type and a suite of string handling routine that do their own memory management in order to resist overflow attacks. In addition, a few functions are provided to standardize version and error reporting across the entire diff --git a/po/de.po b/po/de.po index c29cbbba..eee62451 100644 --- a/po/de.po +++ b/po/de.po @@ -936,12 +936,12 @@ msgstr "" #: plugins/check_fping.c:422 #, c-format msgid "%s: Only one threshold may be packet loss (%s)\n" -msgstr "%s: Nur ein Wert darf für paket loss angegeben werden (%s)\n" +msgstr "%s: Nur ein Wert darf für packet loss angegeben werden (%s)\n" #: plugins/check_fping.c:426 #, c-format msgid "%s: Only one threshold must be packet loss (%s)\n" -msgstr "%s: Nur ein Wert darf für paket loss angegeben werden (%s)\n" +msgstr "%s: Nur ein Wert darf für packet loss angegeben werden (%s)\n" #: plugins/check_fping.c:458 msgid "" @@ -4299,7 +4299,7 @@ msgid "This plugin will attempt to open an RTSP connection with the host." msgstr "Dieses plugin testet Gameserververbindungen zum angegebenen Host." #: plugins/check_real.c:438 plugins/check_smtp.c:830 -msgid "Successul connects return STATE_OK, refusals and timeouts return" +msgid "Successful connects return STATE_OK, refusals and timeouts return" msgstr "" #: plugins/check_real.c:439 @@ -4721,7 +4721,7 @@ msgid "" msgstr "" #: plugins/check_snmp.c:1143 -msgid "Add/substract the specified OFFSET to numeric sensor data" +msgid "Add/subtract the specified OFFSET to numeric sensor data" msgstr "" #: plugins/check_snmp.c:1147 @@ -4943,7 +4943,7 @@ msgid "" msgstr "" #: plugins/check_swap.c:541 -msgid "Exit with CRITCAL status if less than PERCENT of swap space is free" +msgid "Exit with CRITICAL status if less than PERCENT of swap space is free" msgstr "" #: plugins/check_swap.c:543 @@ -6372,7 +6372,7 @@ msgstr "" #~ " Exit with CRITICAL status if less than INTEGER --units of disk are " #~ "free\n" #~ " -c, --critical=PERCENT%%\n" -#~ " Exit with CRITCAL status if less than PERCENT of disk space is free\n" +#~ " Exit with CRITICAL status if less than PERCENT of disk space is free\n" #~ " -C, --clear\n" #~ " Clear thresholds\n" #~ msgstr "" diff --git a/po/fr.po b/po/fr.po index b4de17ed..fe740366 100644 --- a/po/fr.po +++ b/po/fr.po @@ -4372,7 +4372,7 @@ msgid "This plugin will attempt to open an RTSP connection with the host." msgstr "Ce plugin va essayer d'ouvrir un connexion RTSP avec l'hôte." #: plugins/check_real.c:438 plugins/check_smtp.c:830 -msgid "Successul connects return STATE_OK, refusals and timeouts return" +msgid "Successful connects return STATE_OK, refusals and timeouts return" msgstr "" #: plugins/check_real.c:439 @@ -4784,7 +4784,7 @@ msgid "" msgstr "" #: plugins/check_snmp.c:1143 -msgid "Add/substract the specified OFFSET to numeric sensor data" +msgid "Add/subtract the specified OFFSET to numeric sensor data" msgstr "" #: plugins/check_snmp.c:1147 @@ -5021,7 +5021,7 @@ msgstr "" "sont libres" #: plugins/check_swap.c:541 -msgid "Exit with CRITCAL status if less than PERCENT of swap space is free" +msgid "Exit with CRITICAL status if less than PERCENT of swap space is free" msgstr "" "Sortir avec un résultat CRITIQUE si moins de X pour cent de mémoire " "virtuelle est libre" diff --git a/po/monitoring-plugins.pot b/po/monitoring-plugins.pot index 45f46a89..1535db80 100644 --- a/po/monitoring-plugins.pot +++ b/po/monitoring-plugins.pot @@ -4193,7 +4193,7 @@ msgid "This plugin will attempt to open an RTSP connection with the host." msgstr "" #: plugins/check_real.c:438 plugins/check_smtp.c:830 -msgid "Successul connects return STATE_OK, refusals and timeouts return" +msgid "Successful connects return STATE_OK, refusals and timeouts return" msgstr "" #: plugins/check_real.c:439 @@ -4597,7 +4597,7 @@ msgid "" msgstr "" #: plugins/check_snmp.c:1143 -msgid "Add/substract the specified OFFSET to numeric sensor data" +msgid "Add/subtract the specified OFFSET to numeric sensor data" msgstr "" #: plugins/check_snmp.c:1147 @@ -4817,7 +4817,7 @@ msgid "" msgstr "" #: plugins/check_swap.c:541 -msgid "Exit with CRITCAL status if less than PERCENT of swap space is free" +msgid "Exit with CRITICAL status if less than PERCENT of swap space is free" msgstr "" #: plugins/check_swap.c:543 diff --git a/tap/tap.3 b/tap/tap.3 index 4b23c24a..dce85fcd 100644 --- a/tap/tap.3 +++ b/tap/tap.3 @@ -291,7 +291,7 @@ always returns 0. .Xc .El .Pp -For maximum compatability your test program should return a particular +For maximum compatibility your test program should return a particular exit code. This is calculated by .Fn exit_status so it is sufficient to always return from @@ -309,7 +309,7 @@ directory in the source distribution contains numerous tests of functionality, written using .Nm . Examine them for examples of how to construct test suites. -.Sh COMPATABILITY +.Sh COMPATIBILITY .Nm strives to be compatible with the Perl Test::More and Test::Harness modules. The test suite verifies that diff --git a/tap/tap.h b/tap/tap.h index bd817893..8ee525c8 100644 --- a/tap/tap.h +++ b/tap/tap.h @@ -25,7 +25,7 @@ */ /* '## __VA_ARGS__' is a gcc'ism. C99 doesn't allow the token pasting - and requires the caller to add the final comma if they've ommitted + and requires the caller to add the final comma if they've omitted the optional arguments */ #ifdef __GNUC__ # define ok(e, test, ...) ((e) ? \ diff --git a/tools/build_perl_modules b/tools/build_perl_modules index 5a57a471..b8cd34c3 100755 --- a/tools/build_perl_modules +++ b/tools/build_perl_modules @@ -140,7 +140,7 @@ my $libs = "$destdir/$prefix/lib:$destdir/$prefix/lib/$Config{archname}"; my $topdir = cwd(); -# set an initial value if there isnt one already +# set an initial value if there isn't one already # Need to use PERL5LIB to ensure we get pre-installed mods from earlier # tags in the install_order file $ENV{PERL5LIB} ||= q{}; @@ -149,8 +149,8 @@ $ENV{PERL5LIB} ||= q{}; $ENV{PERL_AUTOINSTALL} = "--skipdeps"; # keep a record of how many times a module build is done. This is so they may -# be built a second time to include optional prereq's that couldnt -# previously be built due to circular dependancies +# be built a second time to include optional prereq's that couldn't +# previously be built due to circular dependencies my %built_modules; foreach my $tarball (@tarballs) { ( my $dir = $tarball ) =~ s/\.(?:tgz|tar.gz)$//; diff --git a/tools/p1.pl b/tools/p1.pl index 2788dbff..9cbe6dc0 100644 --- a/tools/p1.pl +++ b/tools/p1.pl @@ -2,7 +2,7 @@ # # Hacked version of the sample code from the perlembedded doco. # -# Only major changes are to separate the compiling and cacheing from +# Only major changes are to separate the compiling and caching from # the execution so that the cache can be kept in "non-volatile" parent # process while the execution is done from "volatile" child processes # and that STDOUT is redirected to a file by means of a tied filehandle diff --git a/tools/tinderbox_build b/tools/tinderbox_build index 48836b1e..1a41f577 100755 --- a/tools/tinderbox_build +++ b/tools/tinderbox_build @@ -138,7 +138,7 @@ sub BuildIt { # interprets that as the end of the mail, and truncates the log before # it gets to Tinderbox. (terry weismann, chris yeh) # -# This was replaced by a perl 'port' of the above, writen by +# This was replaced by a perl 'port' of the above, written by # preed@netscape.com; good things: no need for system() call, and now it's # all in perl, so we don't have to do OS checking like before. -- cgit v1.2.3-74-g34f1 From 6c78f0b5ea82a4bea71ae2024f27d3916175a7a2 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 12 Mar 2023 14:16:35 +0100 Subject: Fixes for -Wunused * lib/utils_base.c * plugins/check_curl.c * plugins-root/check_dhcp.c Removed a line which theoretically can not do anything, but there was comment which indicated something else. Still trying this though. --- lib/utils_base.c | 8 ++++---- plugins-root/check_dhcp.c | 4 ---- plugins/check_curl.c | 5 ++--- 3 files changed, 6 insertions(+), 11 deletions(-) (limited to 'plugins-root') diff --git a/lib/utils_base.c b/lib/utils_base.c index eb1823bb..c458cf61 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c @@ -24,7 +24,7 @@ * *****************************************************************************/ -#include "common.h" +#include "../plugins/common.h" #include #include "utils_base.h" #include @@ -319,18 +319,18 @@ char *np_extract_value(const char *varlist, const char *name, char sep) { while (1) { /* Strip any leading space */ - for (varlist; isspace(varlist[0]); varlist++); + for (; isspace(varlist[0]); varlist++); if (strncmp(name, varlist, strlen(name)) == 0) { varlist += strlen(name); /* strip trailing spaces */ - for (varlist; isspace(varlist[0]); varlist++); + for (; isspace(varlist[0]); varlist++); if (varlist[0] == '=') { /* We matched the key, go past the = sign */ varlist++; /* strip leading spaces */ - for (varlist; isspace(varlist[0]); varlist++); + for (; isspace(varlist[0]); varlist++); if (tmp = index(varlist, sep)) { /* Value is delimited by a comma */ diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c index ad673237..147db6b3 100644 --- a/plugins-root/check_dhcp.c +++ b/plugins-root/check_dhcp.c @@ -470,10 +470,6 @@ int send_dhcp_discover(int sock){ packet_xid=random(); discover_packet.xid=htonl(packet_xid); - /**** WHAT THE HECK IS UP WITH THIS?!? IF I DON'T MAKE THIS CALL, ONLY ONE SERVER RESPONSE IS PROCESSED!!!! ****/ - /* downright bizzarre... */ - ntohl(discover_packet.xid); - /*discover_packet.secs=htons(65535);*/ discover_packet.secs=0xFF; diff --git a/plugins/check_curl.c b/plugins/check_curl.c index be5740d7..100a97aa 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c @@ -2217,11 +2217,10 @@ curlhelp_parse_statusline (const char *buf, curlhelp_statusline *status_line) if( strchr( p, '.' ) != NULL ) { /* HTTP 1.x case */ - char *ppp; - ppp = strtok( p, "." ); + strtok( p, "." ); status_line->http_major = (int)strtol( p, &pp, 10 ); if( *pp != '\0' ) { free( first_line_buf ); return -1; } - ppp = strtok( NULL, " " ); + strtok( NULL, " " ); status_line->http_minor = (int)strtol( p, &pp, 10 ); if( *pp != '\0' ) { free( first_line_buf ); return -1; } p += 4; /* 1.x SP */ -- cgit v1.2.3-74-g34f1 From 907b933a87ae21ad776c53a2dd7f04beb220b6bf Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 12 Mar 2023 20:12:37 +0100 Subject: Fixes for -Wunused-parameters --- plugins-root/check_dhcp.c | 12 ++++++------ plugins-root/check_icmp.c | 4 ++++ plugins/check_curl.c | 9 ++++++--- plugins/check_ntp_peer.c | 6 +++--- plugins/check_ups.c | 14 +++++++------- 5 files changed, 26 insertions(+), 19 deletions(-) (limited to 'plugins-root') diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c index ad673237..2d742349 100644 --- a/plugins-root/check_dhcp.c +++ b/plugins-root/check_dhcp.c @@ -229,7 +229,7 @@ struct in_addr requested_address; int process_arguments(int, char **); int call_getopt(int, char **); -int validate_arguments(int, int); +int validate_arguments(int); void print_usage(void); void print_help(void); @@ -1059,8 +1059,8 @@ int process_arguments(int argc, char **argv){ return ERROR; arg_index = call_getopt(argc,argv); - return validate_arguments(argc,arg_index); - } + return validate_arguments(argc); +} @@ -1158,13 +1158,13 @@ int call_getopt(int argc, char **argv){ } -int validate_arguments(int argc, int arg_index){ +int validate_arguments(int argc){ - if(argc-optind > 0) + if(argc - optind > 0) usage(_("Got unexpected non-option argument")); return OK; - } +} #if defined(__sun__) || defined(__solaris__) || defined(__hpux__) diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 9ceb35b2..edfd6949 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -1436,11 +1436,15 @@ get_ip_address(const char *ifname) struct ifreq ifr; strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name) - 1); + ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0'; + if(ioctl(icmp_sock, SIOCGIFADDR, &ifr) == -1) crash("Cannot determine IP address of interface %s", ifname); + memcpy(&ip, &ifr.ifr_addr, sizeof(ip)); #else + (void) ifname; errno = 0; crash("Cannot get interface IP address on this platform."); #endif diff --git a/plugins/check_curl.c b/plugins/check_curl.c index b7137145..41c25d9c 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c @@ -244,7 +244,7 @@ void curlhelp_freewritebuffer (curlhelp_write_curlbuf*); int curlhelp_initreadbuffer (curlhelp_read_curlbuf *, const char *, size_t); int curlhelp_buffer_read_callback (void *, size_t , size_t , void *); void curlhelp_freereadbuffer (curlhelp_read_curlbuf *); -curlhelp_ssl_library curlhelp_get_ssl_library (CURL*); +curlhelp_ssl_library curlhelp_get_ssl_library (); const char* curlhelp_get_ssl_library_string (curlhelp_ssl_library); int net_noopenssl_check_certificate (cert_ptr_union*, int, int); @@ -297,6 +297,7 @@ main (int argc, char **argv) int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx) { + (void) preverify_ok; /* TODO: we get all certificates of the chain, so which ones * should we test? * TODO: is the last certificate always the server certificate? @@ -321,6 +322,8 @@ int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx) CURLcode sslctxfun(CURL *curl, SSL_CTX *sslctx, void *parm) { + (void) curl; // ignore unused parameter + (void) parm; // ignore unused parameter SSL_CTX_set_verify(sslctx, SSL_VERIFY_PEER, verify_callback); return CURLE_OK; @@ -646,7 +649,7 @@ check_http (void) } /* detect SSL library used by libcurl */ - ssl_library = curlhelp_get_ssl_library (curl); + ssl_library = curlhelp_get_ssl_library (); /* try hard to get a stack of certificates to verify against */ if (check_cert) { @@ -2381,7 +2384,7 @@ get_content_length (const curlhelp_write_curlbuf* header_buf, const curlhelp_wri /* TODO: is there a better way in libcurl to check for the SSL library? */ curlhelp_ssl_library -curlhelp_get_ssl_library (CURL* curl) +curlhelp_get_ssl_library () { curl_version_info_data* version_data; char *ssl_version; diff --git a/plugins/check_ntp_peer.c b/plugins/check_ntp_peer.c index eafafdc0..161b4950 100644 --- a/plugins/check_ntp_peer.c +++ b/plugins/check_ntp_peer.c @@ -199,7 +199,7 @@ setup_control_request(ntp_control_message *p, uint8_t opcode, uint16_t seq){ * status is pretty much useless as syncsource_found is a global variable * used later in main to check is the server was synchronized. It works * so I left it alone */ -int ntp_request(const char *host, double *offset, int *offset_result, double *jitter, int *stratum, int *num_truechimers){ +int ntp_request(double *offset, int *offset_result, double *jitter, int *stratum, int *num_truechimers){ int conn=-1, i, npeers=0, num_candidates=0; double tmp_offset = 0; int min_peer_sel=PEER_INCLUDED; @@ -585,8 +585,8 @@ int main(int argc, char *argv[]){ /* set socket timeout */ alarm (socket_timeout); - /* This returns either OK or WARNING (See comment proceeding ntp_request) */ - result = ntp_request(server_address, &offset, &offset_result, &jitter, &stratum, &num_truechimers); + /* This returns either OK or WARNING (See comment preceeding ntp_request) */ + result = ntp_request(&offset, &offset_result, &jitter, &stratum, &num_truechimers); if(offset_result == STATE_UNKNOWN) { /* if there's no sync peer (this overrides ntp_request output): */ diff --git a/plugins/check_ups.c b/plugins/check_ups.c index 12bce217..68737c4b 100644 --- a/plugins/check_ups.c +++ b/plugins/check_ups.c @@ -89,7 +89,7 @@ char *ups_status; int temp_output_c = 0; int determine_status (void); -int get_ups_variable (const char *, char *, size_t); +int get_ups_variable (const char *, char *); int process_arguments (int, char **); int validate_arguments (void); @@ -189,7 +189,7 @@ main (int argc, char **argv) } /* get the ups utility voltage if possible */ - res=get_ups_variable ("input.voltage", temp_buffer, sizeof (temp_buffer)); + res=get_ups_variable ("input.voltage", temp_buffer); if (res == NOSUCHVAR) supported_options &= ~UPS_UTILITY; else if (res != OK) return STATE_CRITICAL; @@ -224,7 +224,7 @@ main (int argc, char **argv) } /* get the ups battery percent if possible */ - res=get_ups_variable ("battery.charge", temp_buffer, sizeof (temp_buffer)); + res=get_ups_variable ("battery.charge", temp_buffer); if (res == NOSUCHVAR) supported_options &= ~UPS_BATTPCT; else if ( res != OK) return STATE_CRITICAL; @@ -253,7 +253,7 @@ main (int argc, char **argv) } /* get the ups load percent if possible */ - res=get_ups_variable ("ups.load", temp_buffer, sizeof (temp_buffer)); + res=get_ups_variable ("ups.load", temp_buffer); if ( res == NOSUCHVAR ) supported_options &= ~UPS_LOADPCT; else if ( res != OK) return STATE_CRITICAL; @@ -282,7 +282,7 @@ main (int argc, char **argv) } /* get the ups temperature if possible */ - res=get_ups_variable ("ups.temperature", temp_buffer, sizeof (temp_buffer)); + res=get_ups_variable ("ups.temperature", temp_buffer); if ( res == NOSUCHVAR ) supported_options &= ~UPS_TEMP; else if ( res != OK) return STATE_CRITICAL; @@ -342,7 +342,7 @@ determine_status (void) char *ptr; int res; - res=get_ups_variable ("ups.status", recv_buffer, sizeof (recv_buffer)); + res=get_ups_variable ("ups.status", recv_buffer); if (res == NOSUCHVAR) return OK; if (res != STATE_OK) { printf ("%s\n", _("Invalid response received from host")); @@ -388,7 +388,7 @@ determine_status (void) /* gets a variable value for a specific UPS */ int -get_ups_variable (const char *varname, char *buf, size_t buflen) +get_ups_variable (const char *varname, char *buf) { /* char command[MAX_INPUT_BUFFER]; */ char temp_buffer[MAX_INPUT_BUFFER]; -- cgit v1.2.3-74-g34f1 From ab62b2ce5da5adbbfcbb63922b06695a7b94e997 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 12 Mar 2023 19:31:45 +0100 Subject: Fixes for -Wuninitialized --- plugins-root/check_icmp.c | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins-root') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index edfd6949..f96207be 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -1432,6 +1432,7 @@ get_ip_address(const char *ifname) { // TODO: Rewrite this so the function return an error and we exit somewhere else struct sockaddr_in ip; + ip.sin_addr.s_addr = 0; // Fake inititialization to make compiler happy #if defined(SIOCGIFADDR) struct ifreq ifr; -- cgit v1.2.3-74-g34f1 From cb5579793731e3320330551bb2f926be7c7d0378 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 18 Apr 2023 00:42:20 +0200 Subject: Refix spelling issues --- plugins-root/check_icmp.c | 2 +- plugins/check_ntp_peer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins-root') diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index f96207be..1d47e9fc 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -1432,7 +1432,7 @@ get_ip_address(const char *ifname) { // TODO: Rewrite this so the function return an error and we exit somewhere else struct sockaddr_in ip; - ip.sin_addr.s_addr = 0; // Fake inititialization to make compiler happy + ip.sin_addr.s_addr = 0; // Fake initialization to make compiler happy #if defined(SIOCGIFADDR) struct ifreq ifr; diff --git a/plugins/check_ntp_peer.c b/plugins/check_ntp_peer.c index 161b4950..49cb1008 100644 --- a/plugins/check_ntp_peer.c +++ b/plugins/check_ntp_peer.c @@ -585,7 +585,7 @@ int main(int argc, char *argv[]){ /* set socket timeout */ alarm (socket_timeout); - /* This returns either OK or WARNING (See comment preceeding ntp_request) */ + /* This returns either OK or WARNING (See comment preceding ntp_request) */ result = ntp_request(&offset, &offset_result, &jitter, &stratum, &num_truechimers); if(offset_result == STATE_UNKNOWN) { -- cgit v1.2.3-74-g34f1