Add check_memory

This commit is contained in:
Tunui Franken 2025-02-09 11:25:08 +01:00
parent 53bd4e743a
commit 82ec5f8206
3 changed files with 55 additions and 0 deletions

View file

@ -14,6 +14,7 @@
- monitoring-plugins-common
- monitoring-plugins-standard
- monitoring-plugins-systemd
- monitoring-plugins-contrib
state: present
- name: Setup Icinga2 master

View file

@ -10,3 +10,48 @@ object CheckCommand "check_systemd" {
import "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
}

View file

@ -52,6 +52,15 @@ apply Service "load" {
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" {
import "generic-service"
check_command = "procs"