Module: check_mk
Branch: master
Commit: 0bc1f344ef2911fa22661c33888f372fcd0f2047
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0bc1f344ef2911…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Sep 14 10:34:21 2016 +0200
3856 Improved handling of Check_MK GUI request timeouts
In previous Check_MK versions, there was no real user friendly and correct
handling of too long web request processing. So if a user issued a request
to the Multisite GUI which took longer than the system apache request timeout,
it resulted in a default webserver error page showing a "proxy timeout" error
message.
Another issue: The timeout was dependent on your system apache configuration
and, if you did not change the settings on your own, on the Linux distribution
defaults.
We have now changed the timeout mechanism as follows:
The system apache process will end the communication with the client after
the timeout configured for the proxy connection from system apache to site
apache. This is done in /omd/sites/[site]/etc/apache/proxy-port.conf file
in the "timeout=x" parameter of the ProxyPass statement. The client timeout
has been configured to 120 seconds.
The application (Check_MK GUI) request timeout should always be lower than
the client timeout to make it possible to abort the page processing and send
a helpful response page to the client. The default timeout is set to 110
seconds.
Developer note:
It is possible to disable the applications request timeout (temoporarily)
or totally for specific calls, but the timeout to the client will always
be applied by the system webserver. So the client will always get a error
page while the site apache continues processing the request (until the
first try to write anything to the client) which will result in an
exception.
---
.werks/3856 | 40 ++++++++++++++++++++++++++++++
ChangeLog | 1 +
web/htdocs/html_mod_python.py | 7 +++---
web/htdocs/htmllib.py | 57 +++++++++++++++++++++++++++++++++++++++++--
web/htdocs/wato.py | 2 --
5 files changed, 100 insertions(+), 7 deletions(-)
diff --git a/.werks/3856 b/.werks/3856
new file mode 100644
index 0000000..dfb36b9
--- /dev/null
+++ b/.werks/3856
@@ -0,0 +1,40 @@
+Title: Improved handling of Check_MK GUI request timeouts
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.4.0i1
+Date: 1473841576
+Class: feature
+
+In previous Check_MK versions, there was no real user friendly and correct
+handling of too long web request processing. So if a user issued a request
+to the Multisite GUI which took longer than the system apache request timeout,
+it resulted in a default webserver error page showing a "proxy timeout" error
+message.
+
+Another issue: The timeout was dependent on your system apache configuration
+and, if you did not change the settings on your own, on the Linux distribution
+defaults.
+
+We have now changed the timeout mechanism as follows:
+
+The system apache process will end the communication with the client after
+the timeout configured for the proxy connection from system apache to site
+apache. This is done in /omd/sites/[site]/etc/apache/proxy-port.conf file
+in the "timeout=x" parameter of the ProxyPass statement. The client timeout
+has been configured to 120 seconds.
+
+The application (Check_MK GUI) request timeout should always be lower than
+the client timeout to make it possible to abort the page processing and send
+a helpful response page to the client. The default timeout is set to 110
+seconds.
+
+Developer note:
+
+It is possible to disable the applications request timeout (temoporarily)
+or totally for specific calls, but the timeout to the client will always
+be applied by the system webserver. So the client will always get a error
+page while the site apache continues processing the request (until the
+first try to write anything to the client) which will result in an
+exception.
+
diff --git a/ChangeLog b/ChangeLog
index c370b64..d1a7724 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -412,6 +412,7 @@
* 3780 availability: now limit of fetched logfile rows is configurable.
* 3864 tactical overview now shows the number of stale hosts and services
* 3847 Painter options can now be reset to defaults...
+ * 3856 Improved handling of Check_MK GUI request timeouts...
* 3059 FIX: Fixed highlighting of availability timeline time slices
* 3175 FIX: Fix timeranges of graphs that are embedded in a dashboard...
* 3076 FIX: fixed broken views in check_mk raw edition
diff --git a/web/htdocs/html_mod_python.py b/web/htdocs/html_mod_python.py
index 6dad47c..c14d40b 100644
--- a/web/htdocs/html_mod_python.py
+++ b/web/htdocs/html_mod_python.py
@@ -25,7 +25,7 @@
# Boston, MA 02110-1301 USA.
from mod_python import Cookie, util, apache
-from lib import make_utf8, MKGeneralException
+from lib import make_utf8, MKGeneralException, MKException
import htmllib
import os, time, config, weblib, re
import defaults
@@ -45,6 +45,8 @@ class html_mod_python(htmllib.html):
def __init__(self, req, fields):
htmllib.html.__init__(self)
+ self.enable_request_timeout()
+
req.content_type = "text/html; charset=UTF-8"
req.header_sent = False
@@ -69,8 +71,7 @@ class html_mod_python(htmllib.html):
self.set_output_format(self.var("output_format", "html"))
- # The web servers configured request timeout (Timeout in case of apache)
- def request_timeout(self):
+ def client_request_timeout(self):
return int(self.req.server.timeout)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 5a7e597..1887994 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -60,13 +60,14 @@ import urllib
import random
import re
import __builtin__
+import signal
try:
import simplejson as json
except ImportError:
import json
-from cmk.exceptions import MKGeneralException
+from cmk.exceptions import MKGeneralException, MKException
from lib import MKUserError
# Information about uri
@@ -76,6 +77,10 @@ class InvalidUserInput(Exception):
self.text = text
+class RequestTimeout(MKException):
+ pass
+
+
# This is a simple class which wraps a string provided by the caller
# to make html.attrencode() know that this string should not be
# encoded, html.attrencode() will then return the unmodified value.
@@ -130,6 +135,7 @@ class html(object):
self.body_classes = ['main']
self._default_javascripts = [ "checkmk", "graphs" ]
self._default_stylesheets = [ "check_mk", "graphs" ]
+ self._request_timeout = 110 # seconds
# Time measurement
self.times = {}
@@ -159,7 +165,9 @@ class html(object):
raise NotImplementedError()
- def request_timeout(self):
+ # The system web servers configured request timeout. This is the time
+ # before the request is terminated from the view of the client.
+ def client_request_timeout(self):
raise NotImplementedError()
@@ -1959,3 +1967,48 @@ class html(object):
elapsed = now - self.last_measurement
self.times[name] += elapsed
self.last_measurement = now
+
+
+ #
+ # Request timeout handling
+ #
+ # The system apache process will end the communication with the client after
+ # the timeout configured for the proxy connection from system apache to site
+ # apache. This is done in /omd/sites/[site]/etc/apache/proxy-port.conf file
+ # in the "timeout=x" parameter of the ProxyPass statement.
+ #
+ # The regular request timeout configured here should always be lower to make
+ # it possible to abort the page processing and send a helpful answer to the
+ # client.
+ #
+ # It is possible to disable the applications request timeout (temoporarily)
+ # or totally for specific calls, but the timeout to the client will always
+ # be applied by the system webserver. So the client will always get a error
+ # page while the site apache continues processing the request (until the
+ # first try to write anything to the client) which will result in an
+ # exception.
+ #
+
+ # The timeout of the Check_MK GUI request processing. When the timeout handling
+ # has been enabled with enable_request_timeout(), after this time an alarm signal
+ # will be raised to give the application the option to end the processing in a
+ # gentle way.
+ def request_timeout(self):
+ return self._request_timeout
+
+
+ def enable_request_timeout(self):
+ signal.signal(signal.SIGALRM, self.handle_request_timeout)
+ signal.alarm(self.request_timeout())
+
+
+ def disable_request_timeout(self):
+ signal.alarm(0)
+
+
+ def handle_request_timeout(self, signum, frame):
+ raise RequestTimeout(_("Your request timed out after %d seconds. This issue may be "
+ "related to a local configuration problem or a request which works "
+ "with a too large number of objects. But if you think this "
+ "issue is a bug, please send a crash report.") %
+ self.request_timeout())
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index eb150a7..d90a640 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -3436,8 +3436,6 @@ def mode_bulk_discovery(phase):
arguments = [ "@raiseerrors" ] + arguments
timeout = html.request_timeout()
- # To have a chance to print an error reduce the timeout a bit
- timeout = int(timeout * 0.8)
unlock_exclusive() # Avoid freezing WATO when hosts do not respond timely
counts, failed_hosts = check_mk_automation(site_id, "inventory",
Module: check_mk
Branch: master
Commit: 570e49fb2ff67a899f8054df99eb47ee474d8db0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=570e49fb2ff67a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Sep 13 17:04:41 2016 +0200
3855 SEC Fixed possible command injection by privileged WATO users
In all previous 1.2.8 versions authenticated and privileged WATO users,
the ones which are able to add or edit hosts, were able to inject shell
commands to Check_MK which are then executed in the context of the monitoring
site user.
The user was able to configure a host address in a specific format to inject
such shell commands to the configuration. Once the configuration was activated
and loaded into the monitoring core, the command was executed in context of
the monitoring site user in the moment a parent scan was started for that host.
Thanks for analyzing and reporting this issue to Christian Fünfhaus!
---
.werks/3855 | 20 ++++++++++++++++++++
ChangeLog | 1 +
modules/check_mk.py | 8 ++++----
3 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/.werks/3855 b/.werks/3855
new file mode 100644
index 0000000..9285584
--- /dev/null
+++ b/.werks/3855
@@ -0,0 +1,20 @@
+Title: Fixed possible command injection by privileged WATO users
+Level: 2
+Component: wato
+Class: security
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1473778544
+
+In all previous 1.2.8 versions authenticated and privileged WATO users,
+the ones which are able to add or edit hosts, were able to inject shell
+commands to Check_MK which are then executed in the context of the monitoring
+site user.
+
+The user was able to configure a host address in a specific format to inject
+such shell commands to the configuration. Once the configuration was activated
+and loaded into the monitoring core, the command was executed in context of
+the monitoring site user in the moment a parent scan was started for that host.
+
+Thanks for analyzing and reporting this issue to Christian Fünfhaus!
diff --git a/ChangeLog b/ChangeLog
index 4a0f6d7..c370b64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -521,6 +521,7 @@
* 3792 check_http: now able to configure HTTP method PROPFIND
* 3851 Host edit dialog: Checkbox hosttags are now checked by default...
* 3800 WATO rule overview: Adjusted wording of condition texts
+ * 3855 SEC: Fixed possible command injection by privileged WATO users...
* 3060 FIX: Folder properties: Fixed exception when a user has no alias set...
* 3062 FIX: Git integration: Fixed not adding files in WATO folders to git control
* 3203 FIX: Distributed WATO: Fixed exception in remote host service discovery...
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 00c5f18..ba4657c 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -4600,8 +4600,8 @@ def do_scan_parents(hosts):
sys.stdout.write("\nWrote %s\n" % outfilename)
def gateway_reachable_via_ping(ip, probes):
- return 0 == os.system("ping -q -i 0.2 -l 3 -c %d -W 5 '%s' >/dev/null 2>&1" %
- (probes, ip)) >> 8
+ return 0 == os.system("ping -q -i 0.2 -l 3 -c %d -W 5 %s >/dev/null 2>&1" %
+ (probes, quote_shell_string(ip))) >> 8
def scan_parents_of(hosts, silent=False, settings={}):
if monitoring_host:
@@ -4620,11 +4620,11 @@ def scan_parents_of(hosts, silent=False, settings={}):
sys.stdout.flush()
try:
ip = lookup_ipv4_address(host)
- command = "traceroute -w %d -q %d -m %d -n '%s' 2>&1" % (
+ command = "traceroute -w %d -q %d -m %d -n %s 2>&1" % (
settings.get("timeout", 8),
settings.get("probes", 2),
settings.get("max_ttl", 10),
- ip)
+ quote_shell_string(ip))
if opt_debug:
sys.stderr.write("Running '%s'\n" % command)
procs.append( (host, ip, os.popen(command) ) )
Module: check_mk
Branch: master
Commit: 8f011781da81e07380fc44b360065d5b8e014aca
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8f011781da81e0…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Wed Sep 14 10:34:31 2016 +0200
fixed useless at end of line
---
checks/lnx_if | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/checks/lnx_if b/checks/lnx_if
index 17c90e1..a46a01b 100644
--- a/checks/lnx_if
+++ b/checks/lnx_if
@@ -79,10 +79,10 @@ def if_lnx_extract_nic_info(info):
if line[0].startswith("[end_iplink]"):
line = lines.next()
break
- # There some cases with an additional line. These are currently unused$
- # but need to be handled anyway. This particular line contains information$
- # provided by cisco about neighors (CDP)$
- if line[0].startswith("alias"):$
+ # There some cases with an additional line. These are currently unused
+ # but need to be handled anyway. This particular line contains information
+ # provided by cisco about neighors (CDP)
+ if line[0].startswith("alias"):
continue
# Each interface in this block is represented by two lines
status_info = line
Module: check_mk
Branch: master
Commit: 7e3baef91d61dca4b8f4764781a2f9ee3936fa50
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7e3baef91d61dc…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Wed Sep 14 10:23:00 2016 +0200
3837 FIX Fixed empty check if lnx_if info contains additional line
The output of lnx_if check has been empty if the interface provides an additional line
provided by CDP (Cisco Discovery Protocol). This is fixed now but not further handled
at the moment and may be a feature in the future.
---
.werks/3837 | 11 +++++++++++
ChangeLog | 1 +
checks/lnx_if | 5 +++++
3 files changed, 17 insertions(+)
diff --git a/.werks/3837 b/.werks/3837
new file mode 100644
index 0000000..34e2551
--- /dev/null
+++ b/.werks/3837
@@ -0,0 +1,11 @@
+Title: Fixed empty check if lnx_if info contains additional line
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1473840897
+Class: fix
+
+The output of lnx_if check has been empty if the interface provides an additional line
+provided by CDP (Cisco Discovery Protocol). This is fixed now but not further handled
+at the moment and may be a feature in the future.
diff --git a/ChangeLog b/ChangeLog
index 5e6097e..4a0f6d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -386,6 +386,7 @@
* 3870 FIX: elphase.include: more robust against none type params
* 3801 FIX: Fixed race condition with persisted data...
* 3854 FIX: juniper_bgp_state: Fixed service descriptions in some cases...
+ * 3837 FIX: Fixed empty check if lnx_if info contains additional line...
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/lnx_if b/checks/lnx_if
index 814e7d1..17c90e1 100644
--- a/checks/lnx_if
+++ b/checks/lnx_if
@@ -79,6 +79,11 @@ def if_lnx_extract_nic_info(info):
if line[0].startswith("[end_iplink]"):
line = lines.next()
break
+ # There some cases with an additional line. These are currently unused$
+ # but need to be handled anyway. This particular line contains information$
+ # provided by cisco about neighors (CDP)$
+ if line[0].startswith("alias"):$
+ continue
# Each interface in this block is represented by two lines
status_info = line
link_info = lines.next() # currently unused
Module: check_mk
Branch: master
Commit: 398de527a88015ced0d1a85ac0f739eb37f006e4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=398de527a88015…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Sep 13 08:26:05 2016 +0200
mkeventd: Minor cleanups
---
bin/mkeventd | 33 ++++++++++++++++++++++++++++-----
1 file changed, 28 insertions(+), 5 deletions(-)
diff --git a/bin/mkeventd b/bin/mkeventd
index a2b67dc..a9662c4 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -1,5 +1,28 @@
#!/usr/bin/env python
-# encoding: utf-8
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 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-
+# tails. 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.
import socket, os, time, sys, getopt, signal, thread, pprint, re, \
select, subprocess, stat, string
@@ -4178,10 +4201,10 @@ try:
file(g_pid_file, "w").write("%d\n" % os.getpid())
# Install signal hander
- signal.signal(1, signal_handler) # HUP (--> reload)
- signal.signal(2, signal_handler) # INT
- signal.signal(3, signal_handler) # QUIT
- signal.signal(15, signal_handler) # TERM
+ signal.signal(signal.SIGHUP, signal_handler)
+ signal.signal(signal.SIGINT, signal_handler)
+ signal.signal(signal.SIGQUIT, signal_handler)
+ signal.signal(signal.SIGTERM, signal_handler)
# Now let's go...
run_eventd()
Module: check_mk
Branch: master
Commit: 6fd8261782137e7186f848bcae90943ecb347278
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6fd8261782137e…
Author: Sven Rueß <sr(a)mathias-kettner.de>
Date: Tue Sep 13 11:11:15 2016 +0200
3883 kentix_humidity, kentix_temp: Added support of MultiSensor-LAN and MultiSensor-RACK
---
.werks/3883 | 8 ++++++++
ChangeLog | 1 +
checkman/kentix_humidity | 7 ++-----
checkman/kentix_temp | 33 ++-------------------------------
checks/kentix_humidity | 26 +++++++++++++-------------
checks/kentix_temp | 29 ++++++++++++++++-------------
6 files changed, 42 insertions(+), 62 deletions(-)
diff --git a/.werks/3883 b/.werks/3883
new file mode 100644
index 0000000..a09eca7
--- /dev/null
+++ b/.werks/3883
@@ -0,0 +1,8 @@
+Title: kentix_humidity, kentix_temp: Added support of MultiSensor-LAN and MultiSensor-RACK
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1473757772
+Class: feature
+
diff --git a/ChangeLog b/ChangeLog
index db6419c..5e6097e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -160,6 +160,7 @@
* 3744 synology_info: Now also displays OS version
* 3799 agent_netapp: No longer requires the files NaServer/NaElements. Reduced CPU usage by 2/3...
* 3872 mcafee_webgateway, mcafee_webgateway_misc: new checks which monitor some statistics of McAfee web gateway devices
+ * 3883 kentix_humidity, kentix_temp: Added support of MultiSensor-LAN and MultiSensor-RACK
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/checkman/kentix_humidity b/checkman/kentix_humidity
index ee70cc8..f3f0455 100644
--- a/checkman/kentix_humidity
+++ b/checkman/kentix_humidity
@@ -1,13 +1,10 @@
-title: Kentix MultiSensor-RACK: Humidity Sensor
+title: Kentix MultiSensor: Humidity Sensor
agents: snmp
catalog: hw/environment/kentix
license: GPL
distribution: check_mk
description:
- This check monitors the humidity measured by the Kentix MultiSensor-RACK device.
+ This check monitors the humidity measured by the Kentix MultiSensor-LAN or MultiSensor-RACK device.
No limits are set in the check, since limits are configured in the device
itself. These limits are taken as the lower and upper warning levels of the check.
-
-perfdata:
- One variable: the humidity
diff --git a/checkman/kentix_temp b/checkman/kentix_temp
index c47d2e3..3807d66 100644
--- a/checkman/kentix_temp
+++ b/checkman/kentix_temp
@@ -1,39 +1,10 @@
-title: Kentix MultiSensor-RACK: Temperature Sensor
+title: Kentix MultiSensor: Temperature Sensor
agents: snmp
catalog: hw/environment/kentix
license: GPL
distribution: check_mk
description:
- This check monitors the temperature measured by the Kentix MultiSensor-RACK device.
+ This check monitors the temperature measured by the Kentix MultiSensor-LAN or MultiSensor-RACK device.
The device allows to configure an upper and lower warning level. These are used as
device critical levels.
-
-item:
- "Rack"
-
-perfdata:
- One variable: the temperature in °C
-
-[parameters]
-parameters(dict): This checks parameters are a dictionary with the
- following (optional) keys:
-
- {"levels"}: A tuple (warn, crit) containing the upper levels. Default: (70, 80)
-
- {"levels_lower"}: A tuple (warn, crit) containing the lower levels. No defaults.
-
- {"output_unit"}: "c", "f" or "k", the check will output the temperature in the
- specified unit. If this is not set, output is in degrees Celsius.
-
- {"input_unit"}: "c, "f" or "k". By default, the check interprets the sensor value
- according to the unit sent by the device. This key allows to override that. Tread
- lightly, as this may lead to a misinterpreted temperature. Should only be used if
- the device reports its unit incorrectly.
-
- {"device_levels_handling"}: How the check treats the device's internal levels
- versus the ones you specify yourself. The following options are supported: "best"
- results in the best status between yours and the device's levels, "worst" in the
- worst, "usr" ignore's the device's levels, "dev" ignores yours, usrdefault and
- devdefault uses your/the devices set of levels if present, otherwise the other
- respectively. Default setting is "devdefault"
diff --git a/checks/kentix_humidity b/checks/kentix_humidity
index 178ecf3..ec14749 100644
--- a/checks/kentix_humidity
+++ b/checks/kentix_humidity
@@ -29,6 +29,7 @@ def inventory_kentix_humidity(info):
return [ (None, None ) ]
def check_kentix_humidity(_no_item, _no_params, info):
+ info[0][0] = info[0][0].split('.', 3)[-1]
value, lower_warn, upper_warn, alarm, text = info[0]
temp = float(value)/10
perfdata = [ ("humidity", temp, lower_warn+":"+upper_warn ) ]
@@ -43,17 +44,16 @@ def check_kentix_humidity(_no_item, _no_params, info):
return state, infotext, perfdata
check_info["kentix_humidity"] = {
- 'check_function': check_kentix_humidity,
- 'inventory_function': inventory_kentix_humidity,
- 'service_description': 'Humidity',
- 'has_perfdata': True,
- 'snmp_info': ('.1.3.6.1.4.1.37954.3.1.2',
- ['1', # humidityValue
- '2', # humidityMin
- '3', # humidityMax
- '4', # humidityAlarm, not used
- '5', # humidityAlarmtext
- ]
- ),
- "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.332.11.6"),
+ 'check_function' : check_kentix_humidity,
+ 'inventory_function' : inventory_kentix_humidity,
+ 'service_description' : 'Humidity',
+ 'has_perfdata' : True,
+ 'snmp_info' : ('.1.3.6.1.4.1.37954', ['2.1.2', '3.1.2'],
+ ['1', # humidityValue
+ '2', # humidityMin
+ '3', # humidityMax
+ '4', # humidityAlarm, not used
+ '5', # humidityAlarmtext
+ ]),
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.332.11.6"),
}
diff --git a/checks/kentix_temp b/checks/kentix_temp
index c87831f..e0cd2f1 100644
--- a/checks/kentix_temp
+++ b/checks/kentix_temp
@@ -25,10 +25,13 @@
# Boston, MA 02110-1301 USA.
def inventory_kentix_temp(info):
- if info:
- return [ ("Rack", {} ) ]
+ if info[0][0].startswith('2.1.1'):
+ return [ ('LAN', {} ) ]
+ else:
+ return [ ('Rack', {} ) ]
def check_kentix_temp(item, params, info):
+ info[0][0] = info[0][0].split('.', 3)[-1]
value, lower_warn, upper_warn, alarm, text = info[0]
temp = float(value)/10
@@ -37,17 +40,17 @@ def check_kentix_temp(item, params, info):
dev_levels_lower = (float(lower_warn), float(lower_warn)))
check_info["kentix_temp"] = {
- 'check_function' : check_kentix_temp,
- 'inventory_function' : inventory_kentix_temp,
- 'service_description' : 'Temperature %s',
- 'has_perfdata' : True,
- 'snmp_info' : ('.1.3.6.1.4.1.37954.3.1.1',
- ['1', # temperatureValue
- '2', # temperatureMin
- '3', # temperatureMax
- '4', # temperatureAlarm, not used here
- '5', # temperatureAlarmtext
- ]),
+ 'check_function' : check_kentix_temp,
+ 'inventory_function' : inventory_kentix_temp,
+ 'service_description' : 'Temperature %s',
+ 'has_perfdata' : True,
+ 'snmp_info' : ('.1.3.6.1.4.1.37954', ['2.1.1', '3.1.1'],
+ ['1', # temperatureValue
+ '2', # temperatureMin
+ '3', # temperatureMax
+ '4', # temperatureAlarm, not used here
+ '5', # temperatureAlarmtext
+ ]),
"snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.332.11.6"),
"group" : "temperature",
"includes" : [ "temperature.include" ],