monitoring-plugins/plugins
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
..
picohttpparser Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
t check_disk increase alert precision (#1989) 2024-02-23 18:24:28 +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: Use C99 booleans 2023-10-18 17:18:53 +02: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: Use C99 booleans 2023-10-18 20:24:13 +02:00
check_swap.c check_swap: Use C99 booleans 2023-10-18 20:58:18 +02: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