ModSnmp Manual v3.15 - 12. Tracing
ModSnmp can trace the SNMP and Modbus messages that are received and sent. The trace output is logged at Trace level.
To enable Modbus tracing, click the Modbus Trace button in the main window.
If Modbus tracing is enabled, each Modbus message sent or received is logged as two lines. The first line begins with the character 'D' to indicate a Modbus message to/from a device. This is followed by the character '<' for an incoming message or the character '>' for an outgoing message, and then the Modbus interface name. For a correctly formatted message, the rest of the line consists of 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 rest of the line is 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 'D'. After the 'D' 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.
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, and then the IP address and port of the SNMP manager. The rest of the line consists of a word indicating the type of the 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.