你好,
我使用这个插件在 Icinga 2 中创建了一个自定义命令:
https://github.com/justintime/nagios-plugins/blob/master/check_mem/check_mem.pl </p>
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
}
服务
apply Service "Memory" {
import "generic-service"
check_command = "memory"
assign where host.address
}
但是插件无法检查内存并在 Icinga Web 2 界面中给出以下输出:
插件输出
*** 您必须定义 WARN 和 CRITICAL 级别!\ncheck_mem.pl v1.0 - Nagios 插件\n\nusage:\n check_mem.pl -\ncheck_mem.pl 绝对没有暗示或明确的保证\n此程序已获得许可根据\nMIT 许可条款(查看源代码了解详情)
你能帮忙,这个检查有什么问题吗?