summaryrefslogtreecommitdiffstats
path: root/plugins/check_swap.c
AgeCommit message (Collapse)AuthorFilesLines
2022-09-11Check swap compiler warnings (#1756)Lorenz1-6/+3
* Fix compiler warnings * Fix superfluous whitespaces
2022-07-25check_swap: Fix unit for total in perfdata (#1779)Lorenz1-11/+11
* check_swap: Fix unit for total in perfdata * Remove trailing whitespaces
2022-07-25fix parsing swap values (#1780)Sven Nierlein1-1/+1
tmp_KB changed from float to uint64, so change the sscanf format accordingly.
2022-01-03Rename tmp variable to get even with masterrefs/pull/1642/headLorenz Kästle1-4/+4
2022-01-03Merge branch 'master' into masterLorenz1-118/+157
2021-11-24More wrong printf formattingrefs/pull/1729/headRincewindsHat1-1/+1
2021-11-24Fix CodeQL checksRincewindsHat1-1/+1
2021-11-18Small fix to threshold validation and style (indentation) fixesrefs/pull/1723/headRincewindsHat1-20/+23
2021-10-02Revert to poor man's logicrefs/pull/1707/headRincewindsHat1-7/+6
2021-10-02Change all to comments to old comment styleRincewindsHat1-3/+4
2021-09-25Fix comparing logicRincewindsHat1-2/+2
2021-09-25check_swap: Fix perfdata und thresholds for big values and simplify coderincewind1-102/+137
The original problem was https://github.com/monitoring-plugins/monitoring-plugins/pull/1705 where the performance data output of check_swap did not conform to the parser logic of a monitoring system (which decided to go for "correct" SI or IEC units. The PR was accompanied by a change to byte values in the performance data which broke the _perfdata_ helper function which could not handle values of this size. The fix for this, was to use _fperfdata_ which could, but would use float values. I didn't like that (since all values here are discreet) and this is my proposal for a fix for the problem. It introduces some helper functions which do now explicitely work with (u)int64_t, including a special version of the _perfdata_ helper. In the process of introducing this to check_swap, I stumbled over several sections of the check_swap code which I found problematic. Therefore I tried to simplify the code and make it more readable and less redundant. I am kinda sorry about this, but sincerely hope my changes can be helpful.
2020-08-18check_swap: Handle cached swapmdavranche1-2/+5
2017-05-31repaired "-n" behaviour. If run with "-n ok" a host which ranrefs/pull/1491/headChristopher Odenbach1-8/+8
completely out of swap space would return "ok" which is not desired. It should only return "ok" if there is no swap space configured at all.
2015-10-04use unknown exit code for help/version in pluginsSven Nierlein1-2/+2
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2014-10-19Improving output when swap space has zero sizeJan Wagner1-0/+1
2014-10-19check_swap - fix commentDavide Madrisan1-1/+1
Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
2014-02-20check_swap: Fix the plugin name that appears in the commentDavide Madrisan1-1/+1
Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
2014-01-29Update check_swap usageThomas Guyot-Sionnest1-3/+4
2014-01-29check_swap: add supports for a configurable state when there is no swapThomas Guyot-Sionnest1-2/+13
Check_swap used to allow no swap when thresholds were only specified in percent. This is no longer the case and the state now must be specified explicitly. The default is to always return CRITICAL when the swap is absent regardless of thresholds.
2014-01-29Fix check_swap returning OK on & thresholds and no swapThomas Guyot-Sionnest1-1/+1
Return 0% free instead of 100% free when total swap is 0
2014-01-20Capitalize "Monitoring" when it's the first wordHolger Weiss1-1/+1
2014-01-19Project rename initial commit.Monitoring Plugins Development Team1-3/+3
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.
2012-06-29Die when asprintf failsAnders Kaseorg1-8/+8
Fixes many instances of warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2010-04-22Add newline after "Usage:" in --helpThomas Guyot-Sionnest1-1/+1
2010-04-22Standardize the extra-opts notesThomas Guyot-Sionnest1-5/+0
2010-04-14Fix translations when extra-opts aren't enabledThomas Guyot-Sionnest1-5/+5
Bug #2832884 reported problem with translations outputting pot file headers. This is caused by "" matching the header of the translation files. This patch moves gettext macros inside utils macros and update some french translations.
2008-11-23Removing CVS/SVN tags and replacing with git-based versioningThomas Guyot-Sionnest1-6/+2
For contrib/, full tags have been imported from subversion git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2091 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-19Bulk EOL cleanupThomas Guyot-Sionnest1-1/+1
$ git diff --ignore-space-change|diffstat 0 files changed git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2087 f882894a-f735-0410-b71e-b25c423dba1c
2008-05-07Added support for --extra-opts in all C plugins (disabled by default, see ↵Thomas Guyot-Sionnest1-0/+9
configure --help) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1991 f882894a-f735-0410-b71e-b25c423dba1c
2008-04-27--help output cleanup (plus removal of spaces on blank lines)Thomas Guyot-Sionnest1-2/+3
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1984 f882894a-f735-0410-b71e-b25c423dba1c
2008-01-31Bump plugin/ to GPLv3 (check_overcr to check_users)Thomas Guyot-Sionnest1-19/+17
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1917 f882894a-f735-0410-b71e-b25c423dba1c
2007-12-10Plenty of french translations (and a few fixes BTW)Thomas Guyot-Sionnest1-2/+1
- No more fuzzy french translations - Only (!) 355 strings to translate git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1859 f882894a-f735-0410-b71e-b25c423dba1c
2007-02-07Include <sys/param.h> before <sys/swap.h> in order to fix compilation onHolger Weiss1-3/+3
OpenBSD (nsturm - 1653934) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1613 f882894a-f735-0410-b71e-b25c423dba1c
2007-01-28Don't try to print `optarg' (which will be a NULL pointer) if an unknownHolger Weiss1-1/+1
command line option was used, as this leads to a segfault on some systems. The unknown option will be printed by getopt(3) anyway. So, simply call print_usage() and exit UNKNOWN via the new usage5() instead. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1590 f882894a-f735-0410-b71e-b25c423dba1c
2006-12-07Fix coredump on 64bit Solaris. Also adds more error conditions and movesTon Voon1-5/+32
swap specific includes out of common.h (Duncan Ferguson - 1588031) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1546 f882894a-f735-0410-b71e-b25c423dba1c
2006-10-19another round of localization cleaningBenoit Mortier1-46/+54
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1509 f882894a-f735-0410-b71e-b25c423dba1c
2006-03-13fix for (tracker id 1420741)M. Sean Finney1-2/+2
"check_swap: incorrect totals for multiple partitions (BSD)" thanks to scott thompson git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1323 f882894a-f735-0410-b71e-b25c423dba1c
2005-11-09Problem where absolute thresholds not working on /proc/meminfoTon Voon1-87/+94
systems. Suffixed all variables with the unit of measurement git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1278 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-31code cleanups, largely resulting from turning on -Wall. mostlyM. Sean Finney1-2/+2
unused variables and explicit casting issues, but there were a couple gotchas in there too. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1267 f882894a-f735-0410-b71e-b25c423dba1c
2005-09-15- Cleanup minor compile errors on IrixTon Voon1-2/+0
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1222 f882894a-f735-0410-b71e-b25c423dba1c
2005-07-06Updated help file to remove swap -s reference (Sivakumar Nellurandi)Ton Voon1-4/+0
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1200 f882894a-f735-0410-b71e-b25c423dba1c
2005-06-29divide by 0 fix for check_swapM. Sean Finney1-1/+7
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1196 f882894a-f735-0410-b71e-b25c423dba1c
2005-06-28scanf parsing fix for check_swap from tracker id 1123292. now use floor(3)M. Sean Finney1-8/+10
to round down floating point numbers. requires -lm on many systems, so support for testing for this was added to the configure.in and automake template git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1194 f882894a-f735-0410-b71e-b25c423dba1c
2005-06-26"asprintf madness" fix from andreas' patch to np-d, minus the comments.M. Sean Finney1-13/+11
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1190 f882894a-f735-0410-b71e-b25c423dba1c
2005-01-19Fixed parsing of AIX lsps command (1093522)Ton Voon1-1/+1
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1084 f882894a-f735-0410-b71e-b25c423dba1c
2005-01-13Use floats for holding memory values to avoid different types on differentTon Voon1-24/+27
OSes. Seems to have a problem with the perf data for check_swap on Sol 2.6, but not critical git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1080 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-30more internationalization fixesBenoit Mortier1-5/+5
internationalization freeze for beta1 git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1067 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-25various fixes for localizationBenoit Mortier1-6/+4
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1061 f882894a-f735-0410-b71e-b25c423dba1c
2004-12-05fix patch 998291Benoit Mortier1-1/+1
fix patch 1078934 expect check_ssh fix and check_nt perfdata should stay on one word like in nagios git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1004 f882894a-f735-0410-b71e-b25c423dba1c