root@juju-da6b2f-nrpe-0:/home/ubuntu# sudo -u nagios $command
usage: check_reboot.py [-h] known_reboot_time
check_reboot.py: error: argument known_reboot_time: time must be in format yyyy-mm-dd HH:MM:SS, same as output from `uptime --since`.
root@juju-da6b2f-nrpe-0:/home/ubuntu# echo $command |xargs sudo -u nagios
OK: system is up since 2022-05-03 05:12:03
This is about the way bash passes args and quotes.
Looking at the action script (which is written in bash):
root@juju- da6b2f- nrpe-0: /home/ubuntu# check=check_reboot da6b2f- nrpe-0: /home/ubuntu# nrpedir= "/etc/nagios/ nrpe.d" da6b2f- nrpe-0: /home/ubuntu# checkfile= "$nrpedir/ ${check} .cfg" da6b2f- nrpe-0: /home/ubuntu# command=$(awk -F "=" '{ print $2 }' $checkfile) da6b2f- nrpe-0: /home/ubuntu# echo $command lib/nagios/ plugins/ check_reboot. py "2022-05-03 05:12:03"
root@juju-
root@juju-
root@juju-
root@juju-
/usr/local/
root@juju- da6b2f- nrpe-0: /home/ubuntu# sudo -u nagios $command
usage: check_reboot.py [-h] known_reboot_time
check_reboot.py: error: argument known_reboot_time: time must be in format yyyy-mm-dd HH:MM:SS, same as output from `uptime --since`.
root@juju- da6b2f- nrpe-0: /home/ubuntu# echo $command |xargs sudo -u nagios
OK: system is up since 2022-05-03 05:12:03
This is about the way bash passes args and quotes.