summaryrefslogtreecommitdiffstats
path: root/plugins-root
AgeCommit message (Collapse)AuthorFilesLines
2023-10-03Make some booleans nicerLorenz Kästle1-3/+3
2023-10-03Some code formattingLorenz Kästle1-7/+7
2023-10-03New variable is actually a booleanLorenz Kästle1-7/+8
2023-10-03check_dhcp.c merged patch from #752Patrick Cervicek1-10/+34
- added dhcp rogue detection contributed by Patrick Cervicek (patrick AT cervicek.de) - closes #752
2023-10-01Update copyrightrefs/pull/1930/headRincewindsHat1-1/+1
2023-10-01Remove trailing linesRincewindsHat1-3/+0
2023-10-01Comment some endifs to make comprehension easierRincewindsHat1-2/+3
2023-10-01Use real booleansRincewindsHat1-17/+14
2023-10-01Homogenize whitespace usageRincewindsHat1-305/+305
2023-10-01Remove unnecessary type definesRincewindsHat1-20/+16
2023-06-28Merge branch 'master' into compiler_warning_part_2refs/pull/1867/headwaja1-4/+0
2023-04-17Refix spelling issuesRincewindsHat1-1/+1
2023-04-17Fixes for -WuninitializedRincewindsHat1-0/+1
2023-04-17Fixes for -Wunused-parametersRincewindsHat2-6/+10
2023-04-17Fixes for -Wunusedrefs/pull/1866/headRincewindsHat1-4/+0
* 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.
2023-04-14Fix a lot of typos reported by codespellrefs/pull/1864/headJan Wagner3-3/+3
2023-02-19Merge branch 'master' into check_icmp_cleanuprefs/pull/1807/headRincewindsHat2-9/+9
2023-02-19check_icmp: Fix compiler warningRincewindsHat1-1/+1
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.
2023-02-19check_icmp: Fix compiler warningRincewindsHat1-2/+3
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.
2023-01-31Link plugins against libcrypto to make hashes availableLorenz Kästle1-1/+1
2022-11-29check_icmp: fix parsing help/version long optionsAksel Sjögren1-8/+8
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-11-04Replace DBL_MAX with INFITY to check if value was setRincewindsHat1-2/+3
2022-11-04Remove hardcoded DBL_MAX definitionRincewindsHat1-4/+0
2022-11-04Remove trailing whitespacesRincewindsHat1-12/+12
2022-07-14Set msg_namelen to the size of the sockaddr struct for the appropriate ↵eriksejr1-4/+8
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)Lorenz2-30/+43
* 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 detectedghciv62-2/+11
- add a test to check '-s'
2021-11-24More wrong printf formattingrefs/pull/1729/headRincewindsHat1-2/+2
2021-11-24Fix CodeQL checksRincewindsHat1-2/+2
2021-11-15check_icmp: Fix pkt perfdata in check_host modeAksel Sjögren1-1/+1
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 testsAksel Sjögren1-2/+7
* 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-rootAksel Sjögren1-0/+3
Fixes "No rule to make target 'test-debug'" when running "make test-debug" in root dir.
2020-12-19docs: fix simple typo, conspicuosly -> conspicuouslyrefs/pull/1652/headTim Gates1-1/+1
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).Vadim Zhukov1-1/+2
Otherwise, it writes sizeof(size_t) bytes to &oldlen, smashing the stack.
2018-12-10check_icmp: Do not overwrite -4,-6 on lookuprefs/pull/1563/headJacob Hansen1-2/+10
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 versionJacob Hansen1-0/+4
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 variableJacob Hansen1-2/+3
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 lookupJacob Hansen1-1/+2
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 codeJacob Hansen1-7/+0
Signed-off-by: Jacob Hansen <jhansen@op5.com>
2018-12-07check_icmp: process protocol version args firstJacob Hansen1-10/+22
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 protocolJacob Hansen1-26/+45
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 01efbb2183d49c5082598d4799788fc385342f28Lars Michelsen1-38/+38
2018-12-07check_icmp: Add IPv6 supportLars Michelsen1-161/+330
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 fixHolger Weiss1-1/+1
2017-01-10Merge branch 'spell_fix'Jan Wagner1-1/+1
2016-12-07properly remove MSG_PEEK in check_dhcp.c. Fixes #1450.refs/pull/1454/headHarald Koch1-1/+1
2016-12-01Spelling fixes suggested by lintianrefs/pull/1452/headJan Wagner1-1/+1
2016-09-16check_dhcp: Make xid a bit more randomHolger Weiss1-3/+2
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 responseHolger Weiss1-7/+1
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'Jan Wagner1-1/+3
(Closes #1371) (Closes #1203)