[Nagiosplug-devel] [ nagiosplug-Bugs-1252285 ] check_ssh reports critical for some SSH servers

SourceForge.net noreply at sourceforge.net
Thu Aug 4 17:00:52 CEST 2005


Bugs item #1252285, was opened at 2005-08-04 18:59
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1252285&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Interface (example)
Group: Release (specify)
Status: Open
Resolution: None
Priority: 5
Submitted By: TexasDavid (daupperle)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_ssh reports critical for some SSH servers

Initial Comment:
The check_ssh plugin reports STATE_CRITICAL for 
certain SSH servers.  As a result some valid SSH 
servers are reported down.  For example, the following 
is a valid response for a working SSH server:

sshd2: SSH Secure Shell 2.4.0 (non-commercial 
version) on hppa2.0n-hp-hpux11.00 

The problem lies on line 216 of check_ssh.c (Version 
1.27).  THe function strncmp should be replaced with 
strncasecmp.  Note: this change will not return the 
version properly, but it will return the state information.

The following changes will properly evaluate the above 
SSH server in more detail and probably should be 
applied to the patch.

216c216
<       if (strncmp (output, "SSH", 3)) {
---
>       if (strncasecmp (output, "SSH", 3)) {
224,227c224,237
<               ssh_proto = output + 4;
<               ssh_server = ssh_proto + strspn 
(ssh_proto, "-0123456789. ");
<               ssh_proto[strspn 
(ssh_proto, "0123456789. ")] = 0;
<
---
>                 if (strncmp(output,"sshd2",5)==0) {
>                    // Output(one line): sshd2: SSH Secure
>                    //    Shell 2.4.0 (non-commercial version)
>                    //    on hppa2.0n-hp-hpux11.00
>                    ssh_server = output + 7;
>                  ssh_server[strcspn 
(ssh_server, "0123456789")-1] = 0;
>                    ssh_proto = ssh_server + strlen
(ssh_server)+1;
>                  ssh_proto[strspn 
(ssh_proto, "0123456789. ")] = 0;
>                 }
>                 else { // Standard servers
>                 ssh_proto = output + 4;
>                 ssh_server = ssh_proto + strspn 
(ssh_proto, "-0123456789. ");
>                 ssh_proto[strspn 
(ssh_proto, "0123456789. ")] = 0;
>                 }


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1252285&group_id=29880




More information about the Devel mailing list