Module: check_mk
Branch: master
Commit: 9cb94544a822ebfb52538a71a5a50b4eab51c4bd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9cb94544a822eb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 2 12:06:53 2013 +0100
Solaris Agent: implement cached async plugins and local checks
The Solaris agent now supports the same method of asynchronously
executing local checks and plugins as the Linux agent. Simply
create directories below <tt>/usr/lib/check_mk_agent/local</tt>
and <tt>/usr/lib/check_mk_agent/plugins</tt> whose names are a
number of seconds (e.g. <tt>/usr/lib/check_mk_agent/plugins/3600</tt>).
The plugins in those subdirectories will be executed at most every
that number of seconds and also will be run in the background.
---
.werks/13 | 14 ++++++++++++++
ChangeLog | 1 +
2 files changed, 15 insertions(+)
diff --git a/.werks/13 b/.werks/13
new file mode 100644
index 0000000..248ec55
--- /dev/null
+++ b/.werks/13
@@ -0,0 +1,14 @@
+Title: Solaris Agent: implement cached async plugins and local checks
+Level: 1
+Component: checks
+Version: 1.2.3i7
+Date: 1385982276
+Class: feature
+
+The Solaris agent now supports the same method of asynchronously
+executing local checks and plugins as the Linux agent. Simply
+create directories below <tt>/usr/lib/check_mk_agent/local</tt>
+and <tt>/usr/lib/check_mk_agent/plugins</tt> whose names are a
+number of seconds (e.g. <tt>/usr/lib/check_mk_agent/plugins/3600</tt>).
+The plugins in those subdirectories will be executed at most every
+that number of seconds and also will be run in the background.
diff --git a/ChangeLog b/ChangeLog
index e02e2dc..ff27a1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,7 @@
* 0084 brocade_mlx: single checks now instead of sub checks...
* 0291 winperf_ts_sessions: New check to monitor Microsoft Terminal Server sessions...
* 0102 modbus_value: New check and Agent to modbus devices...
+ * 0013 Solaris Agent: implement cached async plugins and local checks...
* 0024 FIX: cisco_wlc: removed check configuration parameter ap_model...
* 0003 FIX: ps: Remove exceeding [ and ] in service description when using process inventory...
* 0037 FIX: checkman browser (cmk -m) was not working properly in network subtree...
Module: check_mk
Branch: master
Commit: d8695e13d0cfdbfa06c420f3e6ac33935d16900f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d8695e13d0cfdb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 2 12:04:33 2013 +0100
FIX Solaris Agent: fixed broken fileinfo section
The fileinfo section of the Solaris agent couldn't handle
more than one file in a directory. This has now been fixed.
---
.werks/12 | 9 +++
ChangeLog | 1 +
agents/check_mk_agent.solaris | 122 ++++++++++++++++++++++++++++++-----------
3 files changed, 101 insertions(+), 31 deletions(-)
diff --git a/.werks/12 b/.werks/12
new file mode 100644
index 0000000..f6c617c
--- /dev/null
+++ b/.werks/12
@@ -0,0 +1,9 @@
+Title: Solaris Agent: fixed broken fileinfo section
+Level: 1
+Component: checks
+Version: 1.2.3i7
+Date: 1385982228
+Class: fix
+
+The fileinfo section of the Solaris agent couldn't handle
+more than one file in a directory. This has now been fixed.
diff --git a/ChangeLog b/ChangeLog
index 53dc555..e02e2dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -44,6 +44,7 @@
* 0286 FIX: esx_vsphrere_counters.ramdisk: Better handling for non existant ramdisks...
* 0290 FIX: winperf_processor mem.win: Handling no/empty agent responses correctly now...
* 0293 FIX: esx_vsphere_counters_ramdisk_sizes: Handles ram disk "ibmscratch" by default now
+ * 0012 FIX: Solaris Agent: fixed broken fileinfo section...
Multisite:
* 0001 New filters for selecting several host/service-groups at once...
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
old mode 100755
new mode 100644
index 4244213..37494af
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -27,8 +27,8 @@
export LC_ALL=C
unset LANG
-export MK_LIBDIR="/change/me"
-export MK_CONFDIR="/change/me"
+export MK_LIBDIR="/usr/lib/check_mk_agent"
+export MK_CONFDIR="/etc/check_mk"
# All executables in PLUGINSDIR will simply be executed and their
# ouput appended to the output of the agent. Plugins define their own
@@ -48,8 +48,51 @@ else
exec <&- 2>/dev/null
fi
+function file_age() {
+ /usr/bin/perl -e 'if (! -f $ARGV[0]){die "0000000"};$mtime=(stat($ARGV[0]))[9];print ($^T-$mtime);' "$1"
+}
+
+
+
+
+# Runs a command asynchronous by use of a cache file
+function run_cached () {
+ if [ "$1" = -s ] ; then local section="echo '<<<$2>>>' ; " ; shift ; fi
+ local NAME=$1
+ local MAXAGE=$2
+ shift 2
+ local CMDLINE="$section$@"
+
+ if [ ! -d $MK_CONFDIR/cache ]; then mkdir -p $MK_CONFDIR/cache ; fi
+ CACHEFILE="$MK_CONFDIR/cache/$NAME.cache"
+
+ # 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 cache file exists and is recent enough
+ if [ -s "$CACHEFILE" ] ; then
+ AGE=$(file_age "$CACHEFILE")
+ if [ $AGE -le $MAXAGE ] ; then local 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 ; $CMDLINE && mv $CACHEFILE.new $CACHEFILE || rm -f $CACHEFILE $CACHEFILE.new" | nohup bash 2>/dev/null &
+ fi
+}
+
+
echo '<<<check_mk>>>'
-echo Version: 1.2.3i6
+echo Version: 2013.12.02
echo AgentOS: solaris
@@ -183,52 +226,69 @@ then
fi
-if cd $PLUGINSDIR 2>/dev/null
-then
- for skript in $(ls)
- do
- if [ -x "$skript" ] ; then
- ./$skript
- fi
- done
-fi
-
-
# Fileinfo-Check: put patterns for files into $MK_CONFDIR/fileinfo.cfg
if [ -f "$MK_CONFDIR/fileinfo.cfg" ]
then
echo '<<<fileinfo:sep(124)>>>'
- echo ''
- nawk 'BEGIN{print srand()}'
- file=$(ls $(cat "$MK_CONFDIR/fileinfo.cfg"))
- size=$(ls -nl $file | nawk '{print $5}')
- date=$(truss -v lstat -t lstat ls -d $file 2>&1 | nawk '/mt = /{printf "%d\n", $9}')
- echo ${file}'|'${size}'|'${date}
+ /usr/bin/perl -e 'print time."\n"'
+ ls $(cat "$MK_CONFDIR/fileinfo.cfg") | \
+ /usr/bin/perl -e '
+ while(my $file = <>) {
+ $file =~ s/\n$//;
+ ($device, $inode, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat($file);
+ print("$file|$size|$mtime\n");
+ }'
fi
-# Local
+
+# MK's Remote Plugin Executor
+if test -f "$MK_CONFDIR/mrpe.cfg"
+then
+ echo '<<<mrpe>>>'
+ grep -v '^ *#' "$MK_CONFDIR/mrpe.cfg" | grep -v '^ *$' | \
+ while read descr cmdline
+ do
+ OUTPUT=$($cmdline)
+ echo "$descr $? $OUTPUT"
+ done
+fi
+
+# Local checks
if cd $LOCALDIR 2>/dev/null
then
echo '<<<local>>>'
for skript in $(ls)
do
- if [ -x "$skript" ]
- then
+ if [ -x "$skript" ] ; then
./$skript
fi
done
-fi
+ # Call some plugins only every X'th second
+ for skript in [1-9]*/* ; do
+ if [ -x "$skript" ] ; then
+ run_cached local_${skript//\//\#} ${skript%/*} "$skript"
+ fi
+ done
+
+fi
-# MK's Remote Plugin Executor
-if test -f "$MK_CONFDIR/mrpe.cfg"
+# Plugins
+if cd $PLUGINSDIR 2>/dev/null
then
- echo '<<<mrpe>>>'
- grep -v '^ *#' "$MK_CONFDIR/mrpe.cfg" | grep -v '^ *$' | \
- while read descr cmdline
+ for skript in $(ls)
do
- OUTPUT=$($cmdline)
- echo "$descr $? $OUTPUT"
+ if [ -x "$skript" ] ; then
+ ./$skript
+ fi
+ done
+
+ # Call some plugins only every X'th second
+ for skript in [1-9]*/* ; do
+ if [ -x "$skript" ] ; then
+ run_cached plugins_${skript//\//\#} ${skript%/*} "$skript"
+ fi
done
fi
+
Module: check_mk
Branch: master
Commit: fbc593648ef5df8364e4a9e728df4b7ad1761f23
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fbc593648ef5df…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 2 11:04:11 2013 +0100
multisite_draw_ruleicon: changed title of rule in global settings
---
web/plugins/wato/check_mk_configuration.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index 9162b01..c360ae2 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -232,7 +232,7 @@ register_configvar(group,
register_configvar(group,
"multisite_draw_ruleicon",
- Checkbox(title = _("Show icon for WATO parameter editor"),
+ Checkbox(title = _("Show icon linking to WATO parameter editor for services"),
label = _("Show WATO icon"),
help = _("When enabled a rule editor icon is displayed for each "
"service in the multisite views. It is only displayed if the user "
Module: check_mk
Branch: master
Commit: 1485f9f678cfea143b7405b44e8dfe57e691e353
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1485f9f678cfea…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 2 09:14:59 2013 +0100
Updated bug entries #2093
---
.bugs/2093 | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/.bugs/2093 b/.bugs/2093
new file mode 100644
index 0000000..69c8dda
--- /dev/null
+++ b/.bugs/2093
@@ -0,0 +1,12 @@
+Title: esx_vsphere_counters_ramdisk: Sizes seem not to be consistent over all systems
+Component: checks
+State: open
+Date: 2013-12-02 09:12:56
+Targetversion: 1.2.3i6
+Class: cleanup
+
+The problem: The agent can not provide the sizes of the ram disks. The check has
+a mapping table with the sizes of the ram disks. The assumption was that all
+ram disks have a fixed size on all systems. This seems to be wrong.
+At the moment, this can be overridden via main.mk, not via WATO. Make this configurable
+via WATO.