monitoring-plugins/plugins
Lorenz Kästle 66f62dd336
check_ssh: patches from op5 (#1738)
* check_ssh: properly parse a delayed version control string

This resolves an issue with SSH servers which do not respond with their
version control string as the first thing in the SSH protocol version
exchange phase after connection establishment.

This patch also makes sure that we disregard a potential comment in the
version exchange string to avoid nonsense mismatches. In the future, we
might want to add the capability to match against a user specified comment.

In addition, the patch largely improves the communication towards the
server, which adds better protocol adherence.

Of course, new test cases are added to support the trigger and guard
against regressions of the bugs solved by this patch.

This fixes op5#7945 (https://bugs.op5.com/view.php?id=7945)

Signed-off-by: Anton Lofgren <alofgren@op5.com>

* check_ssh.t: Fix a few typos

Signed-off-by: Anton Lofgren <alofgren@op5.com>

* check_ssh: Handle non-alpha software versions

This patch fixes a bug where we would reject version control strings
that do not contain letters, because the assumption is made that they
always do. This is not required by the RFC however, and there exist
implementations that do not contain letters.

I've also added a few references to the RFC to make the process of
parsing the control string more apparent.

This fixes op5#8716 (https://bugs.op5.com/view.php?id=8716)

Signed-off-by: Anton Lofgren <alofgren@op5.com>

* check_ssh: Fix a typo in "remote-protocol parameter

remote-protcol -> remote-protocol

Signed-off-by: Anton Lofgren <alofgren@op5.com>

* Remove unused variable

* Formating fixes

* Update translations

* Remove merge conflict artefact from previous merge

* Set fixed include paths

* Improve code style to be slightly more readable

* Update test cases for different netcat behaviour and reduce sleep time

---------

Signed-off-by: Anton Lofgren <alofgren@op5.com>
Co-authored-by: Anton Lofgren <alofgren@op5.com>
2024-03-27 00:35:16 +01:00
..
picohttpparser Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
t check_ssh: patches from op5 (#1738) 2024-03-27 00:35:16 +01:00
tests Fix some more typos 2023-10-03 22:22:51 +02:00
check_apt.c Fix fallout of the previous changes 2023-10-19 12:20:27 +02:00
check_by_ssh.c Fixes for -Wsign-compare 2023-10-19 12:10:55 +02:00
check_cluster.c check_cluster.c: Added data argument validation. 2018-11-29 16:37:59 +01:00
check_curl.c check_curl: add haproxy protocol option 2024-02-01 16:08:16 +01:00
check_dbi.c check_dbi: Fix compiler warning for uninitialized variable 2023-10-19 11:14:23 +02:00
check_dig.c check_dig: Use C99 booleans 2023-10-18 16:14:01 +02:00
check_disk.c check_disk increase alert precision (#1989) 2024-02-23 18:24:28 +01:00
check_dns.c check_dns: Remove unused variable 2023-11-23 00:12:49 +01:00
check_dummy.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_fping.c check_fping: Use C99 booleans 2023-10-18 16:27:28 +02:00
check_game.c check_game: Use C99 booleans 2023-10-18 16:30:59 +02:00
check_hpjd.c Fixes for -Wimplicit-fallthrough 2023-04-18 00:18:07 +02:00
check_http.c check_http: Remove self assignment of a variable and add some comments 2023-12-29 00:45:54 +01:00
check_ide_smart.c check_ide_smart: Use C99 booleans 2023-10-18 16:33:39 +02:00
check_ldap.c check_ldap: Use C99 booleans 2023-10-18 16:35:56 +02:00
check_load.c Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
check_mrtg.c check_mrtg: Use C99 booleans 2023-10-18 16:37:36 +02:00
check_mrtgtraf.c check_mrtgtraf: Use C99 booleans 2023-10-18 16:39:13 +02:00
check_mysql.c check_mysql: Use C99 booleans 2023-10-18 16:40:51 +02:00
check_mysql_query.c check_mysql_query: Use C99 booleans 2023-10-18 16:48:05 +02:00
check_nagios.c use unknown exit code for help/version in plugins 2015-10-04 19:24:30 +02:00
check_nt.c check_nt: Use C99 booleans 2023-10-18 16:54:48 +02:00
check_ntp.c check_ntp: Use C99 booleans 2023-10-19 10:22:40 +02:00
check_ntp_peer.c check_ntp_peer: Fixes for Wmaybe-unitialized and some restructuring 2023-11-23 00:11:39 +01:00
check_ntp_time.c check_ntp_time: Use C99 booleans 2023-10-19 10:04:24 +02:00
check_nwstat.c check_nwstat: adds percentage used space (#1183) 2024-03-23 11:02:18 +01:00
check_overcr.c check_overcr: Use C99 booleans 2023-10-18 17:21:35 +02:00
check_pgsql.c check_pgsql: Use C99 booleans 2023-10-18 17:26:43 +02:00
check_ping.c check_ping: Use C99 booleans 2023-10-18 17:29:43 +02:00
check_procs.c check_procs: Generalise wording, remove mentioning of nrpe 2023-12-04 16:40:34 +01:00
check_radius.c check_radius: Use C99 booleans 2023-10-18 20:15:30 +02:00
check_real.c check_real: Use C99 booleans 2023-10-18 20:19:35 +02:00
check_smtp.c check_smtp: Restore behaviour pre ead5526efa regarding -D and TLS 2023-10-19 11:31:28 +02:00
check_snmp.c check_snmp: Remove unused variable 2023-12-29 00:47:29 +01:00
check_ssh.c check_ssh: patches from op5 (#1738) 2024-03-27 00:35:16 +01:00
check_swap.c check_swap: replace another fake boolen and small improvements (#1996) 2024-03-23 11:22:06 +01:00
check_tcp.c check_tcp: Fixes an error with using the wrong type for a variable 2023-10-19 13:47:21 +02:00
check_time.c check_time: Use C99 booleans 2023-10-18 20:33:06 +02:00
check_ups.c check_ups: output ups.realpower if supported 2023-11-10 00:08:49 +01:00
check_users.c check_users: Update help to properly show that thresholds are ranges 2023-10-31 01:51:27 +01:00
common.h plugins/common.h: Remove superflous TRUE/FALSE definitions 2023-10-18 20:38:34 +02:00
Makefile.am check_users: prefer systemd-logind over utmp 2023-08-28 14:55:56 +02:00
negate.c Added indentions for readability 2024-02-12 19:33:38 +08:00
netutils.c plugins/netutils: Use C99 booleans 2023-10-18 20:46:16 +02:00
netutils.h plugins/netutils: Use C99 booleans 2023-10-18 20:46:16 +02:00
popen.c Change iritating NULL assignment 2023-12-29 00:45:14 +01:00
popen.h Remove check for RETSIGTYPE in autoconf stuff 2023-09-23 12:31:33 +02:00
runcmd.c Change iritating NULL assignment 2023-12-29 00:45:14 +01:00
runcmd.h Project rename initial commit. 2014-01-19 14:18:47 -05:00
sslutils.c Replace deprecated TLS client functions 2023-04-18 00:22:25 +02:00
urlize.c Capitalize "Monitoring" when it's the first word 2014-01-20 03:12:50 +01:00
utils.c Fix logic in is_uint64_t to fix type-limit warning 2023-11-23 00:07:02 +01:00
utils.h plugins/utils: Use C99 booleans 2023-10-18 20:51:23 +02:00