nrpe -a works for SOME plugins but not all and not for test
Posted: Fri Dec 11, 2020 2:16 pm
I am on a closed network, so safely enabling "dont_blame_nrpe=1" (no need for the usual concerns)
I disabled all the "hardcoded" commands (predefined with parameters, enabled all as soft-coded with "$ARG1$", because I will be monitoring different remote systems with different values and don't want to have to hard-code separate remote cfg files for for each one.
(Note: Some are various-model Raspberry Pi, some are various-config x86 Linux boxes)
Two of my four remote commands work, two do not.
These two (in the remote config)...
...work with (in the server config)...
However, these two...
...with...
...do not work, they give a "Could not parse arguments" error. (for -p I've tried with and without the double-quotes, I just prefer with quotes for consistency with other checks I do)
Locally (on the remote server, they work fine:
...both work, for example.
Due to the code above not working, I'd normally diagnose from the command line.
However, either I'm just not getting the syntax correct to place the test remote call with parameters or "something else is wrong". From the server:
...works
(or whatever I try)
...works in producing a response, e.g....
I try with check_procs as well...
But I can't seem to pass parameters to ANY remote plugins. Even...
...gives a strange error of...
I get a similar response for any way I pass parameters - always a "command 'check_procs!(whatever else)' not defined.
It's almost as if the "-a" parameter is not being interpreted properly in some way, or I can't figure out how to pass parameters with it.
Yet it works fine for two of the commands from the serve console... (but, again, not in command line due to the -a issue).
I've even tried coding the parameters on the remotes as advised by https://support.nagios.com/kb/article/n ... s-759.html as "more secure", but I still get the "-a"-related issue.
Appreciate thoughts on how to proceed...
I disabled all the "hardcoded" commands (predefined with parameters, enabled all as soft-coded with "$ARG1$", because I will be monitoring different remote systems with different values and don't want to have to hard-code separate remote cfg files for for each one.
(Note: Some are various-model Raspberry Pi, some are various-config x86 Linux boxes)
Two of my four remote commands work, two do not.
These two (in the remote config)...
Code: Select all
command[check_rasp_temp]=/usr/lib/nagios/plugins/check_rasp_temp $ARG1$
command[check_procs]=/usr/lib/nagios/plugins/check_procs $ARG1$
Code: Select all
check_command check_nrpe!check_rasp_temp!'-w 50 -c 60'
check_command check_nrpe!check_procs!'-w 50 -c 100 RSZDT'
Code: Select all
command[check_disk]=/usr/lib/nagios/plugins/check_disk $ARG1$
command[check_load]=/usr/lib/nagios/plugins/check_load $ARG1$Code: Select all
check_command check_nrpe!check_disk!'-w 20 -c 10 -p "/"'
check_command check_nrpe!check_load!'-r -w 1.0,1.0,1.0 -c 2.0,2.0,2.0'Locally (on the remote server, they work fine:
Code: Select all
./check_procs -w 50 -c 100 RSZDT
./check_disk -w 20 -c 10 -p "/"Due to the code above not working, I'd normally diagnose from the command line.
However, either I'm just not getting the syntax correct to place the test remote call with parameters or "something else is wrong". From the server:
Code: Select all
./check_nrpe -H 192.168.86.43 -t 30Code: Select all
./check_nrpe -H 192.168.86.43 -t 30 -c check_users...works in producing a response, e.g....
Code: Select all
Usage: check_users -w <users> -c <users>
Code: Select all
./check_nrpe -H 192.168.86.43 -t 30 -c 'check_procs'
PROCS OK: 159 processes | procs=159;;;0;Code: Select all
./check_nrpe -H 192.168.86.43 -t 30 -c check_users -a (anything)Code: Select all
NRPE: Command 'check_users!' not definedIt's almost as if the "-a" parameter is not being interpreted properly in some way, or I can't figure out how to pass parameters with it.
Yet it works fine for two of the commands from the serve console... (but, again, not in command line due to the -a issue).
I've even tried coding the parameters on the remotes as advised by https://support.nagios.com/kb/article/n ... s-759.html as "more secure", but I still get the "-a"-related issue.
Appreciate thoughts on how to proceed...