snmp_diagnostics Core API

snmp_diag_plugin module

A plugin that can process SNMP OIDs into ROS diagnostics.

class snmp_diagnostics.snmp_diag_plugin.SnmpDiagPlugin(engine, config)

Bases: object

A plugin that can process SNMP OIDs into ROS diagnostics.

Parameters:
get_diag_name()

The name that will be shown in the top-level diagnostics item.

Returns:The name.
Return type:str
get_oids()

Get the list of OIDs that should be queried for this plugin.

Returns:The list of OIDs.
Return type:list of pysnmp.smi.rfc1902.ObjectType
parse_response(response_iterator)

Parse the SNMP response iterator into something this plugin understands.

Parameters:response_iterator (iterator) – The SNMP response iterator.
Returns:The processed response data.
Return type:any
process_response(response)

Process the response of SNMP agent and save the result in the plugin for later use by produce_diagnostics().

Parameters:response (any) – The SNMP response processed by parse_response().
produce_diagnostics(diagnostics)

Produce diagnostics from the data stored by process_response().

Parameters:diagnostics (diagnostic_updater.DiagnosticStatusWrapper) – The diagnostics wrapper to update.
register(updater)

Register this plugin with the diagnostic updater.

Parameters:updater (diagnostic_updater.Updater) – The updater instance.