summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@aei.ca>2011-03-26 19:44:38 (GMT)
committerThomas Guyot-Sionnest <dermoth@aei.ca>2011-03-26 19:44:38 (GMT)
commit1bc7a4a198aefde2389c9c1685baed0da7856bf5 (patch)
treefeba24065e48917034c759a2b055b83efeac3441
parentd16f3fb0a9bb37cc1ce73ef14b5de83e907ef23c (diff)
downloadmonitoring-plugins-1bc7a4a198aefde2389c9c1685baed0da7856bf5.tar.gz
Add perfdata to check_ssh (#3244097 - Marco Beck)
-rw-r--r--NEWS1
-rw-r--r--THANKS.in1
-rw-r--r--plugins/check_ssh.c11
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.
6 check_disk_smb now allows spaces in share names (#990948, #1370031, Debian #601699) 6 check_disk_smb now allows spaces in share names (#990948, #1370031, Debian #601699)
7 check_http now uses standard threshold functions (enables floating point and ranges) 7 check_http now uses standard threshold functions (enables floating point and ranges)
8 check_http now checks for and prints the certificate cn (hostname) in SSL certificate checks (Stéphane Urbanovski) 8 check_http now checks for and prints the certificate cn (hostname) in SSL certificate checks (Stéphane Urbanovski)
9 Add perfdata to check_ssh (#3244097 - Marco Beck)
9 10
10 FIXES 11 FIXES
11 Fix check_disk free space calculation if blocksizes differ within a disk group (Bekar - #2973603) 12 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
267Brian Landers 267Brian Landers
268Ryan Kelly 268Ryan Kelly
269Stéphane Urbanovski 269Stéphane Urbanovski
270Marco 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)
215 char *ssh_proto = NULL; 215 char *ssh_proto = NULL;
216 char *ssh_server = NULL; 216 char *ssh_server = NULL;
217 static char *rev_no = VERSION; 217 static char *rev_no = VERSION;
218 struct timeval tv;
219 double elapsed_time;
220
221 gettimeofday(&tv, NULL);
218 222
219 result = my_tcp_connect (haddr, hport, &sd); 223 result = my_tcp_connect (haddr, hport, &sd);
220 224
@@ -250,9 +254,12 @@ ssh_connect (char *haddr, int hport, char *remote_version)
250 exit (STATE_WARNING); 254 exit (STATE_WARNING);
251 } 255 }
252 256
257 elapsed_time = (double)deltime(tv) / 1.0e6;
258
253 printf 259 printf
254 (_("SSH OK - %s (protocol %s)\n"), 260 (_("SSH OK - %s (protocol %s) | %s\n"),
255 ssh_server, ssh_proto); 261 ssh_server, ssh_proto, fperfdata("time", elapsed_time, "s",
262 FALSE, 0, FALSE, 0, TRUE, 0, TRUE, (int)socket_timeout));
256 close(sd); 263 close(sd);
257 exit (STATE_OK); 264 exit (STATE_OK);
258 } 265 }