ModSnmp Manual - Tracing
ModSnmp can trace the SNMP and Modbus messages that are received and sent. The trace output is logged at Debug level.
To enable Modbus tracing, click the Modbus Trace button in the main window, or select the → checkbox.
If Modbus tracing is enabled, each Modbus message sent or received is logged as two lines. The first line begins with the character 'M' to indicate a Modbus message. This is followed by the character '<' for an incoming message or the character '>' for an outgoing message. For a correctly formatted message, the '<' or '>' is followed by the transaction identifier (only for TCP packets), slave identifier, PDU length (in bytes), function code, and then the first few bytes of the body of the message (in hex). If incorrectly formatted data is received, the '<' is followed by the received data in hex.
The second line of a message trace provides an interpretation of the main fields in the message. This line also begins with the character 'M'. After the 'M' is the word "Request" for a request message, "Response" for a normal response message, "Error response" for an error response message, or "Discarded" for incorrectly formatted incoming data. "Request" or "Response" is followed by the function code (expressed in words) and the main fields of the message (address, count, etc.). "Error response" is followed by the error code (expressed in words), and possibly by further explanation of the error. "Discarded" is followed by the number of bytes discarded, and an explanation of why the data was discarded.
To enable SNMP tracing, click the SNMP Trace button in the main window, or select the → checkbox.
If SNMP tracing is enabled, each SNMP message sent or received is logged as a single line starting with the character 'S'. This is followed by the character '<' for an incoming request or the character '>' for an outgoing response. The '<' or '>' is followed by a word indicating the type of request or response, and the first variable OID in the message. For a SET request and for normal responses, the first variable value is also traced.