I have some Photon OS VM machines in our environment (VMware appliance, not vCenter) and I want to monitor some checks with “check_by_ssh” command.
On the other VMs where I have Ubuntu for example the check are working great, only on the PhotonOS I got “Remote command execution failed”, the ssh session is also working.
For example if I want to get the uptime from the host with a simple command:
ssh nagios@ip-address uptime and i got the right uptime from the host
If I tryed with check_by_ssh method:
/usr/lib/nagios/plugins/check_by_ssh -H ip_address -l nagios -C “uptime”
Remote command execution failed:
I added for test purpose the “session required pam_exec.so /bin/true” to /etc/pam.d/sshd config but nothing changed, I think the os not allows to run commands remotely from ssh.
If I run the command from icinga server:
nagios@vcloud-mon01:~$ /usr/lib/nagios/plugins/check_by_ssh -H 10.102.36.191 -l nagios -C “uptime” -E “false”
08:47:04 up 186 days, 14:02, 2 users, load average: 0.15, 0.14, 0.10
But on the icinga web I the same error as originally:
Plugin Output
Remote command execution failed:
On the remote host for test purpose I added the nagios user to sudoers:
nagios ALL=(ALL:ALL) ALL