mirror of
https://github.com/alexreinert/homematic_check_mk.git
synced 2023-10-10 13:37:02 +02:00
Added date of last change to check message
Support more checks on CCU2 Preparations for release 1.1
This commit is contained in:
parent
13d1e92fac
commit
085bf4b77b
@ -48,17 +48,19 @@ proc handle_connection { channelId clientAddress clientPort } {
|
|||||||
puts $channelId "<<<lnx_if:sep(58)>>>"
|
puts $channelId "<<<lnx_if:sep(58)>>>"
|
||||||
puts $channelId "[exec sed 1,2d /proc/net/dev]"
|
puts $channelId "[exec sed 1,2d /proc/net/dev]"
|
||||||
|
|
||||||
if { [regexp CCU2 [exec grep Hardware < /proc/cpuinfo]] == 0 } {
|
|
||||||
puts $channelId "<<<df>>>"
|
puts $channelId "<<<df>>>"
|
||||||
|
if { [regexp CCU2 [exec grep Hardware < /proc/cpuinfo]] == 0 } {
|
||||||
puts $channelId "[exec df -PTk | sed 1d]"
|
puts $channelId "[exec df -PTk | sed 1d]"
|
||||||
|
} else {
|
||||||
|
puts $channelId "[exec df -Pk | sed 1d]"
|
||||||
|
}
|
||||||
|
|
||||||
puts $channelId "<<<mounts>>>"
|
puts $channelId "<<<mounts>>>"
|
||||||
puts $channelId "[exec grep ^/dev < /proc/mounts]"
|
puts $channelId "[exec egrep ^(/dev|ubi) < /proc/mounts]"
|
||||||
|
|
||||||
puts $channelId "<<<diskstat>>>"
|
puts $channelId "<<<diskstat>>>"
|
||||||
puts $channelId "[clock seconds]"
|
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]"
|
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 } {
|
if { [file exists /usr/bin/ntpq] == 1 } {
|
||||||
puts $channelId "<<<ntp>>>"
|
puts $channelId "<<<ntp>>>"
|
||||||
@ -80,7 +82,7 @@ proc handle_connection { channelId clientAddress clientPort } {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach plugin [glob -nocomplain "[file dirname [info script]]/plugins/*"] {
|
foreach plugin [glob -nocomplain "[file dirname [info script]]/plugins/*"] {
|
||||||
puts $channelId "[exec $plugin]"
|
puts $channelId [exec $plugin]
|
||||||
}
|
}
|
||||||
|
|
||||||
flush $channelId
|
flush $channelId
|
||||||
|
@ -23,7 +23,7 @@ case "$1" in
|
|||||||
|
|
||||||
info)
|
info)
|
||||||
echo "Info: <b>(Inoffical) check_mk agent</b>"
|
echo "Info: <b>(Inoffical) check_mk agent</b>"
|
||||||
echo "Version: 1.0"
|
echo "Version: 1.1"
|
||||||
echo "Name: check_mk_agent"
|
echo "Name: check_mk_agent"
|
||||||
echo "Operations: uninstall restart"
|
echo "Operations: uninstall restart"
|
||||||
;;
|
;;
|
||||||
|
@ -71,10 +71,6 @@ def inventory_homematic_humidity(parsed):
|
|||||||
if temperature is not None and humidity is not None:
|
if temperature is not None and humidity is not None:
|
||||||
yield line, { }
|
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):
|
def check_homematic_humidity(item, params, parsed):
|
||||||
for line in parsed:
|
for line in parsed:
|
||||||
if line == item:
|
if line == item:
|
||||||
@ -85,6 +81,7 @@ def check_homematic_humidity(item, params, parsed):
|
|||||||
if humidity is None or temperature is None:
|
if humidity is None or temperature is None:
|
||||||
return 3, 'Humidity or temperature are not available'
|
return 3, 'Humidity or temperature are not available'
|
||||||
|
|
||||||
|
date = humidity[1]
|
||||||
temperature = float(temperature[0])
|
temperature = float(temperature[0])
|
||||||
humidity = float(humidity[0])
|
humidity = float(humidity[0])
|
||||||
|
|
||||||
@ -95,7 +92,7 @@ def check_homematic_humidity(item, params, parsed):
|
|||||||
else:
|
else:
|
||||||
state = 0
|
state = 0
|
||||||
|
|
||||||
message = "Temperature: %f, Humidity: %f" % (temperature, humidity)
|
message = "Temperature: %f, Humidity: %f (last change: %s)" % (temperature, humidity, date)
|
||||||
perfdata = [
|
perfdata = [
|
||||||
('temperature', temperature),
|
('temperature', temperature),
|
||||||
('humidity', humidity),
|
('humidity', humidity),
|
||||||
|
@ -15,6 +15,6 @@
|
|||||||
'plugins/wato/homematic.py']},
|
'plugins/wato/homematic.py']},
|
||||||
'name': 'homematic',
|
'name': 'homematic',
|
||||||
'title': 'Homematic',
|
'title': 'Homematic',
|
||||||
'version': '1.0',
|
'version': '1.1',
|
||||||
'version.min_required': '1.2.8',
|
'version.min_required': '1.2.8',
|
||||||
'version.packaged': '1.4.0p5'}
|
'version.packaged': '1.4.0p8'}
|
||||||
|
Loading…
Reference in New Issue
Block a user