Module: check_mk
Branch: master
Commit: cb1a0aa4d4aa832dbb8ec91af42c9b9387ae1169
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cb1a0aa4d4aa83…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Tue Jan 20 10:08:02 2015 +0100
temperature.include: Fixed inconsistent handling of None in best and worst case
---
checks/temperature.include | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/checks/temperature.include b/checks/temperature.include
index b281112..276106d 100644
--- a/checks/temperature.include
+++ b/checks/temperature.include
@@ -85,6 +85,15 @@ def check_temperature(reading, params, dev_unit = "c",
status = 0
return status
+ # min that deals correctly with None
+ def minn(a,b)
+ if a = None:
+ return b
+ elif b = None:
+ return a
+ else:
+ return min(a,b)
+
unitsym = {
"c": "°C",
"f": "°F",
@@ -160,15 +169,15 @@ def check_temperature(reading, params, dev_unit = "c",
# user levels exist (or no levels at all).
# Use least critical of your and device's levels. If just one of both is defined,
- # take than max deals correctly with None here. min does not work because None < int
- # TODO FIXME HIRN
+ # take that. max deals correctly with None here. min does not work because None < int.
+ # minn is a min that deals with None in the way we want here.
elif dlh == "best":
warn, crit = max(usr_warn, dev_warn), max(usr_crit, dev_crit)
- warn_lower, crit_lower = min(usr_warn_lower, dev_warn_lower), min(usr_crit_lower, dev_crit_lower)
+ warn_lower, crit_lower = minn(usr_warn_lower, dev_warn_lower), minn(usr_crit_lower, dev_crit_lower)
# Use most critical of your and device's levels
elif dlh == "worst":
- warn, crit = min(usr_warn, dev_warn), min(usr_crit, dev_crit)
+ warn, crit = minn(usr_warn, dev_warn), minn(usr_crit, dev_crit)
warn_lower, crit_lower = max(usr_warn_lower, dev_warn_lower), max(usr_crit_lower, dev_crit_lower)
# Use user's levels if present, otherwise the device's
message is also shown on host diagnose page now
Message-ID: <54be1a10.KMmec50AnwFyoYEu%lm(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: b8f8e2985a24f4df951db7af147db0adfb175d7b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b8f8e2985a24f4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 20 08:37:59 2015 +0100
#1868 "Successfully created the host" message is also shown on host diagnose page now
---
.werks/1868 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 14 +++++++-------
3 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/.werks/1868 b/.werks/1868
new file mode 100644
index 0000000..57d8a75
--- /dev/null
+++ b/.werks/1868
@@ -0,0 +1,9 @@
+Title: "Successfully created the host" message is also shown on host diagnose page now
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.7i1
+Date: 1421739446
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index de00fd3..9c673cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -114,6 +114,7 @@
* 1760 Added search form to manual checks page
* 1785 Upload SNMP MIBs via WATO...
* 1461 msexch_dag.copyqueue: added a WATO rule for this check
+ * 1868 "Successfully created the host" message is also shown on host diagnose page now
* 1761 FIX: Ruleset search is now consistent for host & serviceparameters and manual checks
* 1765 FIX: Fixed bug when generating nagvis backends while having sites with livestatus proxy configured...
* 1789 FIX: Fix preview of passive checks in WATO list of services
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 9aba1dd..e4848e4 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2061,20 +2061,20 @@ def mode_edithost(phase, new, cluster):
return
elif new:
if host.get('tag_agent') != 'ping':
- create_result = 'folder', _('Successfully created the host. Now you should do a '
- '<a href="%s">service discovery</a> in order to auto-configure '
- 'all services to be checked on this host.') % \
- make_link([("mode", "inventory"), ("host", hostname)])
+ create_msg = _('Successfully created the host. Now you should do a '
+ '<a href="%s">service discovery</a> in order to auto-configure '
+ 'all services to be checked on this host.') % \
+ make_link([("mode", "inventory"), ("host", hostname)])
else:
- create_result = 'folder'
+ create_msg = None
if go_to_services:
return "firstinventory"
elif go_to_diag:
html.set_var("_try", "1")
- return "diag_host"
+ return "diag_host", create_msg
else:
- return create_result
+ return "folder", create_msg
else:
if go_to_services:
return "inventory"
Module: check_mk
Branch: master
Commit: 29350a420fd62e1008adb6867fc8eb967425b5ef
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=29350a420fd62e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jan 19 18:19:00 2015 +0100
Updated bug entries #2269
---
.bugs/2269 | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/.bugs/2269 b/.bugs/2269
new file mode 100644
index 0000000..0db9843
--- /dev/null
+++ b/.bugs/2269
@@ -0,0 +1,12 @@
+Title: cmk -v for a new host only creates the first RRD
+Component: core
+State: open
+Date: 2015-01-19 18:15:29
+Targetversion: 1.2.5i1
+Class: bug
+
+When you do a cmk -v on the command line (using CMC) for a new host
+without any RRD then only the first RRD is being created. Also the Perf-O-Meter
+runs into a problem. Looks like only the first perfdata value is being
+processed. Could be some spacing problem when sending check results from
+the cmk command took via pipe into the core
Module: check_mk
Branch: master
Commit: 294ad4a315e39c963367ac6a4283182bf1d23412
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=294ad4a315e39c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jan 19 17:53:56 2015 +0100
Discovery: never set node_info during inventory
When nodes of clusters are being service discovered do never set the
node information. This is because we cannot know wether the service
will actually be a clustered services before it is discovered. So
the inventory function will never know wether the service will be
part of a cluster or not.
---
modules/discovery.py | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/modules/discovery.py b/modules/discovery.py
index 26b6261..59ce57c 100644
--- a/modules/discovery.py
+++ b/modules/discovery.py
@@ -122,7 +122,7 @@ def do_discovery_for(hostname, check_types, only_new, use_caches):
verbose(" nothing%s\n" % (only_new and " new" or ""))
#.
-# .--Check_MK Discovery--------------------------------------------------.
+# .--Discovery Check-----------------------------------------------------.
# | ____ _ _ _ |
# | | _ \(_)___ ___ ___| |__ ___ ___| | __ |
# | | | | | / __|/ __| / __| '_ \ / _ \/ __| |/ / |
@@ -348,7 +348,7 @@ def discover_check_type(hostname, ipaddress, check_type, use_caches):
section_name = check_type.split('.')[0] # make e.g. 'lsi' from 'lsi.arrays'
try:
- info = None
+ info = None # default in case of exception
info = get_realhost_info(hostname, ipaddress, section_name,
use_caches and inventory_max_cachefile_age or 0, ignore_check_interval=True)
@@ -363,13 +363,12 @@ def discover_check_type(hostname, ipaddress, check_type, use_caches):
if info == None: # No data for this check type
return []
- # Add information about nodes if check wants this
+ # Add information about nodes if check wants this. Note:
+ # in the node info we always put None, not the name of a node.
+ # During inventory we behave like a non-cluster. We do not know
+ # yet if the service is going to be clustered!
if check_info[check_type]["node_info"]:
- if clusters_of(hostname):
- add_host = hostname
- else:
- add_host = None
- info = [ [add_host] + line for line in info ]
+ info = [ [None] + line for line in info ]
# Now do the actual inventory
try: