Commit graph

174 commits

Author SHA1 Message Date
RincewindsHat
b01aa8c433 check_disk: More spacing to separate examples 2023-09-21 12:09:10 +02:00
RincewindsHat
2f916675b3 check_disk: Mention -A and long options in error message about missing thresholds 2023-09-21 12:09:10 +02:00
RincewindsHat
3e8fdf9b35 check_disk: Fix printf format string 2023-09-21 12:09:10 +02:00
RincewindsHat
53ea2304aa check_disk: Remove some dead variables 2023-09-12 00:50:55 +02:00
RincewindsHat
bf8eb6dcc7 check_disk: Display SI units correctly 2023-05-26 08:45:00 +02:00
Jan Wagner
0f3703e641 Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
Kristian Schuster
3e7da5f970
check_disk: use cleaner code for ignore-missing option
- use datatype bool for new vars ignore_missing and path_ignored instead of int
- directly initialize preamble and ignored_preamble with their strings
2023-03-06 14:03:10 +01:00
Kristian Schuster
e102b8a49e
check_disk: fix ugly output with -e option and adapt tests accordingly 2023-02-20 02:03:01 +01:00
Kristian Schuster
a0d4277721
Merge remote-tracking branch 'origin/master' into feature_check_disk_add_ignore_missing_option 2023-02-19 23:49:18 +01:00
Kristian Schuster
ba78c32018
check_disk: still allow check of available disks with ignore-missing param used
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-19 22:49:30 +01:00
Lorenz Kästle
05ab60f808 check_disk: Remove weird code (workaround?) which broke with gnulib update 2023-02-01 00:56:44 +01:00
Lorenz
67b472f9d1
check_disk: Clarify usage possibilites (#1745)
* Clarify usage possibilites of check_disk

* Remove superfluous newlines

Co-authored-by: waja <waja@users.noreply.github.com>
2023-01-20 12:08:15 +01:00
Kristian Schuster
8cf31437e9
check_disk: add ignore-missing option to return OK for missing fs
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-10-24 17:29:53 +02:00
Lorenz
ef57962552
Check disk compiler warnings (#1758)
* Use unused variable

* Proper format strings for printf

* Use proper functions for absolute values

* Remove and add comments at some places
2022-09-11 06:29:58 +02:00
Lorenz
d485b64ef0
Description for -M was the wrong way around (#1746)
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-30 19:41:36 +01:00
Lorenz
cf669f5ff5
Trivial printf fix and a little bit of code style (#1695)
* 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>
2022-01-22 22:23:13 +01:00
RincewindsHat
d28bab4dbd More wrong printf formatting 2021-11-24 19:02:17 +01:00
RincewindsHat
e2f24a5af3 Fix CodeQL checks 2021-11-24 14:25:42 +01:00
RincewindsHat
884327ee21 Replace tabs with spaces and do some formatting 2021-10-27 12:53:13 +02:00
RincewindsHat
5974b0481c Remove whitespace at the end of lines 2021-10-27 12:53:13 +02:00
RincewindsHat
6e0586c8e3 Reform some arithmetical operations for more clarity 2021-10-26 17:07:09 +02:00
RincewindsHat
1c0882def0 hopefully fix warning high tide with percentage 2021-10-26 17:07:09 +02:00
RincewindsHat
50fc9b73a2 Switch to uint64_t 2021-10-26 17:07:09 +02:00
RincewindsHat
8f2cfd1c80 Reformat a little bit for easier reading 2021-10-26 17:07:09 +02:00
RincewindsHat
078c69d2dd Recognice IEC binary units and format accordingly to base2 (always) 2021-10-26 17:07:09 +02:00
Sven Nierlein
e17c1e9ed9
Merge pull request #1388 from waja/check_proc_consumption_1357
check_disk: Fixing the stuff that is broken on btrfs
2021-08-24 09:05:01 +02:00
Christopher Odenbach
a15d425598 include -P switch in help 2019-04-09 09:49:57 +02:00
Vincent Danjean
270e7cba38 [check_disk] add support to display inodes usage in perfdata
This is not enabled by default
It can be enabled with the -P (--iperfdata) option
2018-12-08 22:44:42 +01:00
Oliver Skibbe
d03a2a82b3 Revert "check_disk - show all disks if state is ok and option error only is used" 2016-11-21 13:26:28 +01:00
Oliver Skibbe
4430b63b0f Merge pull request #1436 from riskersen/check_disk_iss1420
check_disk - show all disks if state is ok and option error only is used
2016-11-19 16:35:50 +01:00
Sven Nierlein
5ebc24d998 Merge pull request #1312 from waja/check_disk_remove_unused_variables
check_disk: remove unused variables
2016-11-07 23:07:16 +01:00
Oliver Skibbe
5663b03717 check_disk - show all disks if state is ok and option error only is used
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
2016-11-04 11:35:12 +01:00
Klaus Ethgen
23436a1851 Fixing the stuff that is broken on btrfs
(Closes #1357)
2015-10-28 00:39:24 +01:00
Holger Weiss
11c5796d0a Revert "Don't let check_disk hang on hanging file systems"
This reverts commit 6986aa1d0a.  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.
2015-10-12 11:07:02 +02:00
Sven Nierlein
edca257e20 use unknown exit code for help/version in plugins
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2015-10-04 19:24:30 +02:00
Sebastian Herbszt
81b33d4514 check_disk: remove unused variables
Remove unused variables.

Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
2014-12-27 15:20:57 +01:00
Holger Weiss
0d14645cb0 check_disk: Seperate declarations from code 2014-11-30 11:33:20 +01:00
Holger Weiss
c0e6a6935b check_disk: Remove unused status variable
We didn't actually use the exit status provided by pthread_join(3) for
anything.
2014-11-30 11:30:36 +01:00
Holger Weiss
66f43f9934 check_disk: Fix pthread start routine type
The function pointer passed as third argument to pthread_create(3) must
be of type void *(*)(void *).
2014-11-28 23:55:03 +01:00
Gerhard Lausser
6986aa1d0a Don't let check_disk hang on hanging file systems 2014-11-28 22:08:08 +01:00
Jan Wagner
cbb507c89f check_disk: show troubled partition in verbose mode
I'm submitting a small patch to check_disk that will show which partitions are
actually causing the error state. This helps the human operator to quickly
identify the exact issue. I made it so a single -v flag is required so it
doesn't harm legacy code that may be parsing the original style of output.

Thanks to Jason Benguerel.
---
Closes #984
Closes #1182
2014-07-29 22:06:25 +02:00
Gunnar Beutner
1b3890572e Make check_disk work on Windows. 2014-04-27 19:59:06 +02:00
Jan Wagner
cb99931e43 check_disk: precise the help output
Clarifying in the help output that we need either a device or mount point
listed by the mount(8) command.

(Closes: #1118)
(Closes: #1170)
2014-01-28 12:07:48 +01:00
Thomas Guyot-Sionnest
11cf54ca78 Merge branch 'rename' 2014-01-21 07:59:07 -05:00
Spenser Reinhardt
66544851f7 plugins/*.c: Non-network timeout changes
Changes to non-network checks for clarity on timeout value. Adapted from pull request #1209 tracker from user awiddersheim. (Closes: #1209)
Files: check_apt.c, check_disk.c, check_procs.c, negate.c
2014-01-21 11:35:07 +01:00
Spenser Reinhardt
212575b858 plugins/*.c: Alterations for timeout messages.
.c file changes for misleading timeout messages in help functions. Solution to pull request #1209 tracker by awiddersheim.

Files: plugins/check_apt.c, plugins/check_by_ssh.c, plugins/check_dbi.c, plugins/check_dig.c, plugins/check_disk.c, plugins/check_dns.c, plugins/check_game.c, plugins/check_http.c, plugins/check_ldap.c, plugins/check_ntp.c, plugins/check_ntp_peer.c, plugins/check_ntp_time.c, plugins/check_nwstat.c, plugins/check_overcr.c, plugins/check_pgsql.c, plugins/check_ping.c, plugins/check_procs.c, plugins/check_radius.c, plugins/check_real.c, plugins/check_smtp.c, plugins/check_snmp.c, plugins/check_ssh.c, plugins/check_tcp.c, plugins/check_time.c, plugins/check_ups.c, plugins/negate.c
2014-01-21 11:33:45 +01:00
Holger Weiss
c3e756a855 Capitalize "Monitoring" when it's the first word 2014-01-20 03:12:50 +01:00
Monitoring Plugins Development Team
63734f52ab Project rename initial commit.
This is an initial take at renaming the project to Monitoring Plugins.
It's not expected to be fully complete, and it is expected to break
things (The perl module for instance). More testing will be required
before this goes mainline.
2014-01-19 14:18:47 -05:00
Sven Nierlein
982cbeea00 check_disk: get_fs_usage hasn't been run if using groups
the reason why it still worked sometimes was fsu_blocks beeing uninitialized
which resulted in a true test sometimes.
2013-09-16 15:30:56 +02:00
Holger Weiss
efa9b0fc08 Merge branch 'master' of https://github.com/bugness-chl/nagios-plugins
* 'master' of https://github.com/bugness-chl/nagios-plugins:
  check_disk: option to ignore reserved space

Conflicts:
	plugins/check_disk.c
2013-08-26 23:23:55 +02:00