gpt4 book ai didi

monitoring - Icinga2 check_mem 插件不接受参数

转载 作者:行者123 更新时间:2023-12-04 14:29:29 26 4
gpt4 key购买 nike

您好,

我使用这个插件在 Icinga 2 中创建了一个自定义命令:

https://github.com/justintime/nagios-plugins/blob/master/check_mem/check_mem.pl

检查命令

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 许可证的条款(查看源代码了解详情)

请问这个支票有什么问题吗?

最佳答案

这适用于您的服务

object CheckCommand "memory" {
import "plugin-check-command"
command = [ PluginDir + "/check_mem.pl" ]

arguments = {
"-w" = {
value = "$mem_warning$"
}
"-c" = {
value ="$mem_critical$"
}
"-u" = {
set_if = "$mem_used$"
}
"-C" = {
set_if = "$mem_cache$"
}
}

vars.mem_warning = 85
vars.mem_critical = 95
vars.mem_used = true
vars.mem_cache = true
}

关于monitoring - Icinga2 check_mem 插件不接受参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37941475/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com