Commit graph

279 commits

Author SHA1 Message Date
Lorenz Kästle
ec5fd11c1d check_dbi: new output functionality 2025-10-29 13:05:55 +01:00
Lorenz Kästle
eca9eaf9f5 fix number of tests 2025-09-15 02:17:44 +02:00
Lorenz Kästle
c07dd02bee Adapt test to new error message 2025-09-15 02:09:04 +02:00
Lorenz Kästle
c892db9ae1 Fix typos 2025-09-15 02:02:04 +02:00
Lorenz Kästle
404d52efb9 Fix/adapt tests 2025-09-15 01:58:26 +02:00
Lorenz Kästle
6ae8ba9110 check_curl: test adaption and output adaption 2025-09-13 12:49:06 +02:00
Lorenz Kästle
c43f845c22 Adjust number of tests 2025-09-09 01:43:27 +02:00
Lorenz Kästle
015e4c0986 check_snmp: fix/adapt tests 2025-08-27 16:42:06 +02:00
Lorenz Kästle
7382fa90f8 Merge branch 'master' into refactor/check_users 2025-08-11 21:54:05 +02:00
Lorenz Kästle
b191a8a055 check_load: fix tests 2025-07-06 23:16:34 +02:00
Lorenz Kästle
92c7b91002 Merge branch 'master' into refactor/check_load 2025-07-06 22:49:04 +02:00
Lorenz Kästle
13c9de8c77 Try fixing some tests 2025-03-31 23:40:22 +02:00
Lorenz Kästle
24a50b9421 check_disk: decrease precision to avoid false negatives with small measurement changes 2025-03-31 22:18:19 +02:00
Lorenz Kästle
d1d6ba6706 Add debugging to tests for CI 2025-03-30 23:42:50 +02:00
Lorenz Kästle
c4fd34ed79 Codespell fixes 2025-03-30 22:46:09 +02:00
Lorenz Kästle
76971dea75 Address check_disk changes in tests 2025-03-30 22:38:12 +02:00
Lorenz Kästle
205b97b3e2 check_load: Remove output formatting test and adapt others 2025-03-13 23:48:33 +01:00
Lorenz Kästle
c61b5ef06a Update more tests to current output 2025-03-13 13:21:10 +01:00
Lorenz Kästle
44211a6729 Adapt tests more 2025-03-13 12:59:40 +01:00
Lorenz Kästle
54a099ed6d Merge branch 'master' into refactor/check_tcp 2025-03-13 00:48:00 +01:00
Lorenz Kästle
89df16e750 Adapt tests 2025-03-13 00:44:35 +01:00
Lorenz Kästle
270d643d11 Adapt tests 2025-03-12 22:16:57 +01:00
Lorenz Kästle
9d5774aede Adapt number of tests 2025-03-09 10:25:01 +01:00
Lorenz Kästle
69819d8c95 Adapt test regex to new output 2025-03-09 10:24:28 +01:00
Lorenz Kästle
809e79c745 Remove failing test 2025-03-09 00:30:33 +01:00
Lorenz Kästle
fea6a662bd fix accidently remove parentheses in test 2025-03-09 00:12:37 +01:00
Lorenz Kästle
f63d249984 Adapt further test to changed output 2025-03-09 00:03:18 +01:00
Lorenz Kästle
1ba8110da7 check_ssh: adapt tests 2025-03-07 23:38:50 +01:00
Lorenz Kästle
03b09f7ce0
Merge pull request #2076 from RincewindsHat/feature/json_parsing_in_tests
Implement JSON output parsing for tests
2025-03-07 18:18:29 +01:00
Lorenz Kästle
5ad1c0e821 Implement JSON output parsing for tests 2025-03-07 17:05:02 +01:00
Lorenz Kästle
9e1c72ac15
Merge pull request #2068 from RincewindsHat/check_mysql_replica_check
Check mysql replica check
2025-03-07 17:02:55 +01:00
Lorenz Kästle
3ed6b7cd3e check_mysql tests: Also exchange slave for replica 2025-02-24 20:55:18 +01:00
Lorenz Kästle
7c8c9d9b3e Remove check_swap tests with one-line format 2025-02-21 13:57:17 +01:00
Lorenz Kästle
ec18b80cdb Add tests for check_swap with JSON output 2025-02-19 12:07:01 +01:00
Lorenz Kästle
d27e0862a9 Fix previous check_swap tests 2025-02-19 11:57:25 +01:00
Lorenz Kästle
4b7977b25b check_swap: Fix text in old school tests 2024-11-10 01:40:29 +01:00
Sven Nierlein
9e6361077b check_http: replace www.mozilla.com with monitoring-plugins.org
this makes tests more reliable if we test our own sites instead some 3rd party site.

