From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- .../405415-0001-check_ssh-add-perfdata.patch | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 web/attachments/405415-0001-check_ssh-add-perfdata.patch (limited to 'web/attachments/405415-0001-check_ssh-add-perfdata.patch') diff --git a/web/attachments/405415-0001-check_ssh-add-perfdata.patch b/web/attachments/405415-0001-check_ssh-add-perfdata.patch new file mode 100644 index 0000000..a724a29 --- /dev/null +++ b/web/attachments/405415-0001-check_ssh-add-perfdata.patch @@ -0,0 +1,42 @@ +From 9e3ec39e4388677d2b4fdf7730384e49778aeee9 Mon Sep 17 00:00:00 2001 +From: Marco Beck +Date: Mon, 7 Feb 2011 16:21:07 +0100 +Subject: [PATCH] check_ssh: add perfdata + +--- + plugins/check_ssh.c | 11 +++++++++-- + 1 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c +index 2509b86..20e3f16 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, FALSE, 0)); + close(sd); + exit (STATE_OK); + } +-- +1.7.3.5 + -- cgit v1.2.3-74-g34f1