From 0c03905aedd7e036553d723b9b2d20739b0ed2cc Mon Sep 17 00:00:00 2001 From: anima Date: Fri, 7 Feb 2025 18:03:37 +0100 Subject: [PATCH] renmae checkmode systemp to temprature --- checks/check_snmp_synology.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/checks/check_snmp_synology.py b/checks/check_snmp_synology.py index c55bd4c..7112426 100755 --- a/checks/check_snmp_synology.py +++ b/checks/check_snmp_synology.py @@ -8,7 +8,7 @@ - https://easysnmp.readthedocs.io/en/latest/session_api.html """ -__version__ = '0.7.0' +__version__ = '0.7.1' __author__ = 'anima' # imports @@ -130,7 +130,7 @@ class SNMPSynologySystemResult(nagiosplugin.Result): # # Synology [DSM & DSM UC] Temperature of NAS # -class SNMPSynologySysTempResource(nagiosplugin.Resource): +class SNMPSynologyTemperatureResource(nagiosplugin.Resource): def __init__(self, session) -> None: self.session = session @@ -143,7 +143,7 @@ class SNMPSynologySysTempResource(nagiosplugin.Resource): baseoid = '.1.3.6.1.4.1.6574.1' oids = dict() result = self.session.get(baseoid + '.2.0').value - return nagiosplugin.Metric(name='systemp', value=int(result), uom='°C', context='systemp_scalar_context') + return nagiosplugin.Metric(name='temperature', value=int(result), uom='°C', context='temperature_scalar_context') def __init__(self, session) -> None: self.session = session @@ -358,7 +358,7 @@ def parse_args() -> argparse.Namespace: argp.add_argument('-m', '--check_mode', choices=[ 'system', - 'systemp', + 'temperature', 'powersupply', 'fans', 'firmware', @@ -414,11 +414,11 @@ def main(): SNMPSynologySystemContext(name='system_context'), nagiosplugin.Summary()) check.name = "System Status" - case 'systemp': - check = nagiosplugin.Check(SNMPSynologySysTempResource(session=session), - nagiosplugin.ScalarContext(name='systemp_scalar_context', warning=args.warning, critical=args.critical), + case 'temperature': + check = nagiosplugin.Check(SNMPSynologyTemperatureResource(session=session), + nagiosplugin.ScalarContext(name='temperature_scalar_context', warning=args.warning, critical=args.critical), nagiosplugin.Summary()) - check.name = "System Temperatur" + check.name = "System Temperature" case 'powersupply': check = nagiosplugin.Check(SNMPSynologyPowerSupplyResource(session=session), SNMPSynologyPowerSupplyContext(name='powersupply_context'),