aboutsummaryrefslogtreecommitdiff
path: root/plugins-root
AgeCommit message (Collapse)Author
2022-11-29check_icmp: fix parsing help/version long optionsGravatar Aksel Sjögren
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 <asjogren@itrsgroup.com>
2022-07-14Set msg_namelen to the size of the sockaddr struct for the appropriate ↵Gravatar eriksejr
address family and not sockaddr_storage (#1771) Co-authored-by: Erik Sejr <eriks@ssimicro.com> Co-authored-by: Lorenz <12514511+RincewindsHat@users.noreply.github.com>
2022-03-15check_icmp: buffer offerflow (#1733)Gravatar Lorenz
* Fix different overflows * Less includes * Add testcases * Remove unused variable * Remove unused and commented includes
2022-01-29- delay set_source_ip() until address_family is detectedGravatar ghciv6
- add a test to check '-s'
2021-11-24More wrong printf formattingGravatar RincewindsHat
2021-11-24Fix CodeQL checksGravatar RincewindsHat
2021-11-15check_icmp: Fix pkt perfdata in check_host modeGravatar Aksel Sjögren
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 <asjogren@itrsgroup.com>
2021-04-30Fix check_dhcp testsGravatar Aksel Sjögren
* try to use "/usr/sbin/ip" before "ifconfig" since the latter is obsolete on Linux to figure out interface to listen for DHCP messages. But keeping ifconfig method just in case. Without this, tests fail on boxes without ifconfig AND the correct interface named ethX. * amend possible failure responses, as check_dhcp might get a DHCPOFFER, but from an unexpected address - which happens if the box running tests are on a network with a DHCP server.
2021-04-30Add test-debug for plugins-rootGravatar Aksel Sjögren
Fixes "No rule to make target 'test-debug'" when running "make test-debug" in root dir.
2020-12-19docs: fix simple typo, conspicuosly -> conspicuouslyGravatar Tim Gates
There is a small typo in plugins-root/check_icmp.c. Should read `conspicuously` rather than `conspicuosly`.
2020-01-21Use size_t instead of int when calling sysctl(3).Gravatar Vadim Zhukov
Otherwise, it writes sizeof(size_t) bytes to &oldlen, smashing the stack.
2018-12-10check_icmp: Do not overwrite -4,-6 on lookupGravatar Jacob Hansen
In case we needed to do a lookup, we previously overwrote the address_family to IPv6, even if we supplied -4 as a cmd line argument. This commit should ensure the cmd line argument is always followed. Signed-off-by: Jacob Hansen <jhansen@op5.com>
2018-12-10check_icmp: emit error if multiple protocol versionGravatar Jacob Hansen
As we do not support checking both IPv4 and IPv6 hosts in one execution we emit an error if multiple protocol versions are defined in the cmd line args. Signed-off-by: Jacob Hansen <jhansen@op5.com>
2018-12-10check_icmp: move opts string into a variableGravatar Jacob Hansen
This commit moves the opts string into a variable as it is now used twice. Signed-off-by: Jacob Hansen <jhansen@op5.com>
2018-12-07check_icmp: Correctly set address_family on lookupGravatar Jacob Hansen
If a hostname is supplied instead of an IP address, the automatic address family detection would fail to correctly set the IP protocol version (it would always be IPv6). We now supply AF_UNSPEC to getaddrinfo, which should then return the correct address family in the result. Signed-off-by: Jacob Hansen <jhansen@op5.com>
2018-12-07check_icmp: removed outcommented codeGravatar Jacob Hansen
Signed-off-by: Jacob Hansen <jhansen@op5.com>
2018-12-07check_icmp: process protocol version args firstGravatar Jacob Hansen
Detection of protocol version is in the previous patch implemented in the add_target() function, which is called when adding the -H command line argument. That means that if a protocal version argument (-4, -6) is added after the -H then the protocol version might be incorrectly set. This patch ensures that we first process the protocol version arguments, and then we process the rest of the arguments. Signed-off-by: Jacob Hansen <jhansen@op5.com>
2018-12-07check_icmp: Automatically detect IP protocolGravatar Jacob Hansen
This patch automatically detects whether the protocol version is IPv4 or IPv6 All credits to: https://github.com/ghciv6 Signed-off-by: Jacob Hansen <jhansen@op5.com>
2018-12-07Fixed parameter handling after 01efbb2183d49c5082598d4799788fc385342f28Gravatar Lars Michelsen
2018-12-07check_icmp: Add IPv6 supportGravatar Lars Michelsen
This commit adds IPv6 capabilities to check_icmp. It is now possible to specify the address family using the arguments -4 (default) or -6. To make the change possible we had to move the argument parsing previous to creating the socket to be able to create it with the correct address family. This commit also fixes some gcc 4.9.2 compiler warnings. It has been tested with several current linux distributions (debian, ubuntu, rh, sles). This commit fixes monitoring-plugins/monitoring-plugins#1291
2017-01-10Apply another spelling fixGravatar Holger Weiss
2017-01-10Merge branch 'spell_fix'Gravatar Jan Wagner
2016-12-07properly remove MSG_PEEK in check_dhcp.c. Fixes #1450.Gravatar Harald Koch
2016-12-01Spelling fixes suggested by lintianGravatar Jan Wagner
2016-09-16check_dhcp: Make xid a bit more randomGravatar Holger Weiss
Don't just use the current time(2) to seed the PRNG that generates the xid. A DHCP server might be checked multiple times per second.
2016-09-14check_dhcp: Don't peek before reading responseGravatar Holger Weiss
Omit a recvfrom(3) call which has the MSG_PEEK flag set and should have no effect at all. According to a comment in the code, this call was meant to be a workaround to an opaque issue. If anyone runs into that issue, we should fix it properly instead.
2015-10-13Merge branch 'check_proc_1203'Gravatar Jan Wagner
(Closes #1371) (Closes #1203)
2015-10-08Merge branch 'maint'Gravatar Holger Weiss
* maint: sslutils: Remove superfluous parenthesis for sslv3 function too sslutils: remove superfluous parenthesis check_snmp: modified tests check_snmp.c: switched DEFAULT_TIMEOUT to DEFAULT_SOCKET_TIMEOUT (provided by utils.h), already used by help description, see issue #1318 install snmpd on travis tests enable libtab on travis builds add perl snmp to travis dependencies NEWS: Mention check_ups performance data fix Fix incorrect performance data thresholds check_dhcp: Fix option parsing Fixes segfaults when running via monitoring worker (off-by-one) travis: fix http test host sslutils: Check if OpenSSL supports SSLv3. Conflicts: NEWS plugins/sslutils.c
2015-10-05Fix for unclosed filehandle in pst3 on SolarisGravatar abrist
On Solaris, check_procs uses pst3 instead of /bin/ps (see http://monitoring-plugins.org/doc/faq/ps-on-solaris.html for background). There's a small bug in pst3 which causes it to NOT report some processes that are at the end of the process table, at least on very busy systems (we noticed this on a CoolThreads T5240 with load averages up to 90). The bug is that a filehandle is not properly closed. Thanks to jwinkle01 for finding and patching the bug. (Closes #1203)
2015-10-04use unknown exit code for help/version in plugins-root as wellGravatar Sven Nierlein
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2015-10-02check_dhcp: Fix option parsingGravatar Holger Weiss
The call_getopt() function didn't always return the correct number of processed arguments. However, since check_dhcp doesn't support non-option arguments, the caller doesn't need this number anyway. Closes #1345.
2015-10-02Fixes segfaults when running via monitoring workerGravatar Jan Wagner
(off-by-one) Grabed from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198318
2015-01-29make use of MSG_CONFIRM optionalGravatar Sven Nierlein
since MSG_CONFIRM is a linux thing and only available on linux kernels >= 2.3.15, see send(2)
2014-12-02check_icmp: Cast size_t values for printf(3)Gravatar Holger Weiss
Convert size_t values to unsigned long for printf(3) in order to maximize portability.
2014-11-28check_icmp: Fix a few type errorsGravatar Holger Weiss
2014-11-28Don't mix variable declarations and codeGravatar Holger Weiss
We still support pre-C99 compilers.
2014-11-28Use kernel reception time on ICMP packets to compute rtt.Gravatar Matthieu Kermagoret
This commit uses the SO_TIMESTAMP feature of setsockopt to fetch kernel reception time of ICMP packets. This avoids invalid computations of rtt on machines with heavy load and/or heavy network traffic.
2014-07-06check_icmp/check_dhcp: disable check, if we are rootGravatar Jan Wagner
As it is possible to use capabilities(7) on linux or solaris privileges for example, it is not necessary in all cases to have those binaries making use of setuid.
2014-06-28plugins-root/check_dhcp.c - array out of boundsGravatar Spenser Reinhardt
Coverity 66488 - offer_packet->options has a max size of 312. It was being used in a loop verifying less than 311, but increasing by 2 per loop, causing a possible array index out of bounds. Changed to checking less than max length - 1. - SR
2014-01-21Capitalize "Monitoring Plugins"Gravatar Holger Weiss
"Monitoring Plugins" is a name.
2014-01-20Capitalize "Monitoring" when it's the first wordGravatar Holger Weiss
2014-01-19Project rename initial commit.Gravatar Monitoring Plugins Development Team
This is an initial take at renaming the project to Monitoring Plugins. It's not expected to be fully complete, and it is expected to break things (The perl module for instance). More testing will be required before this goes mainline.
2013-09-17check_dhcp: fix mac address and interface number detection on solarisGravatar Sven Nierlein
newer (or x86) solaris implementations have interface names like e1000g0 which includes numbers. So we reverse the interface number detection to get the last number, instead of the first number.
2013-09-17check_dhcp: fix tests interface detectionGravatar Sven Nierlein
2013-09-16check_dhcp: fix tests for machines with default interace != eth0Gravatar Sven Nierlein
2013-09-16check_dhcp test: skip subtests if no variable is setGravatar Sven Nierlein
2013-09-15check_dhcp: add test fileGravatar Sven Nierlein
2013-09-15check_icmp: tests do not require sudo if run by rootGravatar Sven Nierlein
2013-09-15plugins-root: include t folder in release tarballGravatar Sven Nierlein
2013-09-04check_icmp: Minor whitespace/indentation fixesGravatar Holger Weiss