CHECK_SSH fails but works at command line

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
123host
Posts: 2
Joined: Wed Jul 01, 2015 7:38 pm

CHECK_SSH fails but works at command line

Post 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.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: CHECK_SSH fails but works at command line

Post by jdalrymple »

Is selinux enabled?

Is "connection refused" coming from the plugin or from NRPE? Try running check_nrpe without the -c argument.
123host
Posts: 2
Joined: Wed Jul 01, 2015 7:38 pm

Re: CHECK_SSH fails but works at command line

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: CHECK_SSH fails but works at command line

Post by tmcdonald »

I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked