diff --git a/addon/addon/server.tcl b/addon/addon/server.tcl index ddcd851..978719f 100644 --- a/addon/addon/server.tcl +++ b/addon/addon/server.tcl @@ -48,18 +48,20 @@ proc handle_connection { channelId clientAddress clientPort } { puts $channelId "<<>>" puts $channelId "[exec sed 1,2d /proc/net/dev]" + puts $channelId "<<>>" if { [regexp CCU2 [exec grep Hardware < /proc/cpuinfo]] == 0 } { - puts $channelId "<<>>" puts $channelId "[exec df -PTk | sed 1d]" - - puts $channelId "<<>>" - puts $channelId "[exec grep ^/dev < /proc/mounts]" - - puts $channelId "<<>>" - puts $channelId "[clock seconds]" - puts $channelId "[exec egrep { (x?[shv]d[a-z]*|cciss/c[0-9]+d[0-9]+|emcpower[a-z]+|dm-[0-9]+|VxVM.*|mmcblk.*|dasd[a-z]*|bcache[0-9]+|nvme[0-9]+n[0-9]+) } < /proc/diskstats]" + } else { + puts $channelId "[exec df -Pk | sed 1d]" } + puts $channelId "<<>>" + puts $channelId "[exec egrep ^(/dev|ubi) < /proc/mounts]" + + puts $channelId "<<>>" + puts $channelId "[clock seconds]" + puts $channelId "[exec egrep { (x?[shv]d[a-z]*|cciss/c[0-9]+d[0-9]+|emcpower[a-z]+|dm-[0-9]+|VxVM.*|mmcblk.*|dasd[a-z]*|bcache[0-9]+|nvme[0-9]+n[0-9]+|mtdblock.+) } < /proc/diskstats]" + if { [file exists /usr/bin/ntpq] == 1 } { puts $channelId "<<>>" puts $channelId "[exec ntpq -np | sed -e 1,2d -e {s/^\(.\)/\1 /} -e {s/^ /%/}]" @@ -80,7 +82,7 @@ proc handle_connection { channelId clientAddress clientPort } { } foreach plugin [glob -nocomplain "[file dirname [info script]]/plugins/*"] { - puts $channelId "[exec $plugin]" + puts $channelId [exec $plugin] } flush $channelId @@ -110,7 +112,7 @@ proc get_homematic_check_result { } { _dp = dom.GetObject(_svc.AlTriggerDP()); _ch = dom.GetObject(_dp.Channel()); _dev = dom.GetObject(_ch.Device()); - + WriteLine("SVC_MSG;" # _dev.Name() # ";" # _svc.Name().StrValueByIndex (".", 1).StrValueByIndex ("-", 0) # ";" # _dp.Timestamp()); } } diff --git a/addon/rc.d/check_mk_agent b/addon/rc.d/check_mk_agent index a063fbe..ac49bfd 100644 --- a/addon/rc.d/check_mk_agent +++ b/addon/rc.d/check_mk_agent @@ -23,7 +23,7 @@ case "$1" in info) echo "Info: (Inoffical) check_mk agent" - echo "Version: 1.0" + echo "Version: 1.1" echo "Name: check_mk_agent" echo "Operations: uninstall restart" ;; diff --git a/check/checks/homematic b/check/checks/homematic index f06a91d..1d90487 100644 --- a/check/checks/homematic +++ b/check/checks/homematic @@ -71,10 +71,6 @@ def inventory_homematic_humidity(parsed): if temperature is not None and humidity is not None: yield line, { } -# data = parsed[line] -# if isinstance(data, dict) and data.get('HSSTYPE', 'UNKNOWN') in [ [u'HM-WDS10-TH-O'], [u'HM-WDS20-TH-O'], [u'HM-WDS40-TH-I'], [u'HM-CC-TC'], [u'HM-WDS100-C6-O-2'], [u'HM-WDS100-C6-O'], [u'HM-TC-IT-WM-W-EU'], [u'HM-WDS40-TH-I-2'], [u'HM-WDC7000'], [u'HMIP-WTH'], [u'HmIP-WTH-2'], [u'HmIP-STH'], [u'HmIP-STHD'], [u'HmIP-BWTH'], [u'HmIP-BWTH24'] ]: -# yield line, { } - def check_homematic_humidity(item, params, parsed): for line in parsed: if line == item: @@ -85,6 +81,7 @@ def check_homematic_humidity(item, params, parsed): if humidity is None or temperature is None: return 3, 'Humidity or temperature are not available' + date = humidity[1] temperature = float(temperature[0]) humidity = float(humidity[0]) @@ -95,7 +92,7 @@ def check_homematic_humidity(item, params, parsed): else: state = 0 - message = "Temperature: %f, Humidity: %f" % (temperature, humidity) + message = "Temperature: %f, Humidity: %f (last change: %s)" % (temperature, humidity, date) perfdata = [ ('temperature', temperature), ('humidity', humidity), diff --git a/check/homematic b/check/homematic index 3077f9b..0b46542 100644 --- a/check/homematic +++ b/check/homematic @@ -15,6 +15,6 @@ 'plugins/wato/homematic.py']}, 'name': 'homematic', 'title': 'Homematic', - 'version': '1.0', + 'version': '1.1', 'version.min_required': '1.2.8', - 'version.packaged': '1.4.0p5'} + 'version.packaged': '1.4.0p8'}