Module: check_mk
Branch: master
Commit: 83e7052ca70e816d2790c94da93a03874917b1a0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=83e7052ca70e81…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Fri Feb 2 13:41:38 2018 +0100
Fixed typo
Change-Id: I87449ed5dfffe50f632f1e8ed3a78a7963d20b34
---
web/htdocs/wato.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index dd36d82..59734a6 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -3420,7 +3420,7 @@ class ModeDiscovery(WatoMode):
"to be monitored.")),
(self.SERVICE_IGNORED, True, _("Disabled services"),
_("These services are being discovered but have been disabled by creating a rule "
- "in the rule set <i>Disabled services</i> oder <i>Disabled checks</i>.")),
+ "in the rule set <i>Disabled services</i> or <i>Disabled checks</i>.")),
("active", False, _("Active checks"),
_("These services do not use the Check_MK agent or Check_MK-SNMP engine but actively "
"call classical check plugins. They have been added by a rule in the section "
Module: check_mk
Branch: master
Commit: 7adf2422cbb0f032e577087ac4ec9f0086caae1b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7adf2422cbb0f0…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Thu Jan 25 15:13:05 2018 +0100
5497 statgrab_net: collect net stats for local zones if dlstat exists
Previously, only the net stats of the global zone were delivered by the
check_mk_agent of solaris. Now the net stats of local zones are delivered
as well if dlstat is available.
Change-Id: Ic9ea035921ca68be9a45aefc842ea67296ebed02
---
.werks/5497 | 12 ++++++++++++
agents/check_mk_agent.solaris | 4 ++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/5497 b/.werks/5497
new file mode 100644
index 0000000..d524906
--- /dev/null
+++ b/.werks/5497
@@ -0,0 +1,12 @@
+Title: statgrab_net: collect net stats for local zones if dlstat exists
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i3
+Date: 1517496765
+Class: feature
+
+Previously, only the net stats of the global zone were delivered by the
+check_mk_agent of solaris. Now the net stats of local zones are delivered
+as well if dlstat is available.
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 937826e..a829bbc 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -250,8 +250,8 @@ then
statgrab_vars="const. cpu. disk. general. mem. page. swap. user."
statgrab_sections="cpu disk page"
- # Only collect net stats in global zone.
- if [ "$zonename" == "global" ]
+ # Collect net stats in the global zone and in local zones if dlstat is present.
+ if [ "$zonename" == "global" ] || type dlstat &>/dev/null
then
statgrab_vars="$statgrab_vars net."
statgrab_sections="$statgrab_sections net"
Module: check_mk
Branch: master
Commit: 4395f1d8703cbb0fb217877aba205dbbdaf13ea8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4395f1d8703cbb…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Wed Jan 31 15:03:16 2018 +0100
5495 fileinfo: Make out of relevant time of day more present and remove state markers
Previously, the information that a service was out of the relevant time of day
was displayed at the end of the plugin output where it can be missed easily.
Now the information is displayed at the beginning of the plugin output.
Furthermore, the subresults of a service do not show {WARN} and {CRIT} markers
anymore since this yields the impression that the check should not be {OK}.
Additional information about violations are still shown, e.g. if the age
of a file is older than a configured level.
Change-Id: I5b6d068943b1acbe12b6c5915ed4b864aa80bf2b
---
.werks/5495 | 17 +++++++++++++++
checks/fileinfo | 64 ++++++++++++++++++++++++++++++---------------------------
2 files changed, 51 insertions(+), 30 deletions(-)
diff --git a/.werks/5495 b/.werks/5495
new file mode 100644
index 0000000..6c79341
--- /dev/null
+++ b/.werks/5495
@@ -0,0 +1,17 @@
+Title: fileinfo: Make out of relevant time of day more present and remove state markers
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i3
+Date: 1517406458
+Class: feature
+
+Previously, the information that a service was out of the relevant time of day
+was displayed at the end of the plugin output where it can be missed easily.
+Now the information is displayed at the beginning of the plugin output.
+
+Furthermore, the subresults of a service do not show {WARN} and {CRIT} markers
+anymore since this yields the impression that the check should not be {OK}.
+Additional information about violations are still shown, e.g. if the age
+of a file is older than a configured level.
diff --git a/checks/fileinfo b/checks/fileinfo
index 4362018..cba70c1 100644
--- a/checks/fileinfo
+++ b/checks/fileinfo
@@ -47,7 +47,7 @@ def fileinfo_groups_get_group_name(group_patterns, filename, reftime):
found_these_groups = {}
for group_name, pattern in group_patterns:
if type(pattern) == str: # support old format
- pattern = ( pattern, '' )
+ pattern = (pattern, '')
inclusion, exclusion = pattern
inclusion_is_regex = False
@@ -70,27 +70,27 @@ def fileinfo_groups_get_group_name(group_patterns, filename, reftime):
incl_match = regex(inclusion).match(filename)
if incl_match:
num_perc_s = group_name.count("%s")
- matches = [ g and g or "" for g in incl_match.groups() ]
+ matches = [g and g or "" for g in incl_match.groups()]
else:
- incl_match = fnmatch.fnmatch( filename, inclusion )
+ incl_match = fnmatch.fnmatch(filename, inclusion)
if exclusion_is_regex:
excl_match = regex(exclusion).match(filename)
else:
- excl_match = fnmatch.fnmatch( filename, exclusion )
+ excl_match = fnmatch.fnmatch(filename, exclusion)
if len(matches) < num_perc_s:
raise MKGeneralException("Invalid entry in inventory_fileinfo_groups: "
- "group name '%s' contains %d times '%%s', but regular expression "
- "'%s' contains only %d subexpression(s)." % \
- (group_name, num_perc_s, inclusion, len(matches)))
+ "group name '%s' contains %d times '%%s', but regular expression "
+ "'%s' contains only %d subexpression(s)." %
+ (group_name, num_perc_s, inclusion, len(matches)))
this_group_name = None
if incl_match and not excl_match:
if matches:
for nr, group in enumerate(matches):
inclusion = instantiate_regex_pattern_once(inclusion, group)
- group_name = group_name.replace("%%%d" % (nr+1), group)
+ group_name = group_name.replace("%%%d" % (nr + 1), group)
this_group_name = group_name % tuple(matches[:num_perc_s])
this_pattern = ("~%s" % inclusion, exclusion)
@@ -121,38 +121,38 @@ def inventory_fileinfo_common(info, case):
line[0], reftime))
if not found_groups and case == 'single' and line[1] != 'missing':
- inventory.append((line[0], {}));
+ inventory.append((line[0], {}))
elif found_groups and case == 'group':
for group_name, patterns in found_groups.items():
- inventory.append((group_name, {"group_patterns" : patterns}))
+ inventory.append((group_name, {"group_patterns": patterns}))
return inventory
def fileinfo_process_date(pattern, reftime):
- for what, the_time in [ ("DATE", reftime), ("YESTERDAY", reftime - 86400) ]:
+ for what, the_time in [("DATE", reftime), ("YESTERDAY", reftime - 86400)]:
the_regex = '((?:/|[A-Za-z]).*)\$%s:((?:%%\w.?){1,})\$(.*)' % what
disect = re.match(the_regex, pattern)
if disect:
prefix = disect.group(1)
datepattern = time.strftime(disect.group(2),time.localtime(the_time))
postfix = disect.group(3)
- pattern = prefix+datepattern+postfix
+ pattern = prefix + datepattern + postfix
return pattern
return pattern
def fileinfo_check_timeranges(params):
ranges = params.get("timeofday")
- if ranges == None:
- return None # no ranges defined
+ if ranges is None:
+ return ""
now = time.localtime()
for range_spec in ranges:
if fileinfo_in_timerange(now, *range_spec):
- return None
- return " (out of relevant time of day)"
+ return ""
+ return "Out of relevant time of day"
def fileinfo_in_timerange(now, range_from, range_to):
@@ -167,7 +167,7 @@ def check_fileinfo(item, params, info):
return (3, "no information sent by agent")
outof_range_txt = fileinfo_check_timeranges(params)
- in_timerange = outof_range_txt == None
+ in_timerange = outof_range_txt == ""
reftime = None
check_definition = False
state_missing = params.get("state_missing", 3)
@@ -185,10 +185,14 @@ def check_fileinfo(item, params, info):
check_definition = [
("Size", "size", size, get_filesize_human_readable),
- ("Age", "age", age, get_age_human_readable) ]
+ ("Age", "age", age, get_age_human_readable)
+ ]
- if check_definition == False:
- return in_timerange and state_missing or 0, "File not found" + (outof_range_txt or "")
+ if check_definition is False:
+ state = state_missing if in_timerange else 0
+ infotext = ("File not found" if not outof_range_txt else
+ "File not found - %s" % outof_range_txt)
+ return state, infotext
return fileinfo_check_function(check_definition, params, outof_range_txt)
@@ -240,8 +244,8 @@ def check_fileinfo_groups(item, params, info):
if line[0].endswith("No such file or directory"):
continue
- if type(pattern) == str: # support old format
- pattern = ( pattern, '' )
+ if type(pattern) == str: # support old format
+ pattern = (pattern, '')
inclusion, exclusion = pattern
inclusion_is_regex = False
@@ -268,18 +272,18 @@ def check_fileinfo_groups(item, params, info):
else:
excl_match = fnmatch.fnmatch(line[0], exclusion)
- if str(line[1]) not in [ 'missing', '' ] and \
+ if str(line[1]) not in ['missing', ''] and \
incl_match and not excl_match:
size = int(line[1])
size_all += size
- if size_smallest == None:
+ if size_smallest is None:
size_smallest = size
else:
size_smallest = min(size_smallest, size)
size_largest = max(size_largest, size)
age = reftime - int(line[2])
- if age_oldest == None: # very first match
+ if age_oldest is None: # very first match
age_oldest = age
age_newest = age
else:
@@ -287,7 +291,7 @@ def check_fileinfo_groups(item, params, info):
age_newest = min(age_newest, age)
count_all += 1
- if age_oldest == None:
+ if age_oldest is None:
age_oldest = 0
# Start Checking
@@ -303,9 +307,9 @@ def check_fileinfo_groups(item, params, info):
size_smallest, get_filesize_human_readable))
if size_largest != 0:
check_definition.append(("Largest size", "size_largest",
- size_largest, get_filesize_human_readable))
+ size_largest, get_filesize_human_readable))
if date_inclusion:
- check_definition.append(("Date pattern", "date pattern", date_inclusion, str ))
+ check_definition.append(("Date pattern", "date pattern", date_inclusion, str))
return fileinfo_check_function(check_definition, params, outof_range_txt)
@@ -316,7 +320,7 @@ def fileinfo_check_function(check_definition, params, outof_range_txt):
perfdata = []
for what_title, what, val, verbfunc in check_definition:
infos.append("%s: %s" % (what_title, verbfunc(val)))
- if type(val) in [long, int]: # because strings go into infos but not into perfdata
+ if type(val) in [long, int]: # because strings go into infos but not into perfdata
warn, crit = "", ""
for how, comp, cfunc in [
("min", "<", lambda a, b: a < b),
@@ -336,7 +340,7 @@ def fileinfo_check_function(check_definition, params, outof_range_txt):
infotext = ", ".join(infos)
if outof_range_txt:
state = 0
- infotext += outof_range_txt
+ infotext = outof_range_txt + ', ' + infotext.replace('(!)', '').replace('(!!)', '')
return (state, infotext, perfdata)
Module: check_mk
Branch: master
Commit: cfb3667edc5b53fe6baa652fd1a03eb47e450e9a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cfb3667edc5b53…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Feb 1 14:33:02 2018 +0100
5669 FIX Always fetch host/authorization-related info from EC when needed
To correctly show host-related information and to handle EC-related
authorization, Livestatus needs to retrieve enough information from the EC.
This was broken by an optimization in the master branch quite some time ago
(Oct 2017), so v1.5.0i1 and v1.5.0i2 showed some strange behaviour in this
area. This is fixed again now.
Change-Id: I7473bc783c583d190a8413a031bf5d520c793986
---
.werks/5669 | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/.werks/5669 b/.werks/5669
new file mode 100644
index 0000000..6c61986
--- /dev/null
+++ b/.werks/5669
@@ -0,0 +1,14 @@
+Title: Always fetch host/authorization-related info from EC when needed
+Level: 1
+Component: livestatus
+Compatible: compat
+Edition: cre
+Version: 1.5.0i3
+Date: 1517491383
+Class: fix
+
+To correctly show host-related information and to handle EC-related
+authorization, Livestatus needs to retrieve enough information from the EC.
+This was broken by an optimization in the master branch quite some time ago
+(Oct 2017), so v1.5.0i1 and v1.5.0i2 showed some strange behaviour in this
+area. This is fixed again now.
Module: check_mk
Branch: master
Commit: 26c5243209c0555956334e57374a68b9d228b3a6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=26c5243209c055…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Feb 1 13:47:53 2018 +0100
Avoid exception for non-existent columns.
Change-Id: I271a11d832304d02028fcd5593a82142fe5abe57
---
livestatus/src/TableEventConsole.cc | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/livestatus/src/TableEventConsole.cc b/livestatus/src/TableEventConsole.cc
index 140af75..7b13eae 100644
--- a/livestatus/src/TableEventConsole.cc
+++ b/livestatus/src/TableEventConsole.cc
@@ -70,15 +70,20 @@ private:
// Initially we consider all columns used in the query...
auto all = _query->allColumns();
// ... then we add some special columns which we might need irrespective
- // of the actual query (see receiveReply, isAuthorizedForEvent, and
- // isAuthorizedForEventViaContactGroups below)...
- for (const auto &name : {"event_host", //
- "event_contact_groups_precedence", //
- "event_contact_groups"}) {
- if (auto col = _table.column(name)) {
+ // of the actual query...
+ static std::unordered_set<std::string> special_columns{
+ // see receiveReply
+ "event_host",
+ // see isAuthorizedForEvent
+ "event_contact_groups_precedence",
+ // see isAuthorizedForEventViaContactGroups
+ "event_contact_groups"};
+ _table.any_column([&](const auto &col) {
+ if (special_columns.find(col->name()) != special_columns.end()) {
all.insert(col);
}
- }
+ return false;
+ });
// .. and then we ignore all host-related columns, they are implicitly
// joined later via ECRow._host later.
for (const auto &c : all) {