puresnmp_call
puresnmp is a library to interact with devices
using SNMP, this plugin is a wrapper around puresnmp
pythonic client object.
puresnmp_call sample usage
Sample code to run puresnmp_call
task:
from nornir import InitNornir
from nornir_salt.plugins.tasks import puresnmp_call
nr = InitNornir(config_file="config.yaml")
output = nr.run(
task=puresnmp_call,
call="get",
oid="1.3.6.1.2.1.1.2.0"
)
puresnmp_call returns
Returns puresnmp SNMP client call result.
puresnmp_call reference
- nornir_salt.plugins.tasks.puresnmp_call.puresnmp_call(task: nornir.core.task.Task, call: str, *args, **kwargs) nornir.core.task.Result
Task to handle a call of puresnmp client object methods. This task attempts to normalize results produced by puresnmp library to a dictionary keyed by oid names with their values.
- Parameters
call – (str) puresnmp client object method to call
args – (list) any
*args
to use with call methodkwargs – (dict) any
**kwargs
to use with call method
additional methods reference
puresnmp_call - dir
- nornir_salt.plugins.tasks.puresnmp_call._call_dir(client, *args, **kwargs)
Function to return a list of available methods
puresnmp_call - help
- nornir_salt.plugins.tasks.puresnmp_call._call_help(client, method_name, *args, **kwargs)
Helper function to return docstring for requested method
- Parameters
method_name – (str) name of method or function to return docstring for