Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: support for private key protocol #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dommi22m
Copy link
Contributor

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.

@wernerfred
Copy link
Owner

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
Copy link
Owner

wernerfred commented Feb 16, 2021

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

@wernerfred wernerfred added the waiting for contributor action Waiting for the contributor to respond label Feb 16, 2021
@wernerfred wernerfred self-assigned this Feb 16, 2021
@wernerfred
Copy link
Owner

wernerfred commented Feb 16, 2021

@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.

@amotl
Copy link
Contributor

amotl commented Mar 13, 2022

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
Copy link
Contributor

amotl commented Aug 3, 2022

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.

@gkasKaR
Copy link

gkasKaR commented Aug 3, 2022

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

@amotl
Copy link
Contributor

amotl commented Aug 3, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for contributor action Waiting for the contributor to respond
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants