Module: check_mk
Branch: master
Commit: 26fc40afdced8f1ad8be122422a4251e18edd58b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=26fc40afdced8f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 4 11:43:33 2014 +0100
#1639 FIX Interfaces with speed more than 10GBit/s can now be configured correctly
---
.werks/1639 | 7 +++++++
ChangeLog | 1 +
web/htdocs/valuespec.py | 4 ++--
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/.werks/1639 b/.werks/1639
new file mode 100644
index 0000000..26a842e
--- /dev/null
+++ b/.werks/1639
@@ -0,0 +1,7 @@
+Title: Interfaces with speed more than 10GBit/s can now be configured correctly
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417689631
+Class: fix
diff --git a/ChangeLog b/ChangeLog
index 32a6929..8eb9264 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -165,6 +165,7 @@
* 1620 FIX: Fixed exception during host renaming when host has no perfdata
* 1625 FIX: Safely handle characters that have a special meaning in regexes when creating service-specific rules...
* 1637 FIX: Fixed exception in notification analysis when notifications have not NOTIFICATIONTYPE set
+ * 1639 FIX: Interfaces with speed more than 10GBit/s can now be configured correctly
Notifications:
* 1512 Bulk notification can now be grouped according to custom macro values...
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 131718e..a8896ff 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -292,7 +292,7 @@ class Integer(ValueSpec):
return text
def validate_datatype(self, value, varprefix):
- if type(value) != int:
+ if type(value) not in [ int, long ]:
raise MKUserError(varprefix, _("The value %r has the wrong type %s, but must be of type int")
% (value, type_name(value)))
@@ -1085,7 +1085,7 @@ class Float(Integer):
def validate_datatype(self, value, varprefix):
if type(value) != float and not \
- (type(value) == int and self._allow_int):
+ (type(value) not in [ int, long ] and self._allow_int):
raise MKUserError(varprefix, _("The value %r has type %s, but must be of type float%s") %
(value, type_name(value), self._allow_int and _(" or int") or ""))
Module: check_mk
Branch: master
Commit: 7f3eb0049ac507724995ea336a396582d543a45c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7f3eb0049ac507…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 4 13:04:24 2014 +0100
#1641 FIX Quicksearch: Now able to search for services with backslashes in names
---
.werks/1641 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/sidebar.py | 48 ++++++++++++++++++++++++++++++++----------------
3 files changed, 42 insertions(+), 16 deletions(-)
diff --git a/.werks/1641 b/.werks/1641
new file mode 100644
index 0000000..5849b58
--- /dev/null
+++ b/.werks/1641
@@ -0,0 +1,9 @@
+Title: Quicksearch: Now able to search for services with backslashes in names
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417694635
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index ae862ee..5a95559 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -137,6 +137,7 @@
* 1614 FIX: Fixed wrong URL in webapi.py documentation
* 1619 FIX: Renamed "Hostgroups" and "Servicegroups" views to "Host Groups" and "Service Groups"
* 1638 FIX: Fixed styling small styling problems in wiki snapin
+ * 1641 FIX: Quicksearch: Now able to search for services with backslashes in names
WATO:
* 1170 Added buttons to move rules to top/bottom of the list to ruleset edit dialog
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index faf8b34..97aa15a 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -703,7 +703,17 @@ def parse_search_query(s):
if found_filters:
return found_filters
else:
- return [("hosts", s.replace('*', '.*'))]
+ return [("hosts", to_regex(s))]
+
+# Ensures the provided search string is a regex, does some basic conversion
+# and then tries to verify it is a regex
+def to_regex(s):
+ s = s.replace('*', '.*')
+ try:
+ re.compile(s)
+ except re.error:
+ raise MKGeneralException(_('You search statement is not valid. You need to provide a regular expression (regex). For example you need to e use <tt>\\\\</tt> instead of <tt>\\</tt> if you like to search for a single backslash.'))
+ return s
def is_ipaddress(s):
try:
@@ -758,45 +768,50 @@ def search_url_tmpl(used_filters, row, exact = True):
def find_tmpl():
if exact: # Get the match template
if plugin.get("match_url_tmpl_func"):
- return plugin['match_url_tmpl_func'](used_filters, row_data)
+ return False, plugin['match_url_tmpl_func'](used_filters, row_data)
if plugin.get("match_url_tmpl"):
- return plugin.get("match_url_tmpl")
+ return False, plugin.get("match_url_tmpl")
# Default match templates
ty = plugin.get("dftl_url_tmpl", plugin.get("id"))
if ty == 'hosts':
- return 'view.py?view_name=host&host=%(name)s&site=%(site)s'
+ return False, 'view.py?view_name=host&host=%(name)s&site=%(site)s'
elif ty == 'hostgroups':
- return 'view.py?view_name=hostgroup&hostgroup=%(name)s&site=%(site)s'
+ return False, 'view.py?view_name=hostgroup&hostgroup=%(name)s&site=%(site)s'
elif ty == 'servicegroups':
- return 'view.py?view_name=servicegroup&servicegroup=%(name)s&site=%(site)s'
+ return False, 'view.py?view_name=servicegroup&servicegroup=%(name)s&site=%(site)s'
elif ty == 'services':
- return 'view.py?view_name=allservices&service_regex=%(name)s&site=%(site)s'
+ return True, 'view.py?view_name=allservices&service_regex=%(name)s&site=%(site)s'
else: # Get the search template
if plugin.get("search_url_tmpl_func"):
- return plugin['search_url_tmpl_func'](used_filters, row_data)
+ return False, plugin['search_url_tmpl_func'](used_filters, row_data)
if plugin.get("search_url_tmpl"):
- return plugin.get("search_url_tmpl")
+ return False, plugin.get("search_url_tmpl")
# Default search templates
ty = plugin.get("dftl_url_tmpl", plugin.get("id"))
if ty == 'hosts':
- return 'view.py?view_name=searchhost&host_regex=%(name)s&filled_in=filter'
+ return False, 'view.py?view_name=searchhost&host_regex=%(name)s&filled_in=filter'
elif ty == 'hostgroups':
- return 'view.py?view_name=hostgroups&hostgroup_regex=%(name)s&site=%(site)s'
+ return False, 'view.py?view_name=hostgroups&hostgroup_regex=%(name)s&site=%(site)s'
elif ty == 'servicegroups':
- return 'view.py?view_name=svcgroups&servicegroup_name=%(name)s&site=%(site)s'
+ return False, 'view.py?view_name=svcgroups&servicegroup_name=%(name)s&site=%(site)s'
elif ty == 'services':
- return 'view.py?view_name=allservices&service_regex=%(name)s&site=%(site)s'
+ return False, 'view.py?view_name=allservices&service_regex=%(name)s&site=%(site)s'
# Search the template
- url_tmpl = find_tmpl()
+ escape_regex, url_tmpl = find_tmpl()
# Some templates with single filters contain %(name)s, %(search)s, %(site)
if len(used_filters) == 1:
if exact:
site = row_data.get("site")
name = row_data.get(get_row_name(row))
+ # In case of an exact match, not the original search statement is used,
+ # instead the name of the row provided by livestatus is used. This needs
+ # to be escaped as it is no regex
+ if escape_regex:
+ name = name.replace('\\', '\\\\')
else:
site = ""
name = used_filters[0][1]
@@ -914,8 +929,9 @@ def format_result(row, render_options):
if name_append:
name = "%s %s" % (name, name_append)
+ escaped_name = name.replace('\\', '\\\\')
html.write('<a id="result_%s" class="%s" href="%s" onClick="mkSearchClose()" target="main">%s' %
- (name, css, url, name))
+ (escaped_name, css, url, name))
html.write('</a>\n')
@@ -964,7 +980,7 @@ def process_search(q):
data = search_livestatus(used_filters)
if len(used_filters) == 1 and used_filters[0][0] == "hosts" and not data:
# When asking for hosts and no host found, try searching services instead
- data = search_livestatus( [("services", used_filters[0][1])] )
+ data = search_livestatus([("services", used_filters[0][1])])
return data, [("services", used_filters[0][1])]
return data, used_filters
Module: check_mk
Branch: master
Commit: 99bf4ce41bf09c5461ed1eee4dc523e8031fa520
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=99bf4ce41bf09c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 4 13:07:05 2014 +0100
Also validating subregexes e.g. h:... s:...
---
web/htdocs/sidebar.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index 97aa15a..132e0f0 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -697,7 +697,7 @@ def parse_search_query(s):
current_string = s
for token_type, token_offset in found[-1::-1]:
found_filters.append( (types[token_type.lstrip()],
- current_string[token_offset+len(token_type)+1:].replace("*", ".*").strip()) )
+ to_regex(current_string[token_offset+len(token_type)+1:]).strip()) )
current_string = current_string[:token_offset]
if found_filters:
@@ -712,7 +712,9 @@ def to_regex(s):
try:
re.compile(s)
except re.error:
- raise MKGeneralException(_('You search statement is not valid. You need to provide a regular expression (regex). For example you need to e use <tt>\\\\</tt> instead of <tt>\\</tt> if you like to search for a single backslash.'))
+ raise MKGeneralException(_('You search statement is not valid. You need to provide a regular '
+ 'expression (regex). For example you need to e use <tt>\\\\</tt> instead of <tt>\\</tt> '
+ 'if you like to search for a single backslash.'))
return s
def is_ipaddress(s):
Module: check_mk
Branch: master
Commit: 70ddb46c2c5e856d65091341d3d33d6aaf965d3e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=70ddb46c2c5e85…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Dec 4 12:56:32 2014 +0100
#1630 smart: update in plugin that also outputs information about disks attached to a MegaRAID controller
Thanks to Florian Heigl
---
.werks/1630 | 9 +++++++++
ChangeLog | 1 +
agents/plugins/smart | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 62 insertions(+)
diff --git a/.werks/1630 b/.werks/1630
new file mode 100644
index 0000000..ee15952
--- /dev/null
+++ b/.werks/1630
@@ -0,0 +1,9 @@
+Title: smart: update in plugin that also outputs information about disks attached to a MegaRAID controller
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417694156
+Class: feature
+
+Thanks to Florian Heigl
diff --git a/ChangeLog b/ChangeLog
index 44b2f22..0bf94f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -49,6 +49,7 @@
* 1626 Renamed service descriptions of filesystem, process and logwatch checks...
* 1627 megaraid_ldisks: Warn if current cache or write policy differs from logical drive default policy...
* 1629 check_mk_agent.freebsd: several new features and improvements, now only use statgrab...
+ * 1630 smart: update in plugin that also outputs information about disks attached to a MegaRAID controller...
* 1478 FIX: kernel.util, statgrab_cpu: fix computation of utilization...
* 1480 FIX: brocade_vdx_status: disable check on some devices that do not support it...
* 1485 FIX: dell_om_disks, dell_om_esmlog, dell_om_mem, dell_om_processors, dell_om_sensors: detect more devices...
diff --git a/agents/plugins/smart b/agents/plugins/smart
index 3b5faf2..1a0f250 100755
--- a/agents/plugins/smart
+++ b/agents/plugins/smart
@@ -23,6 +23,51 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+
+
+
+# This will be called on LSI based raidcontrollers and accesses
+# the SMART data of SATA disks attached to a SAS Raid HBA via
+# SCSI protocol interface.
+megaraid_info()
+{
+
+ PDINFO=$(MegaCli -PDlist -a0)
+
+ echo "$PDINFO" | \
+ while read line ; do
+ case "$line" in
+ # FIRST LINE
+ "Enclosure Device ID"*) #Enclosure Device ID: 252
+ ENC=$( echo "$line" | awk '{print $4}')
+ unset SLOT LOG_DEV_ID VEND MODEL
+ ;;
+ "Slot Number"*) #Slot Number: 7
+ SLOT=$( echo "$line" | awk '{print $3}')
+ ;;
+ # Identify the logical device ID. smartctl needs it to access the disk.
+ "Device Id"*) #Device Id: 19
+ LOG_DEV_ID=$( echo "$line" | awk '{print $3}')
+ ;;
+ "PD Type"*) #PD Type: SATA
+ VEND=$( echo "$line" | awk '{print $3}')
+ ;;
+ # This is the last value, generate output here
+ "Inquiry Data"*)
+ #Inquiry Data: WD-WCC1T1035197WDC WD20EZRX-00DC0B0 80.00A80
+ # $4 seems to be better for some vendors... wont be possible to get this perfect.
+ MODEL=$( echo "$line" | awk '{print $3}')
+
+ # /dev/sdc ATA SAMSUNG_SSD_830 5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always -
+ smartctl -d megaraid,${LOG_DEV_ID} -v 9,raw48 -A /dev/sg0 | \
+ grep Always | egrep -v '^190(.*)Temperature(.*)' | \
+ sed "s|^|Enc${ENC}/Slot${SLOT} $VEND $MODEL |"
+ ;;
+ esac
+ done
+}
+
+
# Only handle always updated values, add device path and vendor/model
if which smartctl > /dev/null 2>&1 ; then
#
@@ -106,4 +151,11 @@ if which smartctl > /dev/null 2>&1 ; then
[ -n "$CMD" ] && $CMD | grep Always | egrep -v '^190(.*)Temperature(.*)' | sed "s|^|$DNAME $VEND $MODEL |"
done 2>/dev/null
+
+
+ # Call MegaRaid submodule if conditions are met
+ if which MegaCli > /dev/null && [ -c /dev/sg0 ] ; then
+ megaraid_info
+ fi
fi
+
Module: check_mk
Branch: master
Commit: 34f45af94ce9ee14c0331515371361bb10ac4790
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=34f45af94ce9ee…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Dec 4 12:43:52 2014 +0100
#1628 FIX Remove trailing backslashes from service descriptions
The Nagios core does not support these. But it can happen e.g. due to trailing
backslashes in the names of network interfaces.
---
.werks/1628 | 10 ++++++++++
ChangeLog | 1 +
modules/check_mk.py | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/1628 b/.werks/1628
new file mode 100644
index 0000000..b318c85
--- /dev/null
+++ b/.werks/1628
@@ -0,0 +1,10 @@
+Title: Remove trailing backslashes from service descriptions
+Level: 1
+Component: core
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417693356
+Class: fix
+
+The Nagios core does not support these. But it can happen e.g. due to trailing
+backslashes in the names of network interfaces.
diff --git a/ChangeLog b/ChangeLog
index 128ace9..66eb805 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
* 1555 FIX: Improved validation on timeperiod references of non existing periods...
* 1574 FIX: Hosts named like used python modules do not break precompiled checks anymore...
* 1624 FIX: Remove illegal characters from service descriptions of active checks...
+ * 1628 FIX: Remove trailing backslashes from service descriptions...
Checks & Agents:
* 1197 climaveneta_temp: New check for temperature sensors on Climaveneta clima devices
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 2065584..0e7ed51 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1353,7 +1353,7 @@ def exit_code_spec(hostname):
# Remove illegal characters from a service description
def sanitize_service_description(descr):
- return "".join([ c for c in descr if c not in nagios_illegal_chars ])
+ return "".join([ c for c in descr if c not in nagios_illegal_chars ]).rstrip("\\")
def service_description(check_type, item):