Module: check_mk
Branch: master
Commit: c6feba59a40f94e88bbb45f173a03ab6b2f6163e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c6feba59a40f94…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Tue Feb 14 15:58:27 2012 +0100
Helper script for filtering livestatus into NSCA
---
doc/treasures/livestatus-to-nsca.sh | 51 +++++++++++++++++++++++++++++++++++
1 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/doc/treasures/livestatus-to-nsca.sh b/doc/treasures/livestatus-to-nsca.sh
new file mode 100644
index 0000000..e179f4e
--- /dev/null
+++ b/doc/treasures/livestatus-to-nsca.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2012 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at
http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# A helper script that build a bridge between modern livedump
+# for state export while still using legacy NSCA as transport.
+# if NSCA is not a strict requirement, walk on and try livedump!
+
+# Advantages:
+# - automagic detection of NSCA-enabled devices
+# - use one bulk transfer even with NCSA
+# - can run every minute
+
+# Disadvantages:
+# - still using NSCA
+# - still have to maintain the config on the NSCA receiver.
+
+
+# Edit these parameters and the livestatus path to match your submission config
+# or source them from your submit script.
+NagiosDir="/usr/local/nagios"
+NscaBin="$NagiosDir/libexec/send_nsca"
+NscaCfg="$NagiosDir/etc/send_nsca.cfg"
+LiveStatusPipe="$NagiosDir/var/rw/livestatus.cmd"
+NagiosHost="nagioshost"
+
+# Add obsess_over_host = 1 to your filter if you wish to supress superfluous hosts.
+echo "GET services
+Columns: host_name description state plugin_output
+Filter: obsess_over_service = 1" | unixcat $LiveStatusPipe | tr \; "\t" |
$NscaBin $NagiosHost -c $NscaCfg