check_synology icon indicating copy to clipboard operation
check_synology copied to clipboard

FIX: support for private key protocol

Open dommi22m opened this issue 4 years ago • 7 comments

For now there is no support to choose the protocol for private key. (3DES/AES) Neither for the auth key (MD5/SHA)

So you will get an TypeError if not AES is selected in Synology SNMP Setup :

float() argument must be a string or a number, not 'NoneType'

I made a little change to get the private key protocol as parameter. Not well programmed but yet an acceptable change.

dommi22m avatar Dec 22 '20 08:12 dommi22m

Just tested your changes. With AES it's working. With 3DES not:

No SNMP response received before timeout
Traceback (most recent call last):
  File "check_synology.py", line 77, in <module>
    load1 = str(float(snmpget('1.3.6.1.4.1.2021.10.1.5.1'))/100)
TypeError: float() argument must be a string or a number, not 'NoneType'

But my Sonology lets me only configure AES or DES (missing 3). What model are you using?

wernerfred avatar Feb 16 '21 14:02 wernerfred

I added DES support. Please @dommi22m provide information regarding 3DES and check again.

wernerfred avatar Feb 16 '21 14:02 wernerfred

@dommi22m for backwards compatibility i changed the argument to be optional (provided via -k) and defaulted it to the current method AES. Authentication method could then be implemented accordingly via -a.

wernerfred avatar Feb 16 '21 15:02 wernerfred

Hi there,

after the refactoring coming from #19, the feature to select a different SNMP privacy protocol would have to be implemented slightly different. Please let us know if you still have demand for this, @dommi22m.

With kind regards, Andreas.

amotl avatar Mar 13 '22 14:03 amotl

Hi again,

check_synology moved on to use the Easy SNMP library under the hood. So, this patch would need to be adjusted appropriately. Maybe someone from the community can submit a corresponding update?

With kind regards, Andreas.

amotl avatar Aug 03 '22 01:08 amotl

Hey there,

i just used the newest version to perform a check.

The error code is now another one: UNKNOWN - Authentication failure (incorrect password, community or key)

With nwc_health, I use the authprotocol sha. So I think the issue occours because of the different protocol requirements.

Thank you for the explanaiton and investigation :)

Greetings

gkasKaR avatar Aug 03 '22 07:08 gkasKaR

Hi @gkasKaR,

The error code is now another one: UNKNOWN - Authentication failure (incorrect password, community or key)

Thanks a stack for checking. This is a sweet error response.

So I think the issue occours because of the different protocol requirements.

Great that we have been able to find the reason for #16. So, @dommi22m's patch is needed for your situation as well. May I ask which Synology DiskStation model you are using?

With nwc_health, I use the authprotocol "SHA".

All right. Now, someone would need to adjust this patch to the new SNMP library to improve the situation here.

With kind regards, Andreas.

amotl avatar Aug 03 '22 22:08 amotl