Module: check_mk
Branch: master
Commit: ac6581cc559eebc056ccccd941c26f2d268a5c0c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ac6581cc559eeb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jan 30 13:58:48 2014 +0100
FIX: fixed a few exceptions in new parameters of service overview
---
web/htdocs/wato.py | 60 ++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 47 insertions(+), 13 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 85ec017..f1edb20 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2234,33 +2234,68 @@ def mode_object_parameters(phase):
groupnames.sort()
+ def render_rule_reason(title, title_url, reason, reason_url, is_default, setting):
+ if title_url:
+ title = '<a href="%s">%s</a>' % (title_url, title)
+ forms.section(title)
+
+ if reason:
+ title = '<a href="%s">%s</a>' % (reason_url, reason)
+ if is_default:
+ reason = '<i>' + reason + '</i>'
+ html.write("<table class=setting><tr><td class=reason>%s</td>" % reason)
+ html.write('<td class="settingvalue %s">%s</td></tr></table>' % (is_default and "unused" or "used", setting))
+
+
# For services we make a special handling the for origin and parameters
# of that service!
if service:
serviceinfo = check_mk_automation(host[".siteid"], "analyse-service", [hostname, service])
if serviceinfo:
forms.header(_("Check Origin and Parameters"), isopen = True, narrow=True, css="rulesettings")
- forms.section(_("Type of check"))
- html.write("<table class=setting><tr><td class=reason></td><td class=setting>")
origin = serviceinfo["origin"]
- html.write({
+ origin_txt = {
"active" : _("Active check"),
"static" : _("Manual check"),
"auto" : _("Inventorized check"),
"classic" : _("Classical check"),
- }[origin])
- html.write("</td></tr></table>")
+ }[origin]
+ render_rule_reason(_("Type of check"), None, "", "", False, origin_txt)
+ # First case: inventorized checks. They come from var/check_mk/autochecks/HOST.
if origin == "auto":
checkgroup = serviceinfo["checkgroup"]
checktype = serviceinfo["checktype"]
- if not group:
- htmlwrite(_("This check is not configurable via WATO"))
- else:
- rulespec = g_rulespecs["checkgroup_parameters:" + checkgroup]
+ if not checkgroup:
+ render_rule_reason(_("Parameters"), None, "", "", True, _("This check is not configurable via WATO"))
+
+ # Logwatch needs a special handling, since it is not configured
+ # via checkgroup_parameters but via "logwatch_rules" in a special
+ # WATO module.
+ elif checkgroup == "logwatch":
+ rulespec = g_rulespecs["logwatch_rules"]
output_analysed_ruleset(all_rulesets, rulespec, hostname,
serviceinfo["item"], serviceinfo["parameters"])
+ else:
+ # Note: some inventorized checks have a check group but
+ # *no* ruleset for inventorized checks. One example is "ps".
+ # That can be configured as a manual check or created by
+ # inventory. But in the later case all parameters are set
+ # by the inventory. This will be changed in a later version,
+ # but we need to address it anyway.
+ grouprule = "checkgroup_parameters:" + checkgroup
+ if grouprule not in g_rulespecs:
+ rulespec = g_rulespecs["static_checks:" + checkgroup]
+ url = make_link([('mode', 'edit_ruleset'), ('varname', "static_checks:" + checkgroup), ('host', hostname)])
+ render_rule_reason(_("Parameters"), url, _("Determined by inventory"), None, False,
+ rulespec["valuespec"]._elements[2].value_to_text(serviceinfo["parameters"]))
+
+ else:
+ rulespec = g_rulespecs[grouprule]
+ output_analysed_ruleset(all_rulesets, rulespec, hostname,
+ serviceinfo["item"], serviceinfo["parameters"])
+
elif origin == "static":
checkgroup = serviceinfo["checkgroup"]
checktype = serviceinfo["checktype"]
@@ -2271,12 +2306,11 @@ def mode_object_parameters(phase):
itemspec = rulespec["itemspec"]
if itemspec:
item_text = itemspec.value_to_text(serviceinfo["item"])
- forms.section(rulespec["itemspec"].title())
+ title = rulespec["itemspec"].title()
else:
- forms.section(_("Item"))
item_text = serviceinfo["item"]
- html.write("<table class=setting><tr><td class=reason></td><td class=setting>%s</td></tr></table>" %
- item_text)
+ title = _("Item")
+ render_rule_reason(title, None, "", "", False, item_text)
output_analysed_ruleset(all_rulesets, rulespec, hostname,
serviceinfo["item"], PARAMETERS_OMIT)
html.write(rulespec["valuespec"]._elements[2].value_to_text(serviceinfo["parameters"]))
Module: check_mk
Branch: master
Commit: 6ca864778d9e69d1fce246bf38d00ba2886cba6f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6ca864778d9e69…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Jan 29 16:29:40 2014 +0100
FIX if checks: port type 56 (fibrechannel) is no longer inventorized per default
Fibrechannel ports have their own checks, specifically written for them.
There is no need to inventorize them as if* services as well.
---
.werks/272 | 9 +++++++++
ChangeLog | 1 +
checks/hitachi_hnas_fc_if | 2 +-
checks/if.include | 5 ++++-
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/.werks/272 b/.werks/272
new file mode 100644
index 0000000..e4793e6
--- /dev/null
+++ b/.werks/272
@@ -0,0 +1,9 @@
+Title: if checks: port type 56 (fibrechannel) is no longer inventorized per default
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1391009094
+Class: fix
+
+Fibrechannel ports have their own checks, specifically written for them.
+There is no need to inventorize them as if* services as well.
diff --git a/ChangeLog b/ChangeLog
index 4d99b37..fc6c0f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -147,6 +147,7 @@
* 0262 FIX: ps: Now able to skip disabled "Process Inventory" rules...
* 0264 FIX: printer_supply_ricoh: now reports correct filling levels...
* 0575 FIX: cmciii_lcp_airin, cmciii_lcp_airout, cmciii_lcp_waterin, cmciii_lcp_waterout: improved handling of warning state...
+ * 0272 FIX: if checks: port type 56 (fibrechannel) is no longer inventorized per default...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/checks/hitachi_hnas_fc_if b/checks/hitachi_hnas_fc_if
index f30ac6f..d1a66dc 100644
--- a/checks/hitachi_hnas_fc_if
+++ b/checks/hitachi_hnas_fc_if
@@ -31,7 +31,7 @@ def hitachi_hnas_fc_if_convert_info(info):
converted.append(map(str, [
"%d%03d" % (int(line[0]), int(line[1])), # ifIndex
line[0] + "." + line[1], # ifDescr (use ClusterNode.InterfaceIndex)
- 56, # ifType 56 (fibreChannel)
+ "", # ifType: do not set port type
int(line[3]) * 1000000000, # ifHighSpeed
line[2] == "1" and 1 or 2, # ifOperStatus (map other states to down)
line[4], # ifHCInOctets
diff --git a/checks/if.include b/checks/if.include
index 9d7a50f..a915911 100644
--- a/checks/if.include
+++ b/checks/if.include
@@ -26,7 +26,7 @@
# Functions and definitions used by if and if64
-if_inventory_porttypes = [ '6', '32', '56', '62', '117' ]
+if_inventory_porttypes = [ '6', '32', '62', '117' ]
if_inventory_portstates = [ '1' ]
if_inventory_uses_description = False
if_inventory_uses_alias = False
@@ -117,6 +117,9 @@ def inventory_if_common(info, has_nodeinfo = False):
porttypes = settings.get('porttypes', if_inventory_porttypes)
portstates = settings.get('portstates', if_inventory_portstates)
+ # Allow main check to set no port type (e.g. hitachi_hnas_fc_if)
+ porttypes.append("")
+
pre_inventory = []
pre_inventory_groups = []
group_patterns = {}
two lists with interchangable elements)
Message-ID: <52e90168.qP6kflZIAJSsoC07%ab(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 703dfb85244f89167d1e25c13968f1292f8cbd6f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=703dfb85244f89…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Jan 29 14:23:53 2014 +0100
FIX Fixed sorting in duallist element (two lists with interchangable elements)
This fix ensures that if elements are moved from one list to the other
they are inserted at the correct alphanumerical index and not at the end.
---
.werks/271 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/js/checkmk.js | 15 ++++++++++++++-
3 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/.werks/271 b/.werks/271
new file mode 100644
index 0000000..4b30c21
--- /dev/null
+++ b/.werks/271
@@ -0,0 +1,10 @@
+Title: Fixed sorting in duallist element (two lists with interchangable elements)
+Level: 1
+Component: wato
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1391001637
+
+This fix ensures that if elements are moved from one list to the other
+they are inserted at the correct alphanumerical index and not at the end.
diff --git a/ChangeLog b/ChangeLog
index 534b548..0355943 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -238,6 +238,7 @@
* 0686 FIX: Fix replication with WATO if EC is enabled on master and disabled on slave
* 0129 FIX: Fixed permission bug in "Edit user profile" dialog....
* 0269 FIX: brocade_fcport: fixed problem on displaying check_parameters in WATO...
+ * 0271 FIX: Fixed sorting in duallist element (two lists with interchangable elements)...
Notifications:
* 0362 sms: now searching PATH for sendsms and smssend commands...
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 5fd261a..3dd086e 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -1803,7 +1803,20 @@ function vs_duallist_switch(field, varprefix) {
// Move the selected option to the other select field
var selected = field.options[field.selectedIndex];
field.removeChild(selected);
- other_field.appendChild(selected);
+
+ // Determine the correct child to insert
+ var sibling = other_field.firstChild;
+ while (sibling != null) {
+ if (sibling.nodeType == 1 && sibling.label.toLowerCase() > selected.label.toLowerCase())
+ break;
+ sibling = sibling.nextSibling
+ }
+
+ if (sibling)
+ other_field.insertBefore(selected, sibling);
+ else
+ other_field.appendChild(selected);
+
selected.selected = false;
// add remove from internal helper field
Module: check_mk
Branch: master
Commit: ce35777dfa7ea89a899f84269991dedf8b1b06e7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ce35777dfa7ea8…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 28 12:40:33 2014 +0100
New summary page with all settings of a host
In WATO there is now a new summary page for each host, called <i>Settings
host host...</i>. In this page you can see all of the host's settings that are
determined by rules (via <i>Host & Service Parameters</i>). You will only
see the current setting of each paramter, but also whether it is determined
by one or more matching rules or whether it is the factory default value.
A click brings you directly to the according rule set or even rule. This all
makes it much simpler to get an overview over all <i>effective</i> settings
of a host and also gives you a fast access to each setting.
---
.werks/687 | 15 ++
ChangeLog | 1 +
web/htdocs/check_mk.css | 2 +
web/htdocs/forms.py | 4 +-
web/htdocs/images/rule_no_off.png | Bin 0 -> 3133 bytes
web/htdocs/images/rule_yes_off.png | Bin 0 -> 1905 bytes
web/htdocs/valuespec.py | 7 +-
web/htdocs/wato.css | 51 ++++
web/htdocs/wato.py | 348 ++++++++++++++++++++++------
web/plugins/wato/check_mk_configuration.py | 18 +-
web/plugins/wato/datasource_programs.py | 8 +-
11 files changed, 371 insertions(+), 83 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=ce35777dfa…
Module: check_mk
Branch: master
Commit: eee91d2ba5718aee869bef24cfaee51563b11a0e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eee91d2ba5718a…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Jan 27 19:26:20 2014 +0100
FIX Multisite host tag filter: Now uses exact match
---
.werks/270 | 10 ++++++++++
ChangeLog | 1 +
web/plugins/views/filters.py | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/270 b/.werks/270
new file mode 100644
index 0000000..12dafee
--- /dev/null
+++ b/.werks/270
@@ -0,0 +1,10 @@
+Title: Multisite host tag filter: Now uses exact match
+Level: 1
+Component: multisite
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1390847004
+
+Filtering for host tags could lead to wrong results, because the livestatus filter did not look for an exact match.<br>
+If the filter was set to <tt>lan</tt>, hosts with <tt>wlan</tt> or <tt>bland</tt> were also found.
diff --git a/ChangeLog b/ChangeLog
index 47c4cd9..44b53de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -185,6 +185,7 @@
* 0122 FIX: Multisite view editor not longer throwing a exception when loading views from other users
* 0569 FIX: recurring updates of serial numbers of disabled ldap users fixed...
* 0676 FIX: Move view "Stale services" to Problems folder
+ * 0270 FIX: Multisite host tag filter: Now uses exact match...
WATO:
* 0308 Multisite can now set rotation view permissions for NagVis...
diff --git a/web/plugins/views/filters.py b/web/plugins/views/filters.py
index 5e00808..e3a839d 100644
--- a/web/plugins/views/filters.py
+++ b/web/plugins/views/filters.py
@@ -817,7 +817,7 @@ class FilterHostTags(Filter):
if op and val:
operator = op != 'is' and '!~' or '~'
- headers.append('Filter: host_custom_variables %s TAGS %s' % (operator, val))
+ headers.append('Filter: host_custom_variables %s TAGS (^|[ ])%s($|[ ])' % (operator, val))
if headers:
return '\n'.join(headers) + '\n'
Module: check_mk
Branch: master
Commit: 98aa29bad7b8cbd17ea86275ac0fc96f68ac8fbd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=98aa29bad7b8cb…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Mon Jan 27 17:55:12 2014 +0100
fileinfo.groups: new feature to include current date in file pattern
---
.werks/576 | 8 ++++++++
ChangeLog | 1 +
checkman/fileinfo.groups | 26 ++++++++++++++++----------
checks/fileinfo | 17 ++++++++++++++---
4 files changed, 39 insertions(+), 13 deletions(-)
diff --git a/.werks/576 b/.werks/576
new file mode 100644
index 0000000..dd07b64
--- /dev/null
+++ b/.werks/576
@@ -0,0 +1,8 @@
+Title: fileinfo.groups: new feature to include current date in file pattern
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1390841625
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 1838d2e..7ecc087 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -75,6 +75,7 @@
* 0265 mpre_include: run additional mrpe configs within user context...
* 0266 windows_agent: now supports mrpe include files...
* 0574 if64: check now supports clustering...
+ * 0576 fileinfo.groups: new feature to include current date in file pattern
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/fileinfo.groups b/checkman/fileinfo.groups
index 04d3b03..50d1b96 100644
--- a/checkman/fileinfo.groups
+++ b/checkman/fileinfo.groups
@@ -13,31 +13,37 @@ description:
know the information about which files need to be sent. Please refer to
fileinfos manpage for information about setting up the agent.
- The check also needs a configured file grouping pattern. File grouping
- patterns combine a simple pattern based on {*} and {?} to join a subset
- of the file names send by the agent into a file group. In addition an
- {exclude} pattern may be define to exclude certain filenames.
- The name of the file group is referenced in the check configuration
- as the item.
+ The check also needs a configured file grouping pattern. The name of the
+ file group is referenced in the check configuration as the item.
+
+ File grouping patterns combine a simple pattern based on {*} and {?} to
+ join a subset of the file names send by the agent into a file group. In
+ addition an {exclude} pattern may be defined to exclude certain filenames.
+
+ Furthermore, the current time/date in a configurable format may be
+ included in the pattern. The syntax is as follows: {$DATE:format-spec$},
+ where {format-spec} is a list of time format directives of the unix date
+ command. Example: {$DATE:%Y%m%d$} is todays date, e.g. 20140127. A pattern
+ of {/var/tmp/backups/$DATE:%Y%m%d$.txt} would search for .txt files with
+ todays date as name in the directory /var/tmp/backups.
item:
Configured name of the file group
examples:
-
-# old syntax of file group patterns, still valid
+ # old syntax of file group patterns, still valid
fileinfo_groups = [
([("Auth_group",r"/var/log/auth*")], ALL_HOSTS),
([("Message_group", r"/var/log/messages*")], ['test2'], ALL_HOSTS),
]
-# new syntax of file group patterns, including exclude pattern
+ # new syntax of file group patterns, including exclude pattern
fileinfo_groups = [
([("Auth_group", ("/var/log/auth*","/var/log/*.debug"))], ALL_HOSTS),
([("Message_group", ("/var/log/messages*",""))], ['test2'], ALL_HOSTS),
]
-# syntax of check
+ # syntax of check
check_parameters = [
({
"minsize": (200.0, 300.0),
diff --git a/checks/fileinfo b/checks/fileinfo
index 7907fdf..59b1c43 100644
--- a/checks/fileinfo
+++ b/checks/fileinfo
@@ -125,11 +125,20 @@ def check_fileinfo_groups(item, params, info):
size_all = 0
size_smallest = None
size_largest = 0
- # Start counting all values
+ date_inclusion = ""
+ # Start counting values on all files
for line in info[1:]:
for pattern in params['precompiled_patterns']:
- if fnmatch.fnmatch(line[0], pattern[0]) and str(line[1]) != 'missing' \
- and not fnmatch.fnmatch(line[0], pattern[1]):
+ inclusion, exclusion = pattern
+ disect = re.match('(/.*/)\$DATE:((?:%\w.?){1,})\$(.*)',inclusion)
+ if disect:
+ prefix = disect.group(1)
+ datepattern = time.strftime(disect.group(2),time.localtime(reftime))
+ postfix = disect.group(3)
+ inclusion = prefix+datepattern+postfix
+ date_inclusion = inclusion
+ if fnmatch.fnmatch(line[0], inclusion) and str(line[1]) != 'missing' \
+ and not fnmatch.fnmatch(line[0], exclusion):
size = int(line[1])
size_all += size
if size_smallest == None:
@@ -163,6 +172,8 @@ def check_fileinfo_groups(item, params, info):
check_definition.append(("size_smallest", size_smallest, get_filesize_human_readable))
if size_largest != 0:
check_definition.append(("size_largest", size_largest, get_filesize_human_readable))
+ if date_inclusion:
+ check_definition.append(("date pattern", date_inclusion, str ))
return fileinfo_check_function(check_definition, params)