renmae checkmode systemp to temprature
This commit is contained in:
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user