renmae checkmode systemp to temprature
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
- https://easysnmp.readthedocs.io/en/latest/session_api.html
|
- https://easysnmp.readthedocs.io/en/latest/session_api.html
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = '0.7.0'
|
__version__ = '0.7.1'
|
||||||
__author__ = 'anima'
|
__author__ = 'anima'
|
||||||
|
|
||||||
# imports
|
# imports
|
||||||
@@ -130,7 +130,7 @@ class SNMPSynologySystemResult(nagiosplugin.Result):
|
|||||||
#
|
#
|
||||||
# Synology [DSM & DSM UC] Temperature of NAS
|
# Synology [DSM & DSM UC] Temperature of NAS
|
||||||
#
|
#
|
||||||
class SNMPSynologySysTempResource(nagiosplugin.Resource):
|
class SNMPSynologyTemperatureResource(nagiosplugin.Resource):
|
||||||
def __init__(self, session) -> None:
|
def __init__(self, session) -> None:
|
||||||
self.session = session
|
self.session = session
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ class SNMPSynologySysTempResource(nagiosplugin.Resource):
|
|||||||
baseoid = '.1.3.6.1.4.1.6574.1'
|
baseoid = '.1.3.6.1.4.1.6574.1'
|
||||||
oids = dict()
|
oids = dict()
|
||||||
result = self.session.get(baseoid + '.2.0').value
|
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:
|
def __init__(self, session) -> None:
|
||||||
self.session = session
|
self.session = session
|
||||||
@@ -358,7 +358,7 @@ def parse_args() -> argparse.Namespace:
|
|||||||
argp.add_argument('-m', '--check_mode',
|
argp.add_argument('-m', '--check_mode',
|
||||||
choices=[
|
choices=[
|
||||||
'system',
|
'system',
|
||||||
'systemp',
|
'temperature',
|
||||||
'powersupply',
|
'powersupply',
|
||||||
'fans',
|
'fans',
|
||||||
'firmware',
|
'firmware',
|
||||||
@@ -414,11 +414,11 @@ def main():
|
|||||||
SNMPSynologySystemContext(name='system_context'),
|
SNMPSynologySystemContext(name='system_context'),
|
||||||
nagiosplugin.Summary())
|
nagiosplugin.Summary())
|
||||||
check.name = "System Status"
|
check.name = "System Status"
|
||||||
case 'systemp':
|
case 'temperature':
|
||||||
check = nagiosplugin.Check(SNMPSynologySysTempResource(session=session),
|
check = nagiosplugin.Check(SNMPSynologyTemperatureResource(session=session),
|
||||||
nagiosplugin.ScalarContext(name='systemp_scalar_context', warning=args.warning, critical=args.critical),
|
nagiosplugin.ScalarContext(name='temperature_scalar_context', warning=args.warning, critical=args.critical),
|
||||||
nagiosplugin.Summary())
|
nagiosplugin.Summary())
|
||||||
check.name = "System Temperatur"
|
check.name = "System Temperature"
|
||||||
case 'powersupply':
|
case 'powersupply':
|
||||||
check = nagiosplugin.Check(SNMPSynologyPowerSupplyResource(session=session),
|
check = nagiosplugin.Check(SNMPSynologyPowerSupplyResource(session=session),
|
||||||
SNMPSynologyPowerSupplyContext(name='powersupply_context'),
|
SNMPSynologyPowerSupplyContext(name='powersupply_context'),
|
||||||
|
|||||||
Reference in New Issue
Block a user