Commit graph

122 commits

Author SHA1 Message Date
Holger Weiss
89d00d1c00 Apply another spelling fix 2017-01-10 21:34:58 +01:00
Jan Wagner
10fa79a97a Merge branch 'spell_fix' 2017-01-10 20:33:16 +01:00
Harald Koch
9dd09ec331 properly remove MSG_PEEK in check_dhcp.c. Fixes #1450. 2016-12-07 13:11:40 -05:00
Jan Wagner
dbb92c347e Spelling fixes suggested by lintian 2016-12-01 12:49:40 +01:00
Holger Weiss
8672529b37 check_dhcp: Make xid a bit more random
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-16 09:43:04 +02:00
Holger Weiss
99f5be2992 check_dhcp: Don't peek before reading response
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.
2016-09-14 11:57:31 +02:00
Jan Wagner
25e6f5efaf Merge branch 'check_proc_1203'
(Closes #1371)
(Closes #1203)
2015-10-13 11:15:20 +02:00
Holger Weiss
37928b52a5 Merge branch 'maint'
* 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-08 12:52:10 +02:00
abrist
d077d64e54 Fix for unclosed filehandle in pst3 on Solaris
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-05 13:23:59 +02:00
Sven Nierlein
bebf1cd050 use unknown exit code for help/version in plugins-root as well
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2015-10-04 19:24:30 +02:00
Holger Weiss
466cb79e52 check_dhcp: Fix option parsing
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-02 12:18:13 +02:00
Jan Wagner
6a939fa1ba Fixes segfaults when running via monitoring worker
(off-by-one)

Grabed from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198318
2015-10-02 10:32:00 +02:00
Sven Nierlein
809508926f make use of MSG_CONFIRM optional
since MSG_CONFIRM is a linux thing and only available on linux kernels >= 2.3.15, see send(2)
2015-01-29 16:18:27 +01:00
Holger Weiss
ed9394880c check_icmp: Cast size_t values for printf(3)
Convert size_t values to unsigned long for printf(3) in order to
maximize portability.
2014-12-02 11:36:25 +01:00
Holger Weiss
9c289ec744 check_icmp: Fix a few type errors 2014-11-28 16:23:28 +01:00
Holger Weiss
8e5118e0cb Don't mix variable declarations and code
We still support pre-C99 compilers.
2014-11-28 16:23:28 +01:00
Matthieu Kermagoret
5265fabeb9 Use kernel reception time on ICMP packets to compute rtt.
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-11-28 16:23:27 +01:00
Jan Wagner
ba21e26443 check_icmp/check_dhcp: disable check, if we are root
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-07-06 13:29:24 +02:00
Spenser Reinhardt
e7e6edb2f8 plugins-root/check_dhcp.c - array out of bounds
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-06-28 18:22:04 +02:00
Holger Weiss
01e570f4a4 Capitalize "Monitoring Plugins"
"Monitoring Plugins" is a name.
2014-01-21 16:19:20 +01:00
Holger Weiss
c3e756a855 Capitalize "Monitoring" when it's the first word 2014-01-20 03:12:50 +01:00
Monitoring Plugins Development Team
63734f52ab Project rename initial commit.
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.
2014-01-19 14:18:47 -05:00
Sven Nierlein
6e9d16809e check_dhcp: fix mac address and interface number detection on solaris
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-17 19:56:55 +02:00
Sven Nierlein
08d554ada1 check_dhcp: fix tests interface detection 2013-09-17 13:13:26 +02:00
Sven Nierlein
2b23caf3d1 check_dhcp: fix tests for machines with default interace != eth0 2013-09-16 13:49:44 +02:00
Sven Nierlein
095e2e5db5 check_dhcp test: skip subtests if no variable is set 2013-09-16 08:51:04 +02:00
Sven Nierlein
5d58592cfe check_dhcp: add test file 2013-09-15 22:15:21 +02:00
Sven Nierlein
3c958ac738 check_icmp: tests do not require sudo if run by root 2013-09-15 21:57:27 +02:00
Sven Nierlein
a7f5e8a765 plugins-root: include t folder in release tarball 2013-09-15 21:33:29 +02:00
Holger Weiss
317d2896dc check_icmp: Minor whitespace/indentation fixes 2013-09-04 22:28:50 +02:00
Holger Weiss
a480681cb7 check_icmp: Support "--help" and "--version"
Let check_icmp provide "--help" and "--version" flags (in addition to
"-h" and "-V"), just as the other plugins do.
2013-09-04 22:20:26 +02:00
Holger Weiss
4d52762732 check_dhcp: Don't misinterpret the "siaddr" field
RFC 2131 (2.) says: "DHCP clarifies the interpretation of the 'siaddr'
field as the address of the server to use in the next step of the
client's bootstrap process."  So, we shouldn't interpret this field as
the DHCP server's own address.  (#3503921 - Jason Ellison)
2012-06-14 00:39:55 +02:00
Holger Weiss
f091d59e0f check_dhcp: Fix handling of "pad" options
Don't let "pad" options[*] terminate the parsing of DHCP options.  This
bug was triggered by using check_dhcp against Windows 2003 DHCP servers
(see #3503921).

[*] Cf. RFC 2132, 3.1.
2012-06-13 12:36:42 +02:00
Sebastian Harl
5ebe25fc24 check_host: Allocate a large-enough buffer for the host table.
When specifying a host-name on the command line, each of its IPs is added to
the host table (and each one is pinged). So, the buffer has to be large enough
to hold all of the respective host objects. (argc - 1) only fits hosts with a
single IP.

Thanks to Max Kosmach <max@tcen.ru> for reporting this in Debian bug #623702.
2011-04-28 20:42:53 -04:00
Thomas Guyot-Sionnest
eaf3cb27f4 Add newline after "Usage:" in --help 2010-04-22 08:57:14 -04:00
Thomas Guyot-Sionnest
884aee0667 Standardize the extra-opts notes 2010-04-21 23:29:18 -04:00
Thomas Guyot-Sionnest
25d1ee331d Fix translations when extra-opts aren't enabled
Bug #2832884 reported problem with translations outputting pot file
headers. This is caused by "" matching the header of the translation
files.

This patch moves gettext macros inside utils macros and update some
french translations.
2010-04-14 08:33:06 -04:00
Thomas Guyot-Sionnest
c326b4dc1d pst3.c must not use nagiosplug/gnulib includes 2010-04-14 03:02:38 -04:00
Thomas Guyot-Sionnest
9c1aa029c0 Set proper network byte order for icmp_id and icmp_seq in icmp packets 2009-10-15 22:12:32 -04:00
Thomas Guyot-Sionnest
c2d9c59dc9 Increment per-host sequence in check_icmp 2009-10-15 21:52:18 -04:00
nagiosplugins
43c187a944 Allow custom versions with the release file... 2009-09-25 09:31:04 +00:00
Ton Voon
bbadda8979 Ensure dirhandle is closed (Duncan Ferguson) 2009-09-14 11:22:13 +01:00
Ton Voon
0dcd5e677e pst3 compile with Sun Studio Compiler 2009-07-14 23:20:21 +01:00
Matthias Eble
5f67308451 Fixed error in rtt/rta calculation in case of system clock problems
Time differences are now set to 0 in case of backward timejumps so there are no wrap-around problems any more.
The RTA calculation hopefully gets a more accurate value in these cases also.
2009-06-14 23:31:29 +02:00
Holger Weiss
bc827c9083 Don't use the plain char type for data buffers
Buffers which are used for holding arbitrary data should be referenced
using pointers to void and accessed using pointers to unsigned char.

Signed-off-by: Holger Weiss <holger@zedat.fu-berlin.de>
2009-06-02 01:09:18 +02:00
Matthias Eble
0a5cd15e75 Fixed check_icmp compiler warnings by including float.h
Self defined DBL_MAX caused compiler warnings. Now float.h
which defines DBL_MAX is included.
2009-06-01 22:41:46 +02:00
Matthias Eble
1c55e7287a Fixed --help output for warn and critical thresholds (sf.net #2796624, debian #530553)
check_icmp wrongly calculated the current thresholds in --help output.
2009-06-01 22:21:59 +02:00
Thomas Guyot-Sionnest
399f0770b2 Fixing build breakages (I totally forgot this rule was there...) 2008-11-26 21:29:40 -05:00
Thomas Guyot-Sionnest
9bcfa9cded Disable dynamic versionning for releases, and allow generating version out of subversion.
This should be a definitive fix for systems with non-compilant make programs as the version will be taken from $(PACKAGE_VERSION) instead.

At the same time I added code for generating svn-based version strings.
2008-11-26 05:42:48 -05:00
Thomas Guyot-Sionnest
ed9a088b37 Workaround to support more make programs
Avoid the use of "-include". Since "include" is interpreted by Automake, we have to use a special macro instead.
2008-11-25 08:50:35 -05:00