diff --git a/README.md b/README.md index 57b800feef879595fd2267a50b0fe09553e019ef..226970b2866ffec5442c823ae52b4da8cfab9159 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[PACKAGE]: ../../raw/master/mkp/snmp_uptime-0.0.2-20230805.mkp "snmp_uptime-0.0.2-20230805.mkp" +[PACKAGE]: ../../raw/master/mkp/snmp_uptime-0.0.3-20240616.mkp "snmp_uptime-0.0.3-20240616.mkp" # SNMP uptime This check is based on the snmp_uptime check form CMK. It adds the SNMP-FRAMEWORK-MIB::snmpEngineTime OID to the check. Its value is in seconds not ticks and therefore the Uptime can now be around 68 years before a rollover of the counter :-) diff --git a/mkp/snmp_uptime-0.0.3-20240616.mkp b/mkp/snmp_uptime-0.0.3-20240616.mkp new file mode 100644 index 0000000000000000000000000000000000000000..f0b7350646f2016bd987f249e768475bae18c64f Binary files /dev/null and b/mkp/snmp_uptime-0.0.3-20240616.mkp differ diff --git a/source/agent_based/snmp_uptime.py b/source/agent_based/snmp_uptime.py index 10ded8f0630f352df4cc16aef3a0b6735f2651a0..7b5a25ad18e0418b577e5150f7b572c98b8b69d3 100644 --- a/source/agent_based/snmp_uptime.py +++ b/source/agent_based/snmp_uptime.py @@ -15,12 +15,13 @@ # 2022-03-07: fixed if snmpEngineTime == 0 # 2022-03-08: renamed to snmp_uptime_extended to avoid caching issues with the original check # 2023-08-05: made parse function more stable (try/except/else) +# 2024-06-16: modified imports for CMK 2.3 from typing import Optional from cmk.base.plugins.agent_based.agent_based_api.v1 import exists, register, SNMPTree from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import StringTable -from cmk.base.plugins.agent_based.utils import uptime +from cmk.plugins.lib import uptime def parse_snmp_uptime_extended(string_table: StringTable) -> Optional[uptime.Section]: @@ -33,7 +34,6 @@ def parse_snmp_uptime_extended(string_table: StringTable) -> Optional[uptime.Sec True >>> parse_snmp_uptime_extended([['2297331594', '', '313671']]) Section(uptime_sec=313671, message=None) - """ try: sysUpTime, hrSystemUptime, snmpEngineTime = string_table[0] diff --git a/source/packages/snmp_uptime b/source/packages/snmp_uptime index 26800f8634bc1b73046147c041c7a0439b31f3c1..bfeee6a41f9a08791c54c4f71a59d469c9a4905e 100644 --- a/source/packages/snmp_uptime +++ b/source/packages/snmp_uptime @@ -8,7 +8,7 @@ 'files': {'agent_based': ['snmp_uptime.py']}, 'name': 'snmp_uptime', 'title': 'SNMP Uptime', - 'version': '0.0.2-20230805', - 'version.min_required': '2.0.0b1', + 'version': '0.0.3-20240616', + 'version.min_required': '2.3.0b1', 'version.packaged': 'cmk-mkp-tool 0.2.0', - 'version.usable_until': '2.3.0b1'} + 'version.usable_until': '2.4.0b1'}