Page 1 of 1

CHECK_SSH fails but works at command line

Posted: Wed Jul 01, 2015 7:45 pm
by 123host
Hey there

If I run the following command line it works:
# /usr/lib64/nagios/plugins/check_ssh -4 -p 1157 104.xxx.xxx.xxx
SSH OK - OpenSSH_5.3 (protocol 2.0) | time=0.132206s;;;0.000000;10.000000
However with the same command line in nrpe.cfg connection is always refused
command[check_remote_ssh]=/usr/lib64/nagios/plugins/check_ssh -4 -p 1157 104.xxx.xxx.xxx
From the GUI
Current Status: CRITICAL (for 2d 13h 11m 42s)
Status Information: Connection refused
Performance Data:
Current Attempt: 3/3 (HARD state)
Last Check Time: 07-02-2015 10:38:21
Check Type: ACTIVE
Check Latency / Duration: 0.164 / 0.361 seconds
Next Scheduled Check: 07-02-2015 10:48:21
Last State Change: 06-29-2015 21:29:35
Last Notification: 07-02-2015 10:18:28 (notification 4)
Is This Service Flapping? NO (0.00% state change)
In Scheduled Downtime? NO
Last Update: 07-02-2015 10:41:08 ( 0d 0h 0m 9s ago)
Active Checks: ENABLED
Passive Checks: ENABLED
Obsessing: ENABLED
Notifications: ENABLED
Event Handler: ENABLED
Flap Detection: ENABLED
I have no doubt it is a configuration issue, but I can't spot it. Any help is appreciated.

Re: CHECK_SSH fails but works at command line

Posted: Thu Jul 02, 2015 9:00 am
by jdalrymple
Is selinux enabled?

Is "connection refused" coming from the plugin or from NRPE? Try running check_nrpe without the -c argument.

Re: CHECK_SSH fails but works at command line

Posted: Thu Jul 02, 2015 4:18 pm
by 123host
This has now been resolved. I upgraded nagios from 3.5 which yum installed to 4.0.8 by uninstalling and starting from scratch, and it works.

Thanks for your help, all good now.

Re: CHECK_SSH fails but works at command line

Posted: Thu Jul 02, 2015 4:21 pm
by tmcdonald
I'll be closing this thread now, but feel free to open another if you need anything in the future!