Module: check_mk
Branch: master
Commit: d8b9059dc3746c38259d29c5cc465fe135b948bb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d8b9059dc3746c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Aug 19 16:08:45 2015 +0200
Updated bug entries #0852
---
.bugs/852 | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/.bugs/852 b/.bugs/852
index ee5561c..f7d633f 100644
--- a/.bugs/852
+++ b/.bugs/852
@@ -1,8 +1,11 @@
Title: It is not possible to delete the "Status Host" in "Edit site connection"
Component: wato
-State: open
+Class: bug
+State: done
Date: 2015-08-10 15:39:15
Targetversion: 1.2.6
-Class: bug
In Wato -> Distributed Monitoring -> Edit site conenction it is not possible to delete a statushost later
+
+2015-08-19 16:08:43: changed state open -> done
+Fixed.
Module: check_mk
Branch: master
Commit: 3b81f7bc8739a08f87e318785e9bc42d634da7af
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3b81f7bc8739a0…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Aug 19 16:05:57 2015 +0200
Updated werk text
---
.werks/1281 | 1 +
doc/treasures/azure/README | 1 +
2 files changed, 2 insertions(+)
diff --git a/.werks/1281 b/.werks/1281
index 9380f72..4b4f401 100644
--- a/.werks/1281
+++ b/.werks/1281
@@ -8,6 +8,7 @@ Class: feature
To use the Azure Monitoring in OMD based installation:
- Copy the azuremonitor folder to ~/local/lib/python
+ - install the azure python api (pip install azure)
- Copy agent_azure to ~/local/share/check_mk/agents/special/
- Copy the azure publishsettings file to ~/var/check_mk (you get this file from azure)
- Copy the checks to ~/local/share/check_mk/checks/
diff --git a/doc/treasures/azure/README b/doc/treasures/azure/README
index e7dd410..c7f1d1f 100644
--- a/doc/treasures/azure/README
+++ b/doc/treasures/azure/README
@@ -1,6 +1,7 @@
To use the Azure Monitoring in OMD based installation:
- Copy the azuremonitor folder to ~/local/lib/python
+ - install the azure python api (pip install azure)
- Copy agent_azure to ~/local/share/check_mk/agents/special/
- Copy the azure publishsettings file to ~/var/check_mk (you get this file from azure)
- Copy the checks to ~/local/share/check_mk/checks/
Module: check_mk
Branch: master
Commit: df73d3c1268c4ed1c46898e0d7eeb90b3a0325e8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=df73d3c1268c4e…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Aug 19 16:03:13 2015 +0200
#1281 Microsoft Azure special agent (treasures)
- Copy the azuremonitor folder to ~/local/lib/python
- Copy agent_azure to ~/local/share/check_mk/agents/special/
- Copy the azure publishsettings file to ~/var/check_mk (you get this file from azure)
- Copy the checks to ~/local/share/check_mk/checks/
- Create a datasource program: ~/local/share/check_mk/agents/special/agent_azure ~/var/check_mk/azure.publishsettings
- Beware, collecting the data may take long time so set another check_interval for your host
All information will be "piggybacked"
---
.werks/1281 | 18 ++++
ChangeLog | 1 +
doc/treasures/azure/README | 10 ++
doc/treasures/azure/agent_azure | 103 ++++++++++++++++++++
doc/treasures/azure/azuremonitor/__init__.py | 15 +++
.../azure/azuremonitor/publishsettings.py | 68 +++++++++++++
doc/treasures/azure/checks/azure_deployments | 51 ++++++++++
doc/treasures/azure/checks/azure_servicecount | 41 ++++++++
8 files changed, 307 insertions(+)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=df73d3c126…
Module: check_mk
Branch: master
Commit: 1de666a8a8504258d46f808812b964a094c40075
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1de666a8a85042…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Aug 19 16:02:06 2015 +0200
Added missing header
---
agents/special/agent_acme_sbc | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/agents/special/agent_acme_sbc b/agents/special/agent_acme_sbc
index 93d6ace..373a9f2 100755
--- a/agents/special/agent_acme_sbc
+++ b/agents/special/agent_acme_sbc
@@ -1,4 +1,28 @@
#!/usr/bin/expect -f
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 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.
+
send_user "<<<acme_sbc>>>\n"
log_user 0
set host [lindex $argv 0]
Module: check_mk
Branch: master
Commit: e69ae78a3d6581d721963602e3417d47215503a1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e69ae78a3d6581…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Aug 19 13:54:32 2015 +0200
Updated bug entries #2294
---
.bugs/2294 | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/.bugs/2294 b/.bugs/2294
index 4a5f2f7..b485003 100644
--- a/.bugs/2294
+++ b/.bugs/2294
@@ -1,9 +1,12 @@
Title: hostname in cmk -vII often unreadable
Component: core
-State: open
+Class: bug
+State: done
Date: 2015-02-23 12:20:50
Targetversion: 1.2.6
-Class: bug
When doing a bulk inventory on the CLI with cmk -vII the hostnames are printed
in "tty_white", which is unreadable on any terminals with a whitish background.
+
+2015-08-19 13:54:30: changed state open -> done
+cmk -II has completely been rewritten
Module: check_mk
Branch: master
Commit: 4d53325ea2df07888f9bb6c404ec9ad89679cd65
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4d53325ea2df07…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Aug 19 13:24:41 2015 +0200
Updated bug entries #2339
---
.bugs/2339 | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/.bugs/2339 b/.bugs/2339
index 8284d17..55a8b83 100644
--- a/.bugs/2339
+++ b/.bugs/2339
@@ -1,9 +1,9 @@
Title: waitmax (32 Bit) und 64 Bit Ubuntu Multiarch segfaults
Component: checks
-State: open
+Class: bug
+State: done
Date: 2015-07-30 17:25:38
Targetversion: future
-Class: bug
Solution could be: use /usr/bin/timeout where available. This should nowadays
always be available. And only fall back to waitmax if missing. This could
@@ -12,3 +12,7 @@ be done by an alias in the agent itself.
if which timeout ; then
alias waitmax='timeout'
fi
+
+2015-08-19 13:24:38: changed state open -> done
+Fixed in master. By preferrring timeout over waitmax. In current systems
+this is always available. Just RH5 is missing it.
Module: check_mk
Branch: master
Commit: 70aa334ab71cab91453b200e78850812158a142e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=70aa334ab71cab…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Aug 19 15:59:09 2015 +0200
Updated bug entries #0847
---
.bugs/847 | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/.bugs/847 b/.bugs/847
index 45c997b..41314e6 100644
--- a/.bugs/847
+++ b/.bugs/847
@@ -1,8 +1,10 @@
Title: the modified version of default report cannot be deleted
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2015-03-13 13:06:13
Targetversion: 1.2.6
-Class: bug
nother report (instant) uses the settings and page layout of this report, so it can not be deleted. In order to be able to delete this report, you need to remove the dependency.
+
+2015-08-19 15:59:07: changed state open -> done
Module: check_mk
Branch: master
Commit: f68832c56cfe9141426507a44143a60730bad955
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f68832c56cfe91…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Aug 19 13:09:35 2015 +0200
get_rate() and get_averate() now provide unique id namespace for check/item
If you call get_rate() or get_average() from your check you do not
need to make the first argument (counter name) globally unique
anymore. It just needs to be unique within your current check and
item. So if you check function calls get_rate() just once, you
can simply pass None as argument. Check_MK will automaticall
wrap this into a triple of the form (check_type, item, user_key)
---
checks/kernel | 2 +-
modules/check_mk.py | 4 +-
modules/check_mk_base.py | 118 ++++++++++++++++++++++++----------------------
3 files changed, 65 insertions(+), 59 deletions(-)
diff --git a/checks/kernel b/checks/kernel
index 9a7d25f..98a6b09 100644
--- a/checks/kernel
+++ b/checks/kernel
@@ -69,7 +69,7 @@ def check_kernel(item, params, info):
counter = hits[0][0]
this_val = int(hits[0][1])
- per_sec = get_rate("kernel." + counter, this_time, this_val)
+ per_sec = get_rate(None, this_time, this_val)
if type(params) == tuple:
warn, crit = params
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 35fbe48..45ba754 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -5204,8 +5204,8 @@ def copy_globals():
global_saved = {}
for varname, value in globals().items():
# Some global caches are allowed to change.
- if varname not in [ "g_service_description", "g_multihost_checks",
- "g_singlehost_checks",
+ if varname not in [ "g_service_description", "g_checked_item", "g_check_type",
+ "g_multihost_checks", "g_singlehost_checks",
"g_nodesof_cache", "g_compiled_regexes", "vars_before_config",
"g_initial_times", "g_keepalive_initial_memusage",
"g_global_caches" ] + g_global_caches \
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index a0f67d5..f6a633a 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -162,7 +162,7 @@ def warning(reason):
g_infocache = {} # In-memory cache of host info.
g_agent_cache_info = {} # Information about agent caching
g_agent_already_contacted = {} # do we have agent data from this host?
-g_item_state = {} # storing counters of one host
+g_item_state = {} # storing counters of one host
g_hostname = "unknown" # Host currently being checked
g_aggregated_service_results = {} # store results for later submission
g_inactive_timerperiods = None # Cache for current state of timeperiods
@@ -1000,27 +1000,29 @@ def save_item_state(hostname):
# Store arbitrary values until the next execution of a check
-def set_item_state(itemname, state):
- g_item_state[itemname] = state
+def set_item_state(user_key, state):
+ g_item_state[unique_item_state_key(user_key)] = state
-def get_item_state(itemname, default=None):
- return g_item_state.get(itemname, default)
+def get_item_state(user_key, default=None):
+ return g_item_state.get(unique_item_state_key(user_key), default)
-def clear_item_state(itemname):
- if itemname in g_item_state:
- del g_item_state[itemname]
+def clear_item_state(user_key):
+ key = unique_item_state_key(user_key)
+ if key in g_item_state:
+ del g_item_state[key]
+
+
+def unique_item_state_key(user_key):
+ return (g_check_type, g_checked_item, user_key)
-# Idea (1): We could keep global variables for the name of the checktype and item
-# during a check and that way "countername" would need to be unique only
-# within one checked item. So e.g. you could use "bcast" as name and not "if.%s.bcast" % item
# Idea (2): Check_MK should fetch a time stamp for each info. This should also be
# available as a global variable, so that this_time would be an optional argument.
-def get_rate(countername, this_time, this_val, allow_negative=False, onwrap=SKIP, is_rate=False):
+def get_rate(user_key, this_time, this_val, allow_negative=False, onwrap=SKIP, is_rate=False):
try:
- timedif, rate = get_counter(countername, this_time, this_val, allow_negative, is_rate)
+ timedif, rate = get_counter(user_key, this_time, this_val, allow_negative, is_rate)
return rate
except MKCounterWrapped, e:
if onwrap is RAISE:
@@ -1032,6 +1034,48 @@ def get_rate(countername, this_time, this_val, allow_negative=False, onwrap=SKIP
else:
return onwrap
+
+# Helper for get_rate(). Note: this function has been part of the official check API
+# for a long time. So we cannot change its call syntax or remove it for the while.
+def get_counter(countername, this_time, this_val, allow_negative=False, is_rate=False):
+ old_state = get_item_state(countername, None)
+ set_item_state(countername, (this_time, this_val))
+
+ # First time we see this counter? Do not return
+ # any data!
+ if old_state is None:
+ # Do not suppress this check on check_mk -nv
+ if opt_dont_submit:
+ return 1.0, 0.0
+ raise MKCounterWrapped('Counter initialization')
+
+ last_time, last_val = old_state
+ timedif = this_time - last_time
+ if timedif <= 0: # do not update counter
+ # Do not suppress this check on check_mk -nv
+ if opt_dont_submit:
+ return 1.0, 0.0
+ raise MKCounterWrapped('No time difference')
+
+ if not is_rate:
+ valuedif = this_val - last_val
+ else:
+ valuedif = this_val
+
+ if valuedif < 0 and not allow_negative:
+ # Do not try to handle wrapper counters. We do not know
+ # wether they are 32 or 64 bit. It also could happen counter
+ # reset (reboot, etc.). Better is to leave this value undefined
+ # and wait for the next check interval.
+ # Do not suppress this check on check_mk -nv
+ if opt_dont_submit:
+ return 1.0, 0.0
+ raise MKCounterWrapped('Value overflow')
+
+ per_sec = float(valuedif) / timedif
+ return timedif, per_sec
+
+
def reset_wrapped_counters():
global g_last_counter_wrap
g_last_counter_wrap = None
@@ -1058,7 +1102,6 @@ def clear_counters(prefix, older_than):
del g_item_state[name]
-
# Compute average by gliding exponential algorithm
# itemname : unique ID for storing this average until the next check
# this_time : timestamp of new value
@@ -1102,46 +1145,6 @@ def get_average(itemname, this_time, this_val, backlog_minutes, initialize_zero
return new_val
-# DO NOT USE ANYMORE! LEGACY.
-# This is an old API function and just kept here for keeping compatibility with
-# checks from foreign sources.
-def get_counter(countername, this_time, this_val, allow_negative=False, is_rate=False):
- old_state = get_item_state(countername, None)
- set_item_state(countername, (this_time, this_val))
-
- # First time we see this counter? Do not return
- # any data!
- if old_state is None:
- # Do not suppress this check on check_mk -nv
- if opt_dont_submit:
- return 1.0, 0.0
- raise MKCounterWrapped('Counter initialization')
-
- last_time, last_val = old_state
- timedif = this_time - last_time
- if timedif <= 0: # do not update counter
- # Do not suppress this check on check_mk -nv
- if opt_dont_submit:
- return 1.0, 0.0
- raise MKCounterWrapped('No time difference')
-
- if not is_rate:
- valuedif = this_val - last_val
- else:
- valuedif = this_val
-
- if valuedif < 0 and not allow_negative:
- # Do not try to handle wrapper counters. We do not know
- # wether they are 32 or 64 bit. It also could happen counter
- # reset (reboot, etc.). Better is to leave this value undefined
- # and wait for the next check interval.
- # Do not suppress this check on check_mk -nv
- if opt_dont_submit:
- return 1.0, 0.0
- raise MKCounterWrapped('Value overflow')
-
- per_sec = float(valuedif) / timedif
- return timedif, per_sec
#.
@@ -1343,9 +1346,12 @@ def do_all_checks_on_host(hostname, ipaddress, only_check_types = None):
if only_check_types != None and checkname not in only_check_types:
continue
- # Make service description globally available
- global g_service_description
+ # Make a bit of context information globally available, so that functions
+ # called by checks now this context
+ global g_service_description, g_check_type, g_checked_item
g_service_description = description
+ g_check_type = checkname
+ g_checked_item = item
# Skip checks that are not in their check period
period = check_period_of(hostname, description)