Module: check_mk
Branch: master
Commit: 515aee05892237bd056435347e0c763b5a4c8c6f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=515aee05892237…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue May 24 14:59:41 2016 +0200
3575 User logins can now be limited to single session at a time
Normally a user can login to the GUI from unlimited number of clients at
the same time. If you want to enforce your users to be able to login only once
(from one client which means device and browser), you can enable this option.
When the user logs out or is inactive for the configured amount of time, the
session is invalidated automatically and the user has to log in again from the
current or another device.
---
.werks/3575 | 14 +++
ChangeLog | 1 +
web/htdocs/login.py | 141 ++++++++++++++++++++--------
web/htdocs/userdb.py | 124 +++++++++++++++++++++++-
web/plugins/config/builtin.py | 1 +
web/plugins/wato/check_mk_configuration.py | 22 +++++
6 files changed, 260 insertions(+), 43 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=515aee0589…
Module: check_mk
Branch: master
Commit: 8b74aeba00f6e3baddf0b0f4d321ad765a7565af
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8b74aeba00f6e3…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue May 24 15:59:26 2016 +0200
3137 linux and solaris agent: mrpe checks now support option to append the cache age to cached results
---
.werks/3137 | 13 +++++++++++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 33 ++++++++++++++++++++++-----------
agents/check_mk_agent.solaris | 26 ++++++++++++++++++--------
4 files changed, 54 insertions(+), 19 deletions(-)
diff --git a/.werks/3137 b/.werks/3137
new file mode 100644
index 0000000..64c3d3d
--- /dev/null
+++ b/.werks/3137
@@ -0,0 +1,13 @@
+Title: linux and solaris agent: mrpe checks now support option to append the cache age to cached results
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.9i1
+Date: 1464098117
+Class: feature
+
+To setup mrpe checks that also display the age of the cache, use a line in mrpe.cfg like this:
+LOAD (interval=360:appendage=1) /usr/bin/check_load
+
+interval specifies the maximum cache age in seconds (here: 6 minutes) and appendage=1 instructs the
+agent to append the cache age to the output.
diff --git a/ChangeLog b/ChangeLog
index 6b01b99..673fd3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -84,6 +84,7 @@
* 3135 skype, skype.xmpp_proxy, skype.conferencing, skype.sip_stack: added furter metrics and adjusted default levels
* 3609 apc_rackpdu_power: now upper levels for electrical current are confiugurable
* 3136 windows agent: improved crash reporting...
+ * 3137 linux and solaris agent: mrpe checks now support option to append the cache age to cached results...
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 9ba058a..30afede 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -133,8 +133,10 @@ function run_cached () {
local NOW=$(date +%s)
local section=
local mrpe=0
+ local append_age=0
if [ "$1" = -s ] ; then local section="echo '<<<$2:cached($NOW,$3)>>>' ; " ; shift ; fi
if [ "$1" = -m ] ; then local mrpe=1 ; shift ; fi
+ if [ "$1" = -a ] ; then local append_age=1 ; shift ; fi
local NAME=$1
local MAXAGE=$2
shift 2
@@ -156,17 +158,27 @@ function run_cached () {
fi
fi
+
# Check if cache file exists and is recent enough
if [ -s "$CACHEFILE" ] ; then
local MTIME=$(stat -c %Y "$CACHEFILE")
- if [ $((NOW - MTIME)) -le $MAXAGE ] ; then local USE_CACHEFILE=1 ; fi
+ local AGE=$((NOW - MTIME))
+ 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"
+ if [ $append_age -eq 1 ] ; then
+ # insert the cached-string before the pipe (first -e)
+ # or, if no pipe found (-e t) append it (third -e),
+ # but only once and on the second line (2!b) (first line is section header,
+ # all further lines are long output)
+ cat "$CACHEFILE" | sed -e "2s/|/ (Cached: ${AGE}\/${MAXAGE}s)|/" -e t -e "2s/$/ (Cached: ${AGE}\/${MAXAGE}s)/"
+ else
+ cat "$CACHEFILE"
+ fi
fi
# Cache file outdated and new job not yet running? Start it
- if [ -z "$USE_CACHEFILE" -a ! -e "$CACHEFILE.new" ] ; then
+ if [ -z "$USE_CACHEFILE" ] && [ ! -e "$CACHEFILE.new" ] ; then
# When the command fails, the output is throws away ignored
if [ $mrpe -eq 1 ] ; then
echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit 1 ; run_mrpe $NAME $CMDLINE && mv \"$CACHEFILE.new\" \"$CACHEFILE\" || rm -f \"$CACHEFILE\" \"$CACHEFILE.new\"" | nohup bash >/dev/null 2>&1 &
@@ -792,23 +804,23 @@ then
while read descr cmdline
do
interval=
+ args="-m"
if [[ $cmdline =~ \(([^\)]*)\)[[:space:]](.*) ]]
then
parameters=${BASH_REMATCH[1]}
cmdline=${BASH_REMATCH[2]}
# split multiple parameter assignments
- IFS=':' read -a parlist <<< $parameters
- for par in "${parlist[@]}"
+ for par in $(echo $parameters | tr ":" "\n")
do
# split each assignment
key=$(echo $par | cut -d= -f1)
value=$(echo $par | cut -d= -f2)
- if [ "$key" = "interval" ]
- then
+ if [ "$key" = "interval" ] ; then
interval=$value
- # no other parameters supported currently
+ elif [ "$key" = "appendage" ] ; then
+ args="$args -a"
fi
done
fi
@@ -817,7 +829,7 @@ then
then
run_mrpe $descr "$cmdline"
else
- run_cached -m $descr $interval "$cmdline"
+ run_cached $args $descr $interval "$cmdline"
fi
done
fi
@@ -846,8 +858,7 @@ then
cmdline=${BASH_REMATCH[2]}
# split multiple parameter assignments
- IFS=':' read -a parlist <<< $parameters
- for par in "${parlist[@]}"
+ for par in $(echo $parameters | tr ":" "\n")
do
# split each assignment
IFS='=' read key value <<< $par
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index efd53c3..17ce30e 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -74,8 +74,10 @@ export -f run_mrpe
# Runs a command asynchronous by use of a cache file
function run_cached () {
local mrpe=0
+ local append_age=0
if [ "$1" = -s ] ; then local section="echo '<<<$2>>>' ; " ; shift ; fi
if [ "$1" = -m ] ; then local mrpe=1 ; shift ; fi
+ if [ "$1" = -a ] ; then local append_age=1 ; shift ; fi
local NAME=$1
local MAXAGE=$2
shift 2
@@ -99,11 +101,19 @@ function run_cached () {
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"
+ if [ $append_age -eq 1 ] ; then
+ # insert the cached-string before the pipe (first -e)
+ # or, if no pipe found (-e t) append it (third -e),
+ # but only once and on the second line (2) (first line is section header,
+ # all further lines are long output)
+ cat "$CACHEFILE" | sed -e "2s/|/ (Cached: ${AGE}\/${MAXAGE}s)|/" -e t -e "2s/$/ (Cached: ${AGE}\/${MAXAGE}s)/"
+ else
+ cat "$CACHEFILE"
+ fi
fi
# Cache file outdated and new job not yet running? Start it
- if [ -z "$USE_CACHEFILE" -a ! -e "$CACHEFILE.new" ] ; then
+ if [ -z "$USE_CACHEFILE" ] && [ ! -e "$CACHEFILE.new" ] ; then
if [ $mrpe -eq 1 ] ; then
echo "set -o noclobber ; exec > \"$CACHEFILE.new\" || exit 1 ; run_mrpe $NAME $CMDLINE && mv \"$CACHEFILE.new\" \"$CACHEFILE\" || rm -f \"$CACHEFILE\" \"$CACHEFILE.new\"" | nohup bash >/dev/null 2>&1 &
else
@@ -375,23 +385,23 @@ then
while read descr cmdline
do
interval=
+ args="-m"
if [[ $cmdline =~ \(([^\)]*)\)[[:space:]](.*) ]]
then
parameters=${BASH_REMATCH[1]}
cmdline=${BASH_REMATCH[2]}
# split multiple parameter assignments
- IFS=':' read -a parlist <<< $parameters
- for par in "${parlist[@]}"
+ for par in $(echo $parameters | tr ":" "\n")
do
# split each assignment
key=$(echo $par | cut -d= -f1)
value=$(echo $par | cut -d= -f2)
- if [ "$key" = "interval" ]
- then
+ if [ "$key" = "interval" ] ; then
interval=$value
- # no other parameters supported currently
+ elif [ "$key" = "appendage" ] ; then
+ args="$args -a"
fi
done
fi
@@ -400,7 +410,7 @@ then
then
run_mrpe $descr "$cmdline"
else
- run_cached -m $descr $interval "$cmdline"
+ run_cached $args $descr $interval "$cmdline"
fi
done
fi
Module: check_mk
Branch: master
Commit: a476038710272c50904438446691d1c71164583e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a476038710272c…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue May 24 10:54:13 2016 +0200
3136 windows agent: improved crash reporting
With crash debug enabled the agent will now report the windows exception code on crash
as well as the address causing the crash and the exact git revision he agent was built
from.
On 64bit systems it will also print a full backtrace including register contents.
Technical details:
Our official builds are built with mingw-w64, so we can't use windows api to resolve
debugging symbols in our own binaryi. These frames will only include addresses, while
api calls are resolved.
However, the agent is now built with dwarf-2 debugging symbols (outdated but better
tool support) and stripped of symbols in a separate build step. With the correct
unstripped exe the adresses can still be resolved using addr2line:
addr2line -e check_mk_agent-64.unstripped.exe <address>
---
.werks/3136 | 22 +++
ChangeLog | 1 +
agents/windows/.gitignore | 1 +
agents/windows/CONTENTS | 2 +
agents/windows/Makefile | 21 ++-
agents/windows/build_version | 2 +-
agents/windows/check_mk_agent-64.exe | Bin 1250304 -> 1267712 bytes
agents/windows/check_mk_agent-64.unversioned.exe | Bin 1250304 -> 1267712 bytes
agents/windows/check_mk_agent.cc | 9 +-
agents/windows/check_mk_agent.exe | Bin 1223168 -> 1236480 bytes
agents/windows/check_mk_agent.msi | Bin 2741760 -> 2772992 bytes
agents/windows/check_mk_agent.unversioned.exe | Bin 1223168 -> 1236480 bytes
agents/windows/crashhandling.cc | 155 ++++++++++++++++++++++
agents/windows/crashhandling.h | 32 +++++
agents/windows/install_agent-64.exe | Bin 554590 -> 565279 bytes
agents/windows/install_agent.exe | Bin 551424 -> 559579 bytes
16 files changed, 234 insertions(+), 11 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=a476038710…