Add new option `-a` to the `mem` CheckCommand (#9385)

* To the `mem` CheckCommand, add support for `check_mem.pl`'s new argument `-a`

`-a           Check AVAILABLE memory (only Linux)`

* Update documentation for the CheckCommand `mem` to include the new `mem_available` option
This commit is contained in:
Christopher Peterson 2022-06-22 06:52:11 -04:00 committed by GitHub
parent ff6cdc2c71
commit 286e84bb56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 7 deletions

View File

@ -3494,9 +3494,10 @@ compared to thresholds. More details can be found on [this blog entry](http://sy
Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
Name | Description
-------------|-----------------------------------------------------------------------------------------------------------------------
mem_used | **Optional.** Tell the plugin to check for used memory in opposite of **mem_free**. Must specify one of these as true.
mem_free | **Optional.** Tell the plugin to check for free memory in opposite of **mem_used**. Must specify one of these as true.
--------------|-----------------------------------------------------------------------------------------------------------------------
mem_used | **Optional.** Tell the plugin to check for used memory to the exclusion of **mem_free** and **mem_available**. Must specify one of these as true.
mem_free | **Optional.** Tell the plugin to check for free memory to the exclusion of **mem_used** and **mem_available**. Must specify one of these as true.
mem_available | **Optional.** Tell the plugin to check available memory to the exclusion of **mem_free** and **mem_used**. Must specify one of these as true.
mem_cache | **Optional.** If set to true, plugin will count cache as free memory. Defaults to false.
mem_warning | **Required.** Specify the warning threshold as number interpreted as percent.
mem_critical | **Required.** Specify the critical threshold as number interpreted as percent.

View File

@ -8,6 +8,10 @@ object CheckCommand "mem" {
set_if = "$mem_used$"
description = "Check USED memory"
}
"-a" = {
set_if = "$mem_available$"
description = "Check AVAILABLE memory"
}
"-f" = {
set_if = "$mem_free$"
description = "Check FREE memory"
@ -28,6 +32,7 @@ object CheckCommand "mem" {
vars.mem_used = false
vars.mem_free = false
vars.mem_available = false
vars.mem_cache = false
}