Module: check_mk
Branch: master
Commit: 6a9d4ebbaae0cc7d2ae3eadbe74616e99d8d8c4a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6a9d4ebbaae0cc…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Sep 12 14:18:19 2014 +0200
Added script for makeing a statistics of used check plugins
---
doc/treasures/cmk-plugin-statistics | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/doc/treasures/cmk-plugin-statistics b/doc/treasures/cmk-plugin-statistics
new file mode 100755
index 0000000..ee2171b
--- /dev/null
+++ b/doc/treasures/cmk-plugin-statistics
@@ -0,0 +1,20 @@
+#!/bin/bash
+# This script makes a statistics of the usage of the various check plugins.
+# It makes a Livestatus-Connection and outputs a list of plugins and the
+# information on how many different hosts this plugin is being used.
+
+if [ "$OMD_ROOT" ] ; then
+ LIVE_SOCKET=$OMD_ROOT/tmp/run/live
+elif [ -z "$LIVE_SOCKET" ] ; then
+ echo "Please do an 'export
LIVE_SOCKET=/path/to/your/livestatus/socket'" >&2
+ echo "and then call me again." >&2
+ exit 1
+fi
+
+echo -e "GET services\nColumns: host_name check_command" \
+ | unixcat "$LIVE_SOCKET" \
+ | sort -u \
+ | cut -d\; -f2 \
+ | sort \
+ | uniq -c \
+ | sort -rn