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)