monitoring-plugins/plugins/t
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
..
check_apt_input Tests for check_apt 2012-10-03 15:54:24 -07:00
check_apt.t Add --only-critical switch to check_apt 2016-12-31 12:00:46 +01:00
check_by_ssh.t Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
check_cluster.t Removing CVS/SVN tags and replacing with git-based versioning 2008-11-23 05:38:47 +00:00
check_curl.t Check curl detect ipv6 (#1809) 2022-11-07 17:48:28 +01:00
check_dbi.t t/check_dbi.t: Don't use 'INSERT … VALUES (a,b), (c,d)' with SQLite3. 2012-06-08 13:18:07 +02:00
check_dig.t Change default host names for some tests 2013-09-29 00:14:17 +02:00
check_disk.t check_disk increase alert precision (#1989) 2024-02-23 18:24:28 +01:00
check_dns.t Improvements suggested by tobiaswiese 2021-09-02 09:56:39 +02:00
check_dummy.t Removing CVS/SVN tags and replacing with git-based versioning 2008-11-23 05:38:47 +00:00
check_fping.t Refactor check_fping 2021-05-19 13:36:04 +02:00
check_ftp.t tests: rework test parameters 2018-12-04 15:20:19 +01:00
check_hpjd.t added tests for check_hpjd port options 2014-07-20 23:36:05 +02:00
check_http.t Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
check_imap.t Fix some more typos 2023-10-03 22:22:51 +02:00
check_jabber.t tests: rework test parameters 2018-12-04 15:20:19 +01:00
check_ldap.t tests: rework test parameters 2018-12-04 15:20:19 +01:00
check_load.t Display total and scaled load values if check_load scales the values by number of CPUs (#1778) 2022-09-19 10:23:49 +02:00
check_mysql.t Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
check_mysql_query.t Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
check_nagios.nagios1.status.log Support for Nagios 1 and Nagios 2 status files (Gerhard Lausser - 1296242) 2005-12-02 22:28:06 +00:00
check_nagios.nagios2.status.dat Support for Nagios 1 and Nagios 2 status files (Gerhard Lausser - 1296242) 2005-12-02 22:28:06 +00:00
check_nagios.t Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
check_ntp.t check_ntp.t - fixed tests for new status output 2014-07-20 23:35:03 +02:00
check_ping.t check_ping: increase test timeout 2013-09-14 21:06:26 +02:00
check_pop.t Removing CVS/SVN tags and replacing with git-based versioning 2008-11-23 05:38:47 +00:00
check_procs.t check_procs: Add delay after forking in test 2014-07-10 21:10:48 +02:00
check_smtp.t check_smtp: add tests for --ssl 2023-08-30 15:04:32 +02:00
check_snmp.t Enhance regex in test to be more tolerant to follow up text 2023-08-28 10:31:21 +02:00
check_ssh.t tests: rework test parameters 2018-12-04 15:20:19 +01:00
check_swap.t Remove spaces from tests 2021-09-26 00:34:44 +02:00
check_tcp.t tests: rework test parameters 2018-12-04 15:20:19 +01:00
check_time.t tests: rework test parameters 2018-12-04 15:20:19 +01:00
check_udp.t udp test: prefer nc over netcat syntax 2017-03-12 22:55:52 +01:00
check_users.t Enhance tests to check wheter the option validation works 2023-10-31 01:50:46 +01:00
negate.t Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00