puresnmp.exc module
Exceptions for the puresnmp package.
Most exceptions in this module are based on RFC 3416
- exception puresnmp.exc.AuthorizationError(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
- exception puresnmp.exc.BadValue(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
This error is returned whenever a variable is set using an incompatible type.
- exception puresnmp.exc.CommitFailed(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
- exception puresnmp.exc.EmptyMessage
Bases:
SnmpError
Raised when trying to decode an SNMP-Message with no content.
- exception puresnmp.exc.ErrorResponse(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
SnmpError
A superclass used when the SNMP agent responded with additional error information.
- DEFAULT_MESSAGE: str = 'unknown error'
Default message to report for this error (if not overridden)
- static construct(error_status: int, offending_oid: ObjectIdentifier, message: str = '') ErrorResponse
Creates a new instance of an ErrorResponse class, using the proper subclass for the given error_status value. The message is optional, and if not specified, will use the default message for the given class.
- offending_oid: ObjectIdentifier
the OID identified in the error message which caused the error.
- exception puresnmp.exc.FaultySNMPImplementation
Bases:
SnmpError
Exception which indicates an unexpected response from an SNMP agent.
- exception puresnmp.exc.GenErr(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
This error is returned for any error which is not covered in the previous error classes.
- exception puresnmp.exc.InconsistentName(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
- exception puresnmp.exc.InconsistentValue(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
- exception puresnmp.exc.InvalidResponseId
Bases:
SnmpError
Exception which is raised when a response is received that did not correspond to the request-id
- exception puresnmp.exc.MissingPlugin(ns: str, needle: Any, haystack: List[Any])
Bases:
SnmpError
Raised when a pluggable module could not be found
- Parameters:
ns – The plugin namespace
needle – The identifier that was looked up
haystack – The known identifiers
- exception puresnmp.exc.NoAccess(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
This error is returned whenever .
- exception puresnmp.exc.NoCreation(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
- exception puresnmp.exc.NoSuchOID(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
This error is returned in any of the following cases:
the targeted OID does not support “snmp-set” operations
the targeted OID does not exist.
the targeted OID is an SMI aggregate type.
the targeted OID does not precede a known name in the MIB view.
- exception puresnmp.exc.NotInTimeWindow(oid: str, value: int, reporting: str)
Bases:
SnmpError
This exception is raised when a message is outside the time window
See also
- RFC-3414 - Section 3.2 - Processing an Incoming SNMP Message
Reference description on how to handle incoming messages.
- exception puresnmp.exc.NotWritable(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
- exception puresnmp.exc.ReadOnly(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
This error is returned whenever a variable is set which is not writable.
Bases:
ErrorResponse
The “error-status” value
- exception puresnmp.exc.SnmpError
Bases:
Exception
Generic exception originating from the puresnmp package. Every SNMP related error inherits from this class.
- exception puresnmp.exc.Timeout(message: str)
Bases:
SnmpError
Wrapper for network timeouts.
This wraps both “socket.timeout” and “asyncio.TimeoutError”
- exception puresnmp.exc.TooBig(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
This error is returned whenever the size of the generatred response exceeds a size-limit defined by the queried device.
- exception puresnmp.exc.TooManyVarbinds(num_oids: int)
Bases:
SnmpError
Exception which is raised when the number of VarBinds exceeds the limit defined in RFC 3416.
- exception puresnmp.exc.UndoFailed(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
- exception puresnmp.exc.UnknownAuthModel(ns: str, needle: Any, haystack: List[Any])
Bases:
MissingPlugin
Exception which is raised when working with an unsupported/unknown authentication
- exception puresnmp.exc.UnknownMessageProcessingModel(ns: str, needle: Any, haystack: List[Any])
Bases:
MissingPlugin
Raised if a message was not formatted according to any known model
- exception puresnmp.exc.UnknownPrivacyModel(ns: str, needle: Any, haystack: List[Any])
Bases:
MissingPlugin
Exception which is raised when the security model in use is unknown.
- exception puresnmp.exc.UnknownSecurityModel(ns: str, needle: Any, haystack: List[Any])
Bases:
MissingPlugin
This exception is raised when something goes wrong with a security model
- exception puresnmp.exc.WrongEncoding(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
- exception puresnmp.exc.WrongLength(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
- exception puresnmp.exc.WrongType(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse
- exception puresnmp.exc.WrongValue(offending_oid: ObjectIdentifier, message: str = '', error_status: int = 0)
Bases:
ErrorResponse