diff --git a/README.md b/README.md index d3862dd..f98c6d8 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,12 @@ check_synology --help ```shell check_synology -usage: check_synology [-h] [-w W] [-c C] [-t T] [-r R] [-p PORT] hostname username authkey privkey {load,memory,disk,storage,update,status} + +usage: check_synology [-h] [-w W] [-c C] [-t T] [-r R] [-p PORT] [-e PROTOCOL] hostname username authkey privkey {load,memory,disk,storage,update,status} ``` A custom port can be specified by using `-p`. The default value is `161`. +A custom privacy protocol can be specified by using `-e`. The default value is `AES128`. Custom timeouts (`-t`) and retries (`-r`) can be specified by using `-t` and `-r` respectively. The default values are `-t 10` and `-r 3`. ### Available modes diff --git a/check_synology.py b/check_synology.py index 3c8c093..6591dc6 100755 --- a/check_synology.py +++ b/check_synology.py @@ -19,6 +19,7 @@ parser.add_argument("-w", help="warning value for selected mode", type=int) parser.add_argument("-c", help="critical value for selected mode", type=int) parser.add_argument("-p", help="the snmp port", type=int, dest="port", default=161) +parser.add_argument("-e", help="SNMP privacy protocol encryption", type=str, default="AES128", choices=["AES128", "DES"]) parser.add_argument("-t", help="timeout for snmp connection", type=int, default=10) parser.add_argument("-r", help="retries for snmp connection if timeout occurs", type=int, default=3) args = parser.parse_args() @@ -31,6 +32,7 @@ mode = args.mode warning = args.w critical = args.c +priv_protocol = args.e snmp_timeout = args.t snmp_retries = args.r @@ -57,7 +59,7 @@ def croak(message=None): auth_password=auth_key, auth_protocol="MD5", privacy_password=priv_key, - privacy_protocol="AES128") + privacy_protocol=priv_protocol) except Exception as e: croak(e)