summaryrefslogtreecommitdiffstats
path: root/plugins/check_disk.c
AgeCommit message (Collapse)AuthorFilesLines
37 hoursRevert check_disk performance data back to used space (#2243)Lorenz Kästle1-12/+46
* Implement simple output shortcut for ranges If ranges start with zero (e.g. 0:10), the zero and the colon can be left out. This patch implements this by default, since some systems (icinga2) do not fully implement the whole range format and this reduces errors in the common case of just an upper border. * switch check_disk perfdata back to used space
2026-02-16Fix typo in enum MP_PARSING_SUCCES(S) (#2233)Dirk Mueller1-2/+2
2026-01-16check_disk: compare inode thresholds against the correct value (#2223)Lorenz Kästle1-1/+5
* check_disk: compare inode thresholds against the correct value * check_disk: Detect free inode number correctly in tests --------- Co-authored-by: Lorenz Kästle <lorenz.kaestle@netways.de>
2025-09-15Run clang-format againLorenz Kästle1-102/+186
2025-03-31Fixes problems after a4cf2e79f75dce3828be21726f10c755f652f710Lorenz Kästle1-1/+1
2025-03-31Fix some typos with unitsLorenz Kästle1-6/+6
2025-03-30Remove cool, comfy c23 functionality for some dirty old hacksLorenz Kästle1-13/+29
2025-03-30Codespell fixesLorenz Kästle1-3/+3
2025-03-30Refactor check_disk and library functionsLorenz Kästle1-492/+577
2025-03-18check_disk: Remove unnecessary NULL checksLorenz Kästle1-18/+6
2025-03-18Remove some unused codeLorenz Kästle1-8/+0
2025-03-18Refactor check_disk, no more global variablesLorenz Kästle1-264/+266
2025-03-17check_disk: reset single file system result in between checksLorenz Kästle1-0/+3
2025-03-17check_disk: Little fixes and improvementsLorenz Kästle1-8/+23
2025-03-17check_disk: General refactoringLorenz Kästle1-195/+158
2025-03-17check_disk: boolean type and linter fixesLorenz Kästle1-20/+20
2025-03-17check_disk: clang-formatLorenz Kästle1-43/+86
2024-11-04check_disk: Initialize most variablesLorenz Kästle1-11/+11
2024-10-31check_disk: Linter fixesRincewindsHat1-13/+19
2024-10-31check_disk: Update copyrightRincewindsHat1-2/+2
2024-10-31check_disk: clang-formatRincewindsHat1-1001/+962
2024-09-27check_disk: remove unused variables and functionsLorenz Kästle1-15/+0
2024-09-27check_disk: Declare global variables staticLorenz Kästle1-37/+37
Variables only used in that specific translation unit should be static to actually communicate that fact. Also allows the compiler to detect unused (global) variables.
2024-03-27check_disk: Fail on missing arguments for --warning and --critical and fix a ↵Lorenz Kästle1-0/+8
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-02-23check_disk increase alert precision (#1989)Sven Nierlein1-22/+6
* 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
2023-11-27check_disk: fix ignore-missing in combination with includes (fixes #1963)Sven Nierlein1-2/+2
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-27check_disk: add -n short option for --ignore-missingSven Nierlein1-6/+5
Signed-off-by: Sven Nierlein <sven@consol.de>
2023-10-18check_disk: Use C99 booleansRincewindsHat1-29/+29
2023-10-01check_disk: Change usage for --include-type to indicated regexes are now ↵Lorenz Kästle1-2/+2
possible
2023-09-30check_disk: Use regex also to include fs typesLorenz Kästle1-3/+7
2023-09-28check_disk: make -X a regex listAlexander A. Klimov1-7/+11
2023-09-21Add -C to general usage hintsLorenz Kästle1-1/+1
2023-09-21check_disk: Add some general usage hintsRincewindsHat1-0/+8
2023-09-21check_disk: More spacing to separate examplesRincewindsHat1-2/+2
2023-09-21check_disk: Mention -A and long options in error message about missing ↵RincewindsHat1-1/+1
thresholds
2023-09-21check_disk: Fix printf format stringRincewindsHat1-1/+1
2023-09-12check_disk: Remove some dead variablesRincewindsHat1-4/+1
2023-05-26check_disk: Display SI units correctlyRincewindsHat1-6/+21
2023-04-14Fix a lot of typos reported by codespellJan Wagner1-3/+3
2023-03-06check_disk: use cleaner code for ignore-missing optionKristian Schuster1-18/+16
- use datatype bool for new vars ignore_missing and path_ignored instead of int - directly initialize preamble and ignored_preamble with their strings
2023-02-20check_disk: fix ugly output with -e option and adapt tests accordinglyKristian Schuster1-5/+5
2023-02-19Merge remote-tracking branch 'origin/master' into ↵Kristian Schuster1-2/+2
feature_check_disk_add_ignore_missing_option
2023-02-19check_disk: still allow check of available disks with ignore-missing param usedKristian Schuster1-25/+78
Also add reporting of ignored paths. When paths are provided by -p and/ or -r and one path does not match a mounted disk, checking available disks is still possible. Paths provided by -p are reported as ignored, when not available. Due to code structure, this is not possible for -r unfortunately.
2023-02-01check_disk: Remove weird code (workaround?) which broke with gnulib updateLorenz Kästle1-1/+1
2023-01-20check_disk: Clarify usage possibilites (#1745)Lorenz1-1/+1
* Clarify usage possibilites of check_disk * Remove superfluous newlines Co-authored-by: waja <waja@users.noreply.github.com>
2022-10-24check_disk: add ignore-missing option to return OK for missing fsKristian Schuster1-5/+24
There a situations where UNKNOWN or CRITICAL services are not wanted when a filesystem is missing, a regex does not match or the filesystem is inaccessible on a system. This new option helps to have the service in state OK.
2022-09-11Check disk compiler warnings (#1758)Lorenz1-59/+8
* Use unused variable * Proper format strings for printf * Use proper functions for absolute values * Remove and add comments at some places
2022-01-30Description for -M was the wrong way around (#1746)Lorenz1-1/+1
Using -M should show the mountpoint instead of the device the file system originated from. Seems like this was not the case for a long time and now the default is to show the mount point. Using `-M` reverts to showing the (block) device instead. The usage Description was adjusted with this commit.
2022-01-22Trivial printf fix and a little bit of code style (#1695)Lorenz1-2/+4
* Fix several warnings (and some downright bugs probably) with formating in check_disk Update to master * Fix merge error, I forgot the last time * Fix indentation Co-authored-by: rincewind <rincewind@vulgrim.de>
2021-11-24More wrong printf formattingRincewindsHat1-2/+2