ucs_bladecenter_topsystem, ucs_bladecenter_faulinst
Message-ID: <55a7a34e.doPuESTd3/BwYcF6%ab(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: 2e4e09b268677f67eb0325763d9a531d42d518e5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2e4e09b268677f…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Jul 16 14:25:01 2015 +0200
#2405 New checks for UCS bladecenter: ucs_bladecenter_topsystem, ucs_bladecenter_faulinst
The special agent agent_ucs_bladecenter now queries the additional classes <i>faulInst</i>
and <i>topSystem</i>. There are two new checks:
<i>ucs_bladecenter_faultinst</i>: This check lists the current fault instances and goes
WARN or CRIT in case of a severe fault.
<i>ucs_bladecenter_topsystem</i>: This check is just information and always OK.
It shows the IP-Address, current time, Ipv6-Address, bladecenter mode, system name and system uptime.
---
.werks/2405 | 16 +++++++
ChangeLog | 1 +
agents/special/agent_ucs_bladecenter | 7 ++++
checkman/ucs_bladecenter_faultinst | 9 ++++
checkman/ucs_bladecenter_topsystem | 9 ++++
checks/ucs_bladecenter_faultinst | 76 ++++++++++++++++++++++++++++++++++
checks/ucs_bladecenter_topsystem | 47 +++++++++++++++++++++
7 files changed, 165 insertions(+)
diff --git a/.werks/2405 b/.werks/2405
new file mode 100644
index 0000000..c119f4a
--- /dev/null
+++ b/.werks/2405
@@ -0,0 +1,16 @@
+Title: New checks for UCS bladecenter: ucs_bladecenter_topsystem, ucs_bladecenter_faulinst
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1437049272
+Class: feature
+
+The special agent agent_ucs_bladecenter now queries the additional classes <i>faulInst</i>
+and <i>topSystem</i>. There are two new checks:
+
+<i>ucs_bladecenter_faultinst</i>: This check lists the current fault instances and goes
+WARN or CRIT in case of a severe fault.
+
+<i>ucs_bladecenter_topsystem</i>: This check is just information and always OK.
+It shows the IP-Address, current time, Ipv6-Address, bladecenter mode, system name and system uptime.
diff --git a/ChangeLog b/ChangeLog
index 1edd074..01d16a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,7 @@
* 1272 alcatel_power, alcatel_temp Support for stacked environments...
NOTE: Please refer to the migration notes!
* 1273 bvip_cams, bvip_fans, bvip_info, bvip_link, bvip_poe, bvip_temp, bvip_util, bvip_video_alerts: New Checks for Bosch Video over IP Cameras
+ * 2405 New checks for UCS bladecenter: ucs_bladecenter_topsystem, ucs_bladecenter_faultinst...
* 2315 FIX: windows agent: BOM replacement, fixed incorrect byte offset...
* 2316 FIX: windows agent: fix garbled output of cached agent plugins...
* 2358 FIX: check_mk_agent.solaris: more correct computation of zfs used space...
diff --git a/agents/special/agent_ucs_bladecenter b/agents/special/agent_ucs_bladecenter
index 0a869ee..d699bd4 100755
--- a/agents/special/agent_ucs_bladecenter
+++ b/agents/special/agent_ucs_bladecenter
@@ -199,6 +199,13 @@ for entry, fields in [
("fabricDceSwSrvPc", ["Dn", "AdminState", "OperState", "OperSpeed", "Name", "PortId"]),
("fabricDceSwSrvPcEp", ["Dn", "EpDn", "AdminState", "OperState", "PortId", "SwitchId", "SlotId"]),
+ # Fault Instances
+ ("<<<ucs_bladecenter_faultinst:sep(9)>>>", None),
+ ("faultInst", ["Dn", "Descr", "Severity"]),
+
+ # TopSystem Info
+ ("<<<ucs_bladecenter_topsystem:sep(9)>>>", None),
+ ("topSystem", ["Address", "CurrentTime", "Ipv6Addr", "Mode", "Name", "SystemUpTime"]),
]:
try:
if fields == None:
diff --git a/checkman/ucs_bladecenter_faultinst b/checkman/ucs_bladecenter_faultinst
new file mode 100644
index 0000000..39cbe09
--- /dev/null
+++ b/checkman/ucs_bladecenter_faultinst
@@ -0,0 +1,9 @@
+title: UCS Bladecenter: Fault Instances
+agents: agent_ucs_bladecenter
+catalog: hw/server/cisco
+license: GPL
+distribution: check_mk
+description:
+ This check shows fault instances for an UCS bladecenter.
+ Depending on the criticality of the fault, the check might go WARN or CRIT.
+
diff --git a/checkman/ucs_bladecenter_topsystem b/checkman/ucs_bladecenter_topsystem
new file mode 100644
index 0000000..ecaeba8
--- /dev/null
+++ b/checkman/ucs_bladecenter_topsystem
@@ -0,0 +1,9 @@
+title: UCS Bladecenter: TopSystem Info
+agents: agent_ucs_bladecenter
+catalog: hw/server/cisco
+license: GPL
+distribution: check_mk
+description:
+ This check displays the information of the TopSystem class of an UCS bladecenter.
+ This includes the IP-Address, Current Time, IPv6-Address, Bladecenter Mode, System Name and the System Uptime.
+ It is always OK.
diff --git a/checks/ucs_bladecenter_faultinst b/checks/ucs_bladecenter_faultinst
new file mode 100644
index 0000000..a5ca4db
--- /dev/null
+++ b/checks/ucs_bladecenter_faultinst
@@ -0,0 +1,76 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2015 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+
+# <<<ucs_bladecenter_faultinst:sep(9)>>>
+# faultInst Dn sys/chassis-2/bl...ault-F1256 Descr Local disk 2 missing on server 2/3 Severity info
+# faultInst Dn sys/chassis-2/bl...ault-F1256 Descr Local disk 1 missing on server 2/3 Severity info
+# faultInst Dn sys/chassis-1/bl...ault-F1256 Descr Local disk 2 missing on server 1/3 Severity info
+
+def inventory_ucs_bladecenter_faultinst(parsed):
+ yield None, None
+
+def check_ucs_bladecenter_faultinst(item, _no_params, parsed):
+ severity_map = {
+ "critical" : 2,
+ "major" : 1,
+ "warning" : 1,
+ "minor" : 1,
+ "info" : 0,
+ "condition" : 0,
+ "cleared" : 0,
+ }
+ severities = {}
+ for key, values in parsed.get("faultInst", {}).items():
+ entry_sev = values.get("Severity").lower()
+ severities.setdefault(entry_sev, [])
+ severities[entry_sev].append(values)
+
+ state = 0
+ for sev, instances in severities.items():
+ sev_state = severity_map.get(sev, 3)
+ state = max(state, sev_state)
+
+ # Right now, OK instances are also reported in detail
+ # If required we can increase the state level here, so that only WARN+ messages are shown
+ if sev_state >= 0:
+ extra_info = []
+ for instance in instances:
+ extra_info.append("%s" % instance["Descr"])
+ extra_info = ": " + ", ".join(extra_info)
+ else:
+ extra_info = ""
+
+ yield sev_state, "%d %s Instances%s" % (len(instances), sev.upper(), extra_info)
+
+check_info["ucs_bladecenter_faultinst"] = {
+ 'parse_function': ucs_bladecenter_convert_info,
+ 'inventory_function': inventory_ucs_bladecenter_faultinst,
+ 'check_function': check_ucs_bladecenter_faultinst,
+ 'service_description': 'Fault Instances',
+ 'includes': [ 'ucs_bladecenter.include' ],
+}
+
diff --git a/checks/ucs_bladecenter_topsystem b/checks/ucs_bladecenter_topsystem
new file mode 100644
index 0000000..fc9102b
--- /dev/null
+++ b/checks/ucs_bladecenter_topsystem
@@ -0,0 +1,47 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2015 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+
+# <<<ucs_bladecenter_topsystem:sep(9)>>>
+# topSystem Address 172.20.33.175 CurrentTime 2015-07-15T16:40:27.600 Ipv6Addr :: Mode cluster Name svie23ucsfi01 SystemUpTime 125:16:10:53
+
+def inventory_ucs_bladecenter_topsystem(info):
+ yield None, None
+
+def check_ucs_bladecenter_topsystem(item, _no_params, info):
+ for entry in info[0][1:]:
+ tokens = entry.split(" ", 1)
+ print tokens
+ if len(tokens) == 2:
+ yield 0, "%s: %s" % tuple(tokens)
+
+check_info["ucs_bladecenter_topsystem"] = {
+ 'inventory_function': inventory_ucs_bladecenter_topsystem,
+ 'check_function': check_ucs_bladecenter_topsystem,
+ 'service_description': 'UCS TopSystem Info',
+ 'includes': [ 'ucs_bladecenter.include' ],
+}
+
Module: check_mk
Branch: master
Commit: a38ad6db2637a8d51ec39b51fd1b072a1ab5161e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a38ad6db2637a8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jul 16 13:58:10 2015 +0200
When executing actions, for example setting downtimes, on equal named hosts
existing in different sites, previous versions did only execute the action
for the first site. The actions for the equal named hosts/services were
not performed on the other sites.
Conflicts:
ChangeLog
web/htdocs/views.py
---
.werks/2468 | 13 +++++++++++++
ChangeLog | 1 +
web/htdocs/views.py | 4 ++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/2468 b/.werks/2468
new file mode 100644
index 0000000..432ea2e
--- /dev/null
+++ b/.werks/2468
@@ -0,0 +1,13 @@
+Title: Fixed actions for duplicate host names on different sites
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1437047135
+
+When executing actions, for example setting downtimes, on equal named hosts
+existing in different sites, previous versions did only execute the action
+for the first site. The actions for the equal named hosts/services were
+not performed on the other sites.
diff --git a/ChangeLog b/ChangeLog
index e05ae58..1edd074 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -75,6 +75,7 @@
* 1263 FIX: Fixed handling of urls in views...
* 2396 FIX: LDAP: Fixed handling of LDAP trees having special chars in the path (e.g. in OU names)...
* 2459 FIX: Preventing caching of all HTTP requests to dynamic pages (*.py)...
+ * 2468 FIX: Fixed actions for duplicate host names on different sites...
WATO:
* 2365 Removed old deprecated notification global options for plain emails...
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index a7e0dfe..88df516 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1960,7 +1960,7 @@ def do_actions(view, what, action_rows, backurl):
for nr, row in enumerate(action_rows):
core_commands, title, executor = core_command(what, row, nr, len(action_rows))
for command_entry in core_commands:
- if command_entry not in already_executed:
+ if (row["site"], command_entry) not in already_executed:
# Some command functions return the information about the site per-command (e.g. for BI)
if type(command_entry) == tuple:
site, command = command_entry
@@ -1972,7 +1972,7 @@ def do_actions(view, what, action_rows, backurl):
command = command.encode("utf-8")
executor(command, site)
- already_executed.add(command_entry)
+ already_executed.add((row["site"], command_entry))
count += 1
message = None
Module: check_mk
Branch: master
Commit: 44b2530d860a6abc6075ee896960d951adc1cf2f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=44b2530d860a6a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jul 16 10:50:21 2015 +0200
#2467 FIX Fixed encoding exception occuring in localized GUI when a WATO action triggers an error message
For example this could happen when using the German localization and one deletes a contact group which
still has contacts assigned. This could also happen for other actions like host- or service group
management.
---
.werks/2467 | 12 ++++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 4 ++--
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/.werks/2467 b/.werks/2467
new file mode 100644
index 0000000..32c00ea
--- /dev/null
+++ b/.werks/2467
@@ -0,0 +1,12 @@
+Title: Fixed encoding exception occuring in localized GUI when a WATO action triggers an error message
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1437036533
+
+For example this could happen when using the German localization and one deletes a contact group which
+still has contacts assigned. This could also happen for other actions like host- or service group
+management.
diff --git a/ChangeLog b/ChangeLog
index 6c62134..9d10343 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -90,6 +90,7 @@
* 2461 FIX: Service Discovery: Hiding action buttons to rules when user is not permitted to rulesets
* 2464 FIX: UDP ports for SNMP communication can now be configured via WATO
* 2466 FIX: Fixed exception when searching for rulesets / global settings using special characters like umlauts
+ * 2467 FIX: Fixed encoding exception occuring in localized GUI when a WATO action triggers an error message...
Notifications:
* 2313 FIX: notification bulking: fixed exception for plugins which are not configured with checkboxes, e.g. sms
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 5217c60..a202509 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -265,8 +265,8 @@ def page_handler():
config.need_permission(pname)
except MKUserError, e:
- action_message = str(e)
- html.add_user_error(e.varname, str(e))
+ action_message = "%s" % e
+ html.add_user_error(e.varname, action_message)
except MKAuthException, e:
action_message = e.reason
Module: check_mk
Branch: master
Commit: 23c8a78c3a4c3038325cbbdf74537bfa88186402
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=23c8a78c3a4c30…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Jul 16 09:38:26 2015 +0200
#1272 alcatel_power, alcatel_temp Support for stacked environments
The Checks handle now the case of stacked switches. Before this change, some of the
temperature Sensors where missing. Only in this case you need to do a new discovery and the service names change.
On normal switches, nothing will change with this werk.
---
.werks/1272 | 12 ++++++++++++
ChangeLog | 2 ++
checks/alcatel_power | 6 ++++--
checks/alcatel_temp | 27 +++++++++++++++++++++++----
4 files changed, 41 insertions(+), 6 deletions(-)
diff --git a/.werks/1272 b/.werks/1272
new file mode 100644
index 0000000..ffd82b8
--- /dev/null
+++ b/.werks/1272
@@ -0,0 +1,12 @@
+Title: alcatel_power, alcatel_temp Support for stacked environments
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.2.7i3
+Date: 1437032151
+Class: feature
+
+The Checks handle now the case of stacked switches. Before this change, some of the
+temperature Sensors where missing. Only in this case you need to do a new discovery and the service names change.
+On normal switches, nothing will change with this werk.
+
diff --git a/ChangeLog b/ChangeLog
index 7ff1e43..6961def 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,8 @@
* 1269 esx_vsphere_counters.diskio: Check now uses the default diskstat implementation...
NOTE: Please refer to the migration notes!
* 2401 windows agent: changed executionpolicy for powershell scripts to unrestricted...
+ * 1272 alcatel_power, alcatel_temp Support for stacked environments...
+ NOTE: Please refer to the migration notes!
* 2315 FIX: windows agent: BOM replacement, fixed incorrect byte offset...
* 2316 FIX: windows agent: fix garbled output of cached agent plugins...
* 2358 FIX: check_mk_agent.solaris: more correct computation of zfs used space...
diff --git a/checks/alcatel_power b/checks/alcatel_power
index 7d03fa9..4e14e7d 100644
--- a/checks/alcatel_power
+++ b/checks/alcatel_power
@@ -25,12 +25,14 @@
# Boston, MA 02110-1301 USA.
def inventory_alcatel_power(info):
- return [ (x[0], None) for x in info if x[2] in ['0x35000001', '0x45000004', '0x45000002', '0x45000009']]
+ for line in info:
+ if line[2] in ['0x35000001', '0x45000002', '0x45000004', '0x45000008', '0x45000009']:
+ yield line[0], None
def check_alcatel_power(item, _no_params, info):
for line in info:
if item == line[0]:
- if line[2] not in ['0x35000001', '0x45000004', '0x45000002', '0x45000009']:
+ if line[2] not in ['0x35000001', '0x45000004', '0x45000002', '0x45000008', '0x45000009']:
return 3, "No Power supply connected to this port"
if int(line[1]) != 1:
return 2, "Supply in error condition (%s)" % line[1]
diff --git a/checks/alcatel_temp b/checks/alcatel_temp
index f6d6397..cd52b20 100644
--- a/checks/alcatel_temp
+++ b/checks/alcatel_temp
@@ -29,13 +29,32 @@ factory_settings['alcatel_temp'] = {
}
def inventory_alcatel_temp(info):
- for oid, name in enumerate(["Board", "CPU"]):
- if info[0][oid] != '0':
- yield name, {}
+ with_slot = True
+ if len(info) == 1:
+ with_slot = False
+ for index in range(len(info)):
+ slot = index + 1
+ for oid, name in enumerate(["Board", "CPU"]):
+ if info[index][oid] != '0':
+ if with_slot:
+ yield "Slot %s %s" % (slot, name), {}
+ else:
+ yield name, {}
def check_alcatel_temp(item, params, info):
+ if len(info) == 1:
+ slot_index = 0
+ else:
+ slot = int(item.split()[1])
+ slot_index = slot - 1
+ sensor = item.split()[-1]
items = { "Board" : 0, "CPU": 1 }
- temp_celsius = int(info[0][items[item]])
+ try:
+ # If multiple switches are staked and one of them are
+ # not reachable, prevent a exception
+ temp_celsius = int(info[slot_index][items[sensor]])
+ except:
+ return 3, "Sensor not found"
return check_temperature(temp_celsius, params)
check_info["alcatel_temp"] = {