您好,如何进行这样的检查:
/usr/lib/nagios/plugins/check_nt -H 192.168.110.130 -p 12489 -s ****** -v COUNTER -l "\\Paging File(_Total)\\% Usage","Paging File usage is %.2f %%" -w 60 -c 90
我的实际检查命令如下所示:
object CheckCommand "check_windows_pagefile" {
import "plugin-check-command"
import "ipv4-or-ipv6"
command = [ PluginDir + "/check_nt" ]
arguments = {
"-H" = "$component_ip$"
"-p" = "12489"
"-s" = "$nsclient_password$"
"-v" = "COUNTER"
"-l" = "\"\\\\Paging File(_Total)\\\\% Usage\",\"Paging File usage is %.2f %%\""
"-w" = "60"
"-c" = "90"
}
}
但这让我只有“NSClient - 错误:命令返回无效:check_pdh”
但是,如果我执行第一个命令 bash 它可以工作。
这是 icinga2 的日志:
'/usr/lib/nagios/plugins/check_nt' '-H' '192.168.110.130' '-c' '90' '-l' '"\\Paging File(_Total)\\% Usage","Paging File usage is %.2f %%"' '-p' '12489' '-s' '******' '-v' 'COUNTER' '-w' '60'
这也不起作用:
'/usr/lib/nagios/plugins/check_nt' '-H' '192.168.110.130' '-c' '90' '-l' '\\Paging File(_Total)\\% Usage','Paging File usage is %.2f %%' '-p' '12489' '-s' '******' '-v' 'COUNTER' '-w' '60'
只有这样有效:
'/usr/lib/nagios/plugins/check_nt' '-H' '192.168.110.130' '-c' '90' '-l' "\\Paging File(_Total)\\% Usage","Paging File usage is %.2f %%" '-p' '12489' '-s' '******' '-v' 'COUNTER' '-w' '60'
有人在 check_nt 插件上使用 icinga2 和 counter 的经验吗?
如何解决单/双引号问题?