Signed-off-by: Sven Nierlein <sven@consol.de>
2024-07-23 21:08:57 +02:00
Napsty
3deea4cc63 Adjust check_swap tests 2024-04-12 16:50:15 +02:00
Napsty
60614121d1 Adjust check_swap tests 2024-04-12 16:50:15 +02:00
Napsty
675f208476 Adjust check_swap tests 2024-04-12 16:50:15 +02:00
Lorenz Kästle
d3faf13961
check_disk: Fail on missing arguments for --warning and --critical and fix a test case (#1935)
* check_disk: Fail on missing arguments for --warning and --critical
* Add new test function for percentage expressions and use it in check_disk
* Add error abort in tests if they fail to parse output
* Fix typo in test which probably broke the test since forever :-(
2024-03-27 00:36:41 +01:00
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
Sven Nierlein
117cd8e4b8
check_disk increase alert precision (#1989)
* check_disk increase alert precision

Free disk percentage value was rounded to a full integer meaning it alerted about ~1% percent too early. This is about 10GB on a 1TB disk.
The warning and critical thresholds already support float values, so just the percentage calculation needs to be improved.

old:

    ./check_disk -w 35% -c 20% -p / -f -vvv
    Thresholds(pct) for / warn: 35.000000 crit 20.000000
    calling stat on /
    For /, used_pct=65 free_pct=35 used_units=286451 free_units=156651 total_units=443102 used_inodes_pct=11 free_inodes_pct=89 fsp.fsu_blocksize=4096 mult=1048576
    Freespace_units result=0
    Freespace% result=1
    Usedspace_units result=0
    Usedspace_percent result=0
    Usedinodes_percent result=0
    Freeinodes_percent result=0
    DISK WARNING - free space: WARNING [ / 156651MiB (35% inode=89%)];| /=300365643776B;302006979788;371700898201;0;464626122752

new:

    ./check_disk -w 35% -c 20% -p / -f -vvv
    Thresholds(pct) for / warn: 35.000000 crit 20.000000
    calling stat on /
    For /, used_pct=64.649722 free_pct=35.350278 used_units=286464 free_units=156637 total_units=443102 used_inodes_pct=10.016183 free_inodes_pct=89.983817 fsp.fsu_blocksize=4096 mult=1048576
    Freespace_units result=0
    Freespace% result=0
    Usedspace_units result=0
    Usedspace_percent result=0
    Usedinodes_percent result=0
    Freeinodes_percent result=0
    DISK OK - free space: / 156637MiB (35.4% inode=90%);| /=300379275264B;302006979788;371700898201;0;464626122752

* check_disk: adjust test case to support float precision
2024-02-23 18:24:28 +01:00
Sven Nierlein
579db5a930 check_disk: fix ignore-missing in combination with includes (fixes #1963)
Using --ignore-missing together with regex matching and ignore option lead
to a wrong error message.

    ./check_disk -n -w 10% -c 5% -W 10% -r /dummy -i /dummy2
    DISK UNKNOWN: Paths need to be selected before using -i/-I. Use -A to select all paths explicitly

The use case here is a cluster with fail-over mounts. So it is a valid situation that
the regex match does not find anything in addtition with a ignore which also does not exist.

After this patch:

    ./check_disk -n -w 10% -c 5% -W 10% -r /dummy -i /dummy2
    DISK OK - No disks were found for provided parameters|
2023-11-27 13:04:10 +01:00
RincewindsHat
d9a999de7b Enhance tests to check wheter the option validation works 2023-10-31 01:50:46 +01:00
RincewindsHat
e1e1291b72 Fix some more typos 2023-10-03 22:22:51 +02:00
Franz Schwartau
06ebad8399 check_smtp: add tests for --ssl 2023-08-30 15:04:32 +02:00
Franz Schwartau
8fa9370a0c Rename test variables for upcoming new variables with the same name 2023-08-30 15:04:32 +02:00
Lorenz Kästle
c6abf11e02 Enhance regex in test to be more tolerant to follow up text 2023-08-28 10:31:21 +02:00
RincewindsHat
94a5eb218d Update test to ignore broken MIBs 2023-08-27 23:13:50 +02:00