I am testing the new 4.0.3 agent and getting this weird problem
This is using 4.0.3 nrpe agent in RHEL8. It is mixing up the parameter with command.
Check using the old check_nrpe gives hints about the issue
[nagios@myucbdnagiapp01 libexec]$ ./check_nrpe -H localhost -c "rs_GetOSVersion"
Red Hat Enterprise Linux release 8.2 (Ootpa) x86_64 [myucbdnagiapp01] *NRPE v3.2.1*
[nagios@myucbdnagiapp01 libexec]$ ./check_nrpe -H localhost -c "rs_GetOSVersion" -a "linux"
CHECK_NRPE: Receive header underflow - only 0 bytes received (4 expected).
[nagios@myucbdnagiapp01 libexec]$ ./check_nrpe_v321r_rhel8 -H localhost -c "rs_GetOSVersion" -a "linux"
NRPE: Command 'rs_GetOSVersion!linux' not defined
[nagios@myucbdnagiapp01 libexec]$ ./check_nrpe_v321r_rhel7 -H localhost -c "rs_GetOSVersion" -a "linux"
NRPE: Command 'rs_GetOSVersion!linux' not defined
This is using 3.2.1r nrpe agent in RHEL8, it is working fine.
Here is the nrpe.cfg file[nagios@myucbdnagiapp01 libexec]$ ./check_nrpe_v321r_rhel7 -H localhost -c "rs_GetOSVersion"
Red Hat Enterprise Linux release 8.2 (Ootpa) x86_64 [myucbdnagiapp01] *NRPE v3.2.1*
[nagios@myucbdnagiapp01 libexec]$ ./check_nrpe_v321r_rhel7 -H localhost -c "rs_GetOSVersion" -a linux
Red Hat Enterprise Linux release 8.2 (Ootpa) x86_64 [myucbdnagiapp01] *NRPE v3.2.1*
#############################################################################
#
# NRPE Config File V3.0.1
#############################################################################
log_facility=daemon
log_file=/usr/local/nagios/nrpe.log
debug=0
pid_file=/usr/local/nagios/var/nrpe.pid
server_port=5666
#listen_queue_size=5
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=127.0.0.1,::1
dont_blame_nrpe=1
allow_bash_command_substitution=0
command_timeout=60
connection_timeout=300
command[rs_GetOSVersion]=/usr/local/nagios/libexec/rs_GetOSVersion $ARG1$