Need help on how to pass arguments for check_memory
Posted: Thu Sep 26, 2019 1:12 pm
Hello,
I'm trying to configure check_memory for a Windows server (nsclient++). It works fine on the command line
./check_nrpe -H <xxxx> -c check_memory -a "warn=used>95%" "crit=used>98%"
but it does not work as a define command and service. I've tried using escape character and also putting the arguments in double quotes but it's not working. It works fine as default (without any arguments). I've also tried to passing the arguments from define service but same issue. I think it has something to do with the = sign. When editing the commands.cfg file, everything after the = sign (=used>95% crit=used>98%") is red. I need help on how to pass arguments for check_memory. Thanks.
define service{
host_name xxxxxxxxxxxxx
...
check_command check_nrpe!check_memory
}
Working: no arguments
define command{
command_name check_memory
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_memory
}
Not working: with arguments. (looks like it skips everything after -a. I've tried -a type=physical but it doesn't work either)
define command{
command_name check_memory
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_memory -a "warn=used>95% crit=used>98%"
}
I'm trying to configure check_memory for a Windows server (nsclient++). It works fine on the command line
./check_nrpe -H <xxxx> -c check_memory -a "warn=used>95%" "crit=used>98%"
but it does not work as a define command and service. I've tried using escape character and also putting the arguments in double quotes but it's not working. It works fine as default (without any arguments). I've also tried to passing the arguments from define service but same issue. I think it has something to do with the = sign. When editing the commands.cfg file, everything after the = sign (=used>95% crit=used>98%") is red. I need help on how to pass arguments for check_memory. Thanks.
define service{
host_name xxxxxxxxxxxxx
...
check_command check_nrpe!check_memory
}
Working: no arguments
define command{
command_name check_memory
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_memory
}
Not working: with arguments. (looks like it skips everything after -a. I've tried -a type=physical but it doesn't work either)
define command{
command_name check_memory
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_memory -a "warn=used>95% crit=used>98%"
}