Module: check_mk
Branch: master
Commit: 2bc84b39c2c7d0b7872a1053af9749e9c61494fe
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2bc84b39c2c7d0…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Jan 21 10:00:28 2019 +0100
lnx_thermal: Use standard text if item not found
Change-Id: Iafe6ec568c02944a6d0a3d6196a6f8e65820b5eb
---
checks/lnx_thermal | 4 ++--
tests/unit/checks/generictests/datasets/lnx_thermal.py | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/checks/lnx_thermal b/checks/lnx_thermal
index f165b68..8386532 100644
--- a/checks/lnx_thermal
+++ b/checks/lnx_thermal
@@ -100,8 +100,8 @@ def check_lnx_thermal(item, params, parsed):
hot_value = parsed.get(item).get('hot')
critical_value = parsed.get(item).get('critical')
- if not temperature:
- return 3, "Item not found or invalid agent data."
+ if temperature is None:
+ return
if hot_value and critical_value:
crit_level = min(hot_value, critical_value)
diff --git a/tests/unit/checks/generictests/datasets/lnx_thermal.py
b/tests/unit/checks/generictests/datasets/lnx_thermal.py
index cc54922..3def5af 100644
--- a/tests/unit/checks/generictests/datasets/lnx_thermal.py
+++ b/tests/unit/checks/generictests/datasets/lnx_thermal.py
@@ -20,9 +20,9 @@ discovery = {
checks = {
'': [('Zone 0', {
- 'device_levels_handling': 'devdefault',
- 'levels': (70.0, 80.0)
- }, [(0, u'57.0 \xb0C', [('temp', 57.0, 127.0, 127.0, None,
None)])]),
+ 'device_levels_handling': 'devdefault',
+ 'levels': (70.0, 80.0)
+ }, [(0, u'57.0 \xb0C', [('temp', 57.0, 127.0, 127.0, None,
None)])]),
('Zone 1', {
'device_levels_handling': 'devdefault',
'levels': (70.0, 80.0)