Module: check_mk
Branch: master
Commit: ac8999705155e36a16392dae1f46e00fcc172c3c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ac8999705155e3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Mar 9 10:57:50 2016 +0100
Added some missing comments in the plugins
---
agents/plugins/mk_db2.aix | 1 +
agents/plugins/mk_db2.linux | 89 ++++++++++++++++++++++---------------------
agents/plugins/mk_mongodb | 2 +
3 files changed, 48 insertions(+), 44 deletions(-)
diff --git a/agents/plugins/mk_db2.aix b/agents/plugins/mk_db2.aix
index 6ae1764..ed59cc3 100755
--- a/agents/plugins/mk_db2.aix
+++ b/agents/plugins/mk_db2.aix
@@ -1,4 +1,5 @@
#!/usr/bin/ksh
+# Monitor DB/2 databases on AIX
# $HOME/sqllib/db2profile
# This script can be called in two ways
diff --git a/agents/plugins/mk_db2.linux b/agents/plugins/mk_db2.linux
index 1004be6..cf1d0d5 100755
--- a/agents/plugins/mk_db2.linux
+++ b/agents/plugins/mk_db2.linux
@@ -1,4 +1,5 @@
#!/bin/bash
+# Monitor DB/2 databases on Linux
# $HOME/sqllib/db2profile
# This script can be called in two ways
@@ -157,49 +158,49 @@ WAITMAX
query_instances
exit 0
#else
- #### RUN CACHED #####
- function file_age {
- /usr/bin/perl -e 'if (! -f $ARGV[0]){die
"0000000"};$mtime=(stat($ARGV[0]))[9];print ($^T-$mtime);' "$1"
- }
-
- if [ ! -d $MK_VARDIR/cache ]; then mkdir -p $MK_VARDIR/cache ; fi
- CACHEFILE="$MK_VARDIR/cache/mk_db2.aix.cache"
- MAXAGE=1
-
- # Check if the creation of the cache takes suspiciously long and return
- # nothing if the age (access time) of $CACHEFILE.new is twice the MAXAGE
- if [ -e "$CACHEFILE.new" ] ; then
- AGE=$(file_age "$CACHEFILE.new")
- if [ $AGE -ge $((MAXAGE * 2)) ] ; then
- return
- fi
- fi
-
- # Check if the creation of the cache takes way to long and delete this file
- # The process might have crashed...
- # Since the processes are called with waitmax it is very unlikely that
- # there are still unwanted processes soiling the system.
- if [ -e "$CACHEFILE.new" ] ; then
- AGE=$(file_age "$CACHEFILE.new")
- if [ $AGE -ge $((MAXAGE * 10)) ] ; then
- rm "$CACHEFILE.new"
- fi
- fi
-
- # Check if cache file exists and is recent enough
- USE_CACHEFILE=""
- if [ -s "$CACHEFILE" ] ; then
- AGE=$(file_age "$CACHEFILE")
- if [ $AGE -le $MAXAGE ] ; then USE_CACHEFILE=1 ; fi
- # Output the file in any case, even if it is
- # outdated. The new file will not yet be available
- cat "$CACHEFILE"
- fi
-
- # Cache file outdated and new job not yet running? Start it
- if [ -z "$USE_CACHEFILE" -a ! -e "$CACHEFILE.new" ] ; then
- echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit 1 ;
./$0 query && mv \"$CACHEFILE.new\" \"$CACHEFILE\" || rm -f
\"$CACHEFILE\" \"$CACHEFILE.new\"" | nohup ksh 2>/dev/null
&
- fi
-fi
+# #### RUN CACHED #####
+# function file_age {
+# /usr/bin/perl -e 'if (! -f $ARGV[0]){die
"0000000"};$mtime=(stat($ARGV[0]))[9];print ($^T-$mtime);' "$1"
+# }
+#
+# if [ ! -d $MK_VARDIR/cache ]; then mkdir -p $MK_VARDIR/cache ; fi
+# CACHEFILE="$MK_VARDIR/cache/mk_db2.aix.cache"
+# MAXAGE=1
+#
+# # Check if the creation of the cache takes suspiciously long and return
+# # nothing if the age (access time) of $CACHEFILE.new is twice the MAXAGE
+# if [ -e "$CACHEFILE.new" ] ; then
+# AGE=$(file_age "$CACHEFILE.new")
+# if [ $AGE -ge $((MAXAGE * 2)) ] ; then
+# return
+# fi
+# fi
+#
+# # Check if the creation of the cache takes way to long and delete this file
+# # The process might have crashed...
+# # Since the processes are called with waitmax it is very unlikely that
+# # there are still unwanted processes soiling the system.
+# if [ -e "$CACHEFILE.new" ] ; then
+# AGE=$(file_age "$CACHEFILE.new")
+# if [ $AGE -ge $((MAXAGE * 10)) ] ; then
+# rm "$CACHEFILE.new"
+# fi
+# fi
+#
+# # Check if cache file exists and is recent enough
+# USE_CACHEFILE=""
+# if [ -s "$CACHEFILE" ] ; then
+# AGE=$(file_age "$CACHEFILE")
+# if [ $AGE -le $MAXAGE ] ; then USE_CACHEFILE=1 ; fi
+# # Output the file in any case, even if it is
+# # outdated. The new file will not yet be available
+# cat "$CACHEFILE"
+# fi
+#
+# # Cache file outdated and new job not yet running? Start it
+# if [ -z "$USE_CACHEFILE" -a ! -e "$CACHEFILE.new" ] ; then
+# echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit 1 ;
./$0 query && mv \"$CACHEFILE.new\" \"$CACHEFILE\" || rm -f
\"$CACHEFILE\" \"$CACHEFILE.new\"" | nohup ksh 2>/dev/null
&
+# fi
+#fi
exit 0
diff --git a/agents/plugins/mk_mongodb b/agents/plugins/mk_mongodb
index 74bce98..a61e8ad 100755
--- a/agents/plugins/mk_mongodb
+++ b/agents/plugins/mk_mongodb
@@ -1,4 +1,6 @@
#!/usr/bin/python
+# Monitor MongoDB on Linux
+
import sys
import time
import pprint