diff options
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2011-03-26 15:44:38 -0400 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2011-03-26 15:44:38 -0400 |
commit | 1bc7a4a198aefde2389c9c1685baed0da7856bf5 (patch) | |
tree | feba24065e48917034c759a2b055b83efeac3441 | |
parent | d16f3fb0a9bb37cc1ce73ef14b5de83e907ef23c (diff) | |
download | monitoring-plugins-1bc7a4a198aefde2389c9c1685baed0da7856bf5.tar.gz |
Add perfdata to check_ssh (#3244097 - Marco Beck)
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | THANKS.in | 1 | ||||
-rw-r--r-- | plugins/check_ssh.c | 11 |
3 files changed, 11 insertions, 2 deletions
@@ -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) |
@@ -267,3 +267,4 @@ Craig Leres | |||
267 | Brian Landers | 267 | Brian Landers |
268 | Ryan Kelly | 268 | Ryan Kelly |
269 | Stéphane Urbanovski | 269 | Stéphane Urbanovski |
270 | Marco Beck | ||
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c index 2509b860..3bbf44dc 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 | } |