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

Handle pysnmp's RequestTimedOut exception more appropriately #17

Merged
merged 1 commit into from Mar 11, 2022

Conversation

amotl
Copy link
Contributor

@amotl amotl commented Mar 9, 2022

Dear Frederic,

thanks a stack for conceiving this fine program. We found that the code path when running into a No SNMP response received before timeout condition can be improved.

While we don't quite like how the patch is currently implemented, the code now handles this condition well. In this case, check_synology will respond with state "UNKNOWN".

With kind regards,
Andreas.

P.S.: For your reference, I am sharing two of the tracebacks we received below.

Traceback (most recent call last):
  File "/opt/check_synology/check_synology.py", line 100, in if disk.startswith("No Such Instance"):
AttributeError: 'NoneType' object has no attribute 'startswith'
Traceback (most recent call last):
  File "/opt/check_synology/check_synology.py", line 67, in 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'

/cc @Tonkenfo

In this case, `check_synology` will respond with state "UNKNOWN".
Copy link
Owner

@wernerfred wernerfred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wernerfred wernerfred merged commit f2c1521 into wernerfred:master Mar 11, 2022
@wernerfred
Copy link
Owner

@all-contributors add @amotl for code

@allcontributors
Copy link
Contributor

@wernerfred

I've put up a pull request to add @amotl! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants