Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
|
|
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.
|
|
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 :-(
|
|
* 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
|
|
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|
|
|
Signed-off-by: Sven Nierlein <sven@consol.de>
|
|
|
|
possible
|
|
|
|
|
|
|
|
|
|
|
|
thresholds
|
|
|
|
|
|
|
|
|
|
- use datatype bool for new vars ignore_missing and path_ignored instead of int
- directly initialize preamble and ignored_preamble with their strings
|
|
|
|
feature_check_disk_add_ignore_missing_option
|
|
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.
|
|
|
|
* Clarify usage possibilites of check_disk
* Remove superfluous newlines
Co-authored-by: waja <waja@users.noreply.github.com>
|
|
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.
|
|
* Use unused variable
* Proper format strings for printf
* Use proper functions for absolute values
* Remove and add comments at some places
|
|
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.
|
|
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
check_disk: Fixing the stuff that is broken on btrfs
|
|
|
|
This is not enabled by default
It can be enabled with the -P (--iperfdata) option
|
|
used"
|
|
check_disk - show all disks if state is ok and option error only is used
|
|
check_disk: remove unused variables
|
|
This fix changes output of check_disk in case of --error-only/-e option
is used and state is ok
- Old output: DISK OK
- New output: DISK OK - free space: / 159731 MB (83% inode=61%);
/dev/shm 2926 MB (100% inode=99%); /boot 58 MB (32% inode=99%);
Resolves: #1420
|
|
(Closes #1357)
|
|
This reverts commit 6986aa1d0a352d8d02eed4896034631fffd25a27. That
commit leads to issues on non-Linux systems, and it seems to not
(always) work as expected on Linux, either.
Conflicts:
plugins/Makefile.am
plugins/check_disk.c
Closes #1377 and closes #1329.
|
|
Signed-off-by: Sven Nierlein <sven@nierlein.de>
|