Check_procs --ereg-argument-array square brackets


I am trying to use the regex switch on the check_procs command but it is unable to pass square brackets from Nagios

nrpe.cfg contains this-

command[check_procs_ereg]=/usr/lib64/nagios/plugins/check_procs -c 1:1 --ereg-argument-array="$ARG1$"

When I send this command-

/usr/local/nagios/libexec/check_nrpe -H hostname -c check_procs_ereg -a "^[1]1mds.*"

I get this-

CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

If I remove the square brackets it works fine-

PROCS CRITICAL: 0 processes with regex args '^l1mds.*' | procs=0;;1:1;0;

I’ve tried escaping the brackets like this-

/usr/local/nagios/libexec/check_nrpe -H hostname -c check_procs_ereg -a "^\[l\]1mds.*"

But I get the same issue

Any ideas how to pass square brackets as a variable?


Is this a NSClient++ question? Looks like regular NRPE to me?