Hello,
I've created a custom command in Icinga 2 using this plugin:
https://github.com/justintime/nagios-plugins/blob/master/check_mem/check_mem.pl
check_command
object CheckCommand "memory" {
import "plugin-check-command"
command = [ PluginDir + "/check_mem" ]
arguments = {
"-w" = {
required = true
value = "$mem_warning$"
}
"-c" = {
required = true
value = "$mem_critical$"
}
"-u" = {
required = true
value = "$mem_used$"
}
"-C" = "$mem_cache$"
}
vars.mem_used = true
vars.mem_cache = true
vars.mem_warning = 85
vars.mem_critical = 95
}
service
apply Service "Memory" {
import "generic-service"
check_command = "memory"
assign where host.address
}
However the plugin cannot check the memory and gives the following output in Icinga Web 2 interface:
Plugin Output
*** You must define WARN and CRITICAL levels! \ncheck_mem.pl v1.0 - Nagios Plugin\n\nusage:\n check_mem.pl -\ncheck_mem.pl comes with absolutely NO WARRANTY either implied or explicit\nThis program is licensed under the terms of the\nMIT License (check source code for details)
Could you please help, what is wrong with this check?