NagiosEnterprises / nrpe

NRPE Agent
GNU General Public License v2.0
257 stars 133 forks source link

nrpe agent not passing command arguments when enabled #252

Open MrPippin66 opened 3 years ago

MrPippin66 commented 3 years ago

Platform: AIX 7100-05-06-2016 NRPE agent version: nagios-nrpe-4.0.3-1.ppc

When agent is configured to accept command arguments, none are actually being seen to the called command.

Option is configured for agent. During runtime, following seen in logs.

Warning: Daemon is configured to accept command arguments from clients!

However, looking at source code, I'm unsure how arguments could be seen to commands as shows in the following code segment current nrpe.c file.

This is being set to the command arguments:

#ifdef ENABLE_COMMAND_ARGUMENTS ptr = strtok(buff, "!"); #else

But...during the actual parsing of arguments, you're looking at this 'ptr' value:

#ifdef ENABLE_COMMAND_ARGUMENTS /* get command arguments */ if (allow_arguments == TRUE) { for (x = 0; x < MAX_COMMAND_ARGUMENTS; x++) { ptr = strtok(NULL, "!"); if (ptr == NULL) break;

That's ultimately going to have 'ptr' = NULL, and not any actual argument.