Features

This section describes all features that are shipped with this package. Specially take a look at the PySNMP setup features <PySNMP setup Features>, which are ready-to-use setup features, that can directly be used in your setup.

Scenario Features

SnmpManagerDevice

class balderhub.snmpagent.lib.features.HasSnmpSystemGroupFeature(**kwargs)

Bases: Feature

This feature is an autonomous feature that describes that its owner has the snmp group system.

class balderhub.snmpagent.lib.features.SnmpSystemConfig(**kwargs)

Bases: Feature

This feature provides the general snmp configuration for a snmp agent device

property host: str
Returns:

the host domain or ip address of the snmp agent

property read_community: str
Returns:

the community for read access to this snmp agent

property snmp_port: int
Returns:

the snmp port of the snmp agent

property sys_descr: str
Returns:

the expected sysDescr for this snmp agent

property sys_object_id: str
Returns:

the expected sysObjectId for this snmp agent

property write_community: str
Returns:

the community for write access to this snmp agent

SnmpAgentDevices

class balderhub.snmpagent.lib.features.SendSnmpGetRequestCommandFeature(**kwargs)

Bases: Feature

This feature allows to send a snmp GET-REQUEST.

class SnmpAgent

Bases: VDevice

remote agent this feature communicates with

send(oid: str) SnmpPackage

This method sends a new SNMP-GET REQUEST message

Parameters:

oid – the oid that should be requested

Returns:

the snmp package response

class balderhub.snmpagent.lib.features.SendSnmpSetRequestCommandFeature(**kwargs)

Bases: Feature

This feature allows to send a snmp SET-REQUEST.

class SnmpAgent

Bases: VDevice

remote agent this feature communicates with

send(oid: str, value: str | int | None)

This method allows to send a message to the remote snmp agent.

Parameters:
  • oid

  • value

PySNMP setup Features

SnmpAgentDevices

This section holds features that can directly be used in your setup.

class balderhub.snmpagent.lib.setup_features.SendSnmpGetRequestPysnmpFeature(**kwargs)

Bases: SendSnmpGetRequestCommandFeature

This feature provides a basic implementation of the SendSnmpGetRequestCommandFeature with the pysnmp package.

Note

Please note, this feature implementation uses the SNMP version v2c!

send(oid: str) SnmpPackage

This method sends a new SNMP-GET REQUEST message

Parameters:

oid – the oid that should be requested

Returns:

the snmp package response

class balderhub.snmpagent.lib.setup_features.SendSnmpSetRequestPysnmpFeature(**kwargs)

Bases: SendSnmpSetRequestCommandFeature

This feature provides a basic implementation of the SendSnmpSetRequestCommandFeature with the pysnmp package.

Note

Please note, this feature implementation uses the SNMP version v2c!

send(oid: str, value: str | int | None)

This method allows to send a message to the remote snmp agent.

Parameters:
  • oid

  • value