[nagiosplug] Add perfdata to check_ssh (#3244097 - Marco Beck)
"Thomas Guyot-Sionnest" <[email protected]> Sat, 26 Mar 2011 19:45:27 +0000
| Newsgroups | gmane.network.nagios.plugins.cvs |
|---|---|
| Message-ID | <[email protected]> |
Module: nagiosplug Branch: master Commit: 1bc7a4a198aefde2389c9c1685baed0da7856bf5 Author: Thomas Guyot-Sionnest <[email protected]> Date: Sat Mar 26 15:44:38 2011 -0400 URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=1bc7a4a Add perfdata to check_ssh (#3244097 - Marco Beck) --- NEWS | 1 + THANKS.in | 1 + plugins/check_ssh.c | 11 +++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index d7fea27..fcaa9c1 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ This file documents the major additions and syntax changes between releases. check_disk_smb now allows spaces in share names (#990948, #1370031, Debian #601699) check_http now uses standard threshold functions (enables floating point and ranges) check_http now checks for and prints the certificate cn (hostname) in SSL certificate checks (Stéphane Urbanovski) + Add perfdata to check_ssh (#3244097 - Marco Beck) FIXES Fix check_disk free space calculation if blocksizes differ within a disk group (Bekar - #2973603) diff --git a/THANKS.in b/THANKS.in index 387a379..cb8d26c 100644 --- a/THANKS.in +++ b/THANKS.in @@ -267,3 +267,4 @@ Craig Leres Brian Landers Ryan Kelly Stéphane Urbanovski +Marco Beck diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c index 2509b86..3bbf44d 100644 --- a/plugins/check_ssh.c +++ b/plugins/check_ssh.c @@ -215,6 +215,10 @@ ssh_connect (char *haddr, int hport, char *remote_version) char *ssh_proto = NULL; char *ssh_server = NULL; static char *rev_no = VERSION; + struct timeval tv; + double elapsed_time; + + gettimeofday(&tv, NULL); result = my_tcp_connect (haddr, hport, &sd); @@ -250,9 +254,12 @@ ssh_connect (char *haddr, int hport, char *remote_version) exit (STATE_WARNING); } + elapsed_time = (double)deltime(tv) / 1.0e6; + printf - (_("SSH OK - %s (protocol %s)\n"), - ssh_server, ssh_proto); + (_("SSH OK - %s (protocol %s) | %s\n"), + ssh_server, ssh_proto, fperfdata("time", elapsed_time, "s", + FALSE, 0, FALSE, 0, TRUE, 0, TRUE, (int)socket_timeout)); close(sd); exit (STATE_OK); } ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ Nagiosplug-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagiosplug-checkins