I trying to use by_ssh to run a script from the remote. I Created a user “xxx” in both server1 and server2.
Also configured the ssh , I am able to login to server2 from server1 as “xxx” user without password.
I created the below simple by_ssh server to run a basic script but it fails with “Remote command execution failed: Host key verification failed” Error.
template Host "ssh-agent" {
check_command = "hostalive"
vars.agent_type = "ssh"
vars.os_type = "linux"
}
object Host "qa Abilash" {
import "ssh-agent"
address = "10.**.**.244"
}
apply Service "Testing qa from prod" {
check_command = "by_ssh"
vars.by_ssh_command = [ "./ping" ]
vars.by_ssh_logname = "testprod"
vars.by_ssh_identity = "/home/testprod/.ssh/id_rsa"
assign where host.vars.os_type == "linux" && host.vars.agent_type == "ssh"
}
What am I missing?