I can SSH to the target server with no issues but icinga web shows the service as critical.
I have restarted icinga and ssh but the issue still persists.
Any ideas?
I have checked the logs on both the target server and the monitoring server but can’t find anything meaningful to assist with troubleshooting.
Do you run this with your (root) user or the icinga/nagios user?
what happens if you run the ssh command instead of check_ssh. By the way: if you run check_ssh with the parameter “--verbose”, you’ll see that this check runs ssh in the background.
And also very important: the host you want to connect must be in the known_hosts list. That means if it possible to run the check with the root user, than the server is in the list. If it is not possible to run this with the icinga/nagios-user that means, this user haven’t the server in its known_hosts list
What authentification you are using? Certs? Username/Password? This could also be a reason. If you use certs, maybe the icinga/nagios user is not allowed to access the certs.
For debugging I prefer to use the ssh command. Because here I saw in the past, the error messages are better than the output of check_ssh
I don’t believe this is the case. I have never had to manually accept a monitored server’s host key before check_ssh would work properly. Happy to be shown new info, just taking that from my own experience.
I believe the missing piece of information in this thread is still the output of the plugin when it fails. We can all look at the plugin’s code to see all of the possible ways in which it will return CRIT (including if it is not executable in the expected location).