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

Update libraries #1

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions lib/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from asyncsnmplib.exceptions import SnmpNoConnection, SnmpNoAuthParams
from asyncsnmplib.utils import InvalidConfigException, snmp_queries
from asyncsnmplib.utils import snmp_queries
from libprobe.asset import Asset
from libprobe.exceptions import CheckException, IgnoreResultException


async def get_data(
Expand All @@ -12,13 +10,6 @@ async def get_data(
address = check_config.get('address')
if address is None:
address = asset.name
try:
state = await snmp_queries(address, asset_config, queries)
except SnmpNoConnection:
raise CheckException('unable to connect')
except (InvalidConfigException, SnmpNoAuthParams):
raise IgnoreResultException
except Exception:
raise
else:
return state

state = await snmp_queries(address, asset_config, queries)
return state
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
asyncsnmplib==0.1.10
libprobe==0.2.29
asyncsnmplib==0.1.11
libprobe==0.2.35