From 547fc17d8d286749c95ed781ca53083504a5601c Mon Sep 17 00:00:00 2001 From: Dain Nilsson Date: Fri, 9 Jan 2015 13:28:47 +0100 Subject: [PATCH] Added link to upgrade.yubico.com --- Makefile | 6 ++- doc/Getting_Started_Writing_Clients.adoc | 3 +- ykval-nagios-queuelength.1 | 53 ++++++++++++++++++++ ykval-nagios-queuelength.php | 63 ++++++++++++++++++++++++ 4 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 ykval-nagios-queuelength.1 create mode 100755 ykval-nagios-queuelength.php diff --git a/Makefile b/Makefile index 424be70..11e5970 100644 --- a/Makefile +++ b/Makefile @@ -38,10 +38,11 @@ CODE = COPYING Makefile NEWS README ykval-checksum-clients \ MANS = ykval-queue.1 ykval-import.1 ykval-export.1 \ ykval-import-clients.1 ykval-export-clients.1 \ ykval-checksum-clients.1 ykval-checksum-deactivated.1 \ - ykval-synchronize.1 ykval-gen-clients.1 + ykval-synchronize.1 ykval-gen-clients.1 ykval-nagios-queuelength.1 MUNIN = ykval-munin-ksmlatency.php ykval-munin-vallatency.php \ ykval-munin-queuelength.php ykval-munin-responses.pl \ ykval-munin-yubikeystats.php ykval-munin-ksmresponses.pl +NAGIOS= ykval-nagios-queuelength.php DOCS = doc/Generating_Clients.adoc doc/Getting_Started_Writing_Clients.adoc \ doc/Import_Export_Data.adoc doc/Installation.adoc doc/Make_Release.adoc \ doc/Munin_Probes.adoc doc/Revocation_Service.adoc \ @@ -83,6 +84,7 @@ install: install -D ykval-import-clients $(DESTDIR)$(sbinprefix)/ykval-import-clients install -D ykval-checksum-clients $(DESTDIR)$(sbinprefix)/ykval-checksum-clients install -D ykval-checksum-deactivated $(DESTDIR)$(sbinprefix)/ykval-checksum-deactivated + install -D ykval-nagios-queuelength.php $(DESTDIR)$(sbinprefix)/ykval-nagios-queuelength install -D ykval-queue.1 $(DESTDIR)$(manprefix)/ykval-queue.1 install -D ykval-synchronize.1 $(DESTDIR)$(manprefix)/ykval-synchronize.1 install -D ykval-import.1 $(DESTDIR)$(manprefix)/ykval-import.1 @@ -122,7 +124,7 @@ PROJECT = $(PACKAGE) $(PACKAGE)-$(VERSION).tgz: $(FILES) mkdir $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION)/doc - cp $(CODE) $(MANS) $(MUNIN) $(PACKAGE)-$(VERSION)/ + cp $(CODE) $(MANS) $(MUNIN) $(NAGIOS) $(PACKAGE)-$(VERSION)/ cp $(DOCS) $(PACKAGE)-$(VERSION)/doc/ git2cl > $(PACKAGE)-$(VERSION)/ChangeLog tar cfz $(PACKAGE)-$(VERSION).tgz $(PACKAGE)-$(VERSION) diff --git a/doc/Getting_Started_Writing_Clients.adoc b/doc/Getting_Started_Writing_Clients.adoc index eb99b94..067101b 100644 --- a/doc/Getting_Started_Writing_Clients.adoc +++ b/doc/Getting_Started_Writing_Clients.adoc @@ -25,7 +25,8 @@ shared key to further authenticate response signatures from Yubico. If you for some reason do not want to rely on HTTPS. You may also sign requests using this API key. -To get an API key, first use our online API key generator. It will +To get an API key, first use +https://upgrade.yubico.com/getapikey/[our online API key generator]. It will assign you an ID and create a shared key. You can use the shared key to authenticate that the API responses do come from Yubico. diff --git a/ykval-nagios-queuelength.1 b/ykval-nagios-queuelength.1 new file mode 100644 index 0000000..7f82a6d --- /dev/null +++ b/ykval-nagios-queuelength.1 @@ -0,0 +1,53 @@ +.\" Copyright (c) 2015 Yubico AB +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions are +.\" met: +.\" +.\" * Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" +.\" * Redistributions in binary form must reproduce the above +.\" copyright notice, this list of conditions and the following +.\" disclaimer in the documentation and/or other materials provided +.\" with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" The following commands are required for all man pages. +.de URL +\\$2 \(laURL: \\$1 \(ra\\$3 +.. +.if \n[.g] .mso www.tmac +.TH ykval-nagios-queuelength "1" "February 2015" "yubico-val" +.SH NAME +ykval-nagios-queuelength - Check the current sync queuelength for the +yubikey-val server. +.SH SYNOPSIS +.B ykval-nagios-queuelength +.SH DESCRIPTION +Checks the length of the current yubikey-val queuelength. Made to be used +with the service nrpe and nagios. + +Database configuration is read from /etc/yubico/val/ykval-config.php +.SH BUGS +Report ykval-nagios-queuelength bugs in +.URL "https://github.com/Yubico/yubikey-val/issues" "the issue tracker" +.SH "SEE ALSO" +The +.URL "https://developers.yubico.com/yubikey-val/Server_Replication_Protocol.html" "Server Replication Protocol" +.PP +YubiKeys can be obtained from +.URL "http://www.yubico.com/" "Yubico" "." + diff --git a/ykval-nagios-queuelength.php b/ykval-nagios-queuelength.php new file mode 100755 index 0000000..2e51c65 --- /dev/null +++ b/ykval-nagios-queuelength.php @@ -0,0 +1,63 @@ +#!/usr/bin/php +getQueueLength (); + +$message = "Queue length is $len"; + +if($len > $critical) { + print("CRITICAL: $message\n"); + exit (2); +} elseif($len > $warning) { + print("WARNING: $message\n"); + exit (1); +} else { + print("OK: $message\n"); + exit (0); +} + +?>