Module: check_mk
Branch: master
Commit: 0833e7b1ff744c54ceac02595002d1dca5b5e1ce
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0833e7b1ff744c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 27 12:35:23 2018 +0100
6915 FIX IPMI Management board: Fixed random "Session no longer connected"
message
The Check_MK service of hosts that have a IPMI based management board configured could
randomly result in an UNKNOWN state with the error message "Session no longer
connected".
This was a result of unstable connections to the IPMI boards which should now be handled
in a more stable way.
CMK-1366
Change-Id: I5a9ee67bbaf305295ae68786dccd3ae9fd0bcf86
---
.werks/6915 | 15 +++++++++++++++
cmk_base/data_sources/ipmi.py | 4 ++++
2 files changed, 19 insertions(+)
diff --git a/.werks/6915 b/.werks/6915
new file mode 100644
index 0000000..9bf9b9c
--- /dev/null
+++ b/.werks/6915
@@ -0,0 +1,15 @@
+Title: IPMI Management board: Fixed random "Session no longer connected"
message
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1543317790
+
+The Check_MK service of hosts that have a IPMI based management board configured could
+randomly result in an UNKNOWN state with the error message "Session no longer
connected".
+
+This was a result of unstable connections to the IPMI boards which should now be handled
+in a more stable way.
diff --git a/cmk_base/data_sources/ipmi.py b/cmk_base/data_sources/ipmi.py
index 157e448..74a1701 100644
--- a/cmk_base/data_sources/ipmi.py
+++ b/cmk_base/data_sources/ipmi.py
@@ -89,6 +89,7 @@ class IPMIManagementBoardDataSource(ManagementBoardDataSource,
CheckMKAgentDataS
return ["mgmt_ipmi_sensors"]
def _execute(self):
+ connection = None
try:
connection = self._create_ipmi_connection()
@@ -106,6 +107,9 @@ class IPMIManagementBoardDataSource(ManagementBoardDataSource,
CheckMKAgentDataS
raise MKAgentError("IPMI communication failed: %r" % e)
else:
raise
+ finally:
+ if connection:
+ connection.ipmi_session.logout()
def _create_ipmi_connection(self):
# Do not use the (custom) ipaddress for the host. Use the management board