Add check_memory
This commit is contained in:
parent
53bd4e743a
commit
82ec5f8206
3 changed files with 55 additions and 0 deletions
|
@ -14,6 +14,7 @@
|
||||||
- monitoring-plugins-common
|
- monitoring-plugins-common
|
||||||
- monitoring-plugins-standard
|
- monitoring-plugins-standard
|
||||||
- monitoring-plugins-systemd
|
- monitoring-plugins-systemd
|
||||||
|
- monitoring-plugins-contrib
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Setup Icinga2 master
|
- name: Setup Icinga2 master
|
||||||
|
|
|
@ -10,3 +10,48 @@ object CheckCommand "check_systemd" {
|
||||||
import "systemd"
|
import "systemd"
|
||||||
command = [ PluginDir + "/check_systemd" ]
|
command = [ PluginDir + "/check_systemd" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object CheckCommand "memory" {
|
||||||
|
command = [ PluginDir + "/check_memory" ]
|
||||||
|
arguments = {
|
||||||
|
"-a" = {
|
||||||
|
set_if = "$memory_available$"
|
||||||
|
description = "Display the free/available memory"
|
||||||
|
}
|
||||||
|
"-b" = {
|
||||||
|
set_if = "$memory_output_b$"
|
||||||
|
description = "Show output in bytes"
|
||||||
|
}
|
||||||
|
"-k" = {
|
||||||
|
set_if = "$memory_output_k$"
|
||||||
|
description = "Show output in KB (the default)"
|
||||||
|
}
|
||||||
|
"-m" = {
|
||||||
|
set_if = "$memory_output_m$"
|
||||||
|
description = "Show output in MB"
|
||||||
|
}
|
||||||
|
"-g" = {
|
||||||
|
set_if = "$memory_output_g$"
|
||||||
|
description = "Show output in GB"
|
||||||
|
}
|
||||||
|
"-s" = {
|
||||||
|
set_if = "$memory_vmstats$"
|
||||||
|
description = "Display the virtual memory perfdata"
|
||||||
|
}
|
||||||
|
"-w" = {
|
||||||
|
value = "$memory_warn$"
|
||||||
|
description = "Warning threshold"
|
||||||
|
}
|
||||||
|
"-c" = {
|
||||||
|
value = "$memory_crit$"
|
||||||
|
description = "Critical threshold"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vars.memory_available = false
|
||||||
|
vars.memory_output_b = false
|
||||||
|
vars.memory_output_k = true
|
||||||
|
vars.memory_output_m = false
|
||||||
|
vars.memory_output_g = false
|
||||||
|
vars.memory_vmstats = false
|
||||||
|
}
|
||||||
|
|
|
@ -52,6 +52,15 @@ apply Service "load" {
|
||||||
assign where true
|
assign where true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apply Service "memory" {
|
||||||
|
import "generic-service"
|
||||||
|
check_command = "memory"
|
||||||
|
vars.memory_warn = "80%"
|
||||||
|
vars.memory_crit = "90%"
|
||||||
|
command_endpoint = host.name
|
||||||
|
assign where true
|
||||||
|
}
|
||||||
|
|
||||||
apply Service "procs" {
|
apply Service "procs" {
|
||||||
import "generic-service"
|
import "generic-service"
|
||||||
check_command = "procs"
|
check_command = "procs"
|
||||||
|
|
Loading…
Reference in a new issue