Error codes

A typical response to an exception or other resource error is to send an error code to the agent by calling the AgentConnection.sendError method. An error for an event-based attribute group can be sent at any time. An error for a sampled attribute group can be sent only in response to a collect data request, and in place of a sendData call.

If you send an error to the agent, the following happens:

  1. An error message is logged in the agent trace log. This error message includes the error code and the message defined for that error code.
  2. There is a Performance Object Status query that can be viewed to obtain status information about your attribute groups. The Error Code column is set to the Error Code type defined for the error you sent. The error status clears after data is successfully received by the agent for the attribute group. Note that if you reply to a collect data request with a sendData call but you have included no data rows, you will see NO_INSTANCES_RETURNED in the Error Code column.

The following table describes some error codes that are internal to the agent that you can expect to see in certain situations:

Table 32. Internal error codes for the agent
Error Code Description
NO_ERROR There are no problems with the attribute group at this time.
NO_INSTANCES_RETURNED The client responded to a data collection request but provided no data. This is not an error. It generally indicates there are no instances of the resource being monitored by the attribute group.
OBJECT_NOT_FOUND The agent tried to collect data for an attribute group that has not been registered by a client. This may mean the client failed to start or the client had not initiated the attribute group registration when the agent tried to collect data.
OBJECT_CURRENTLY_UNAVAILABLE The client sent the agent an error code that was not defined in the global list of error codes.
GENERAL_ERROR A problem occurred collecting data from the client, usually because the client did not reply to the request within the timeout interval. See the agent trace log for more details.

The client can also specify GENERAL_ERROR as an error code, but it is better if a more detailed error code is defined.