Sending errors instead of data

Sometimes the application that posts socket data may not be able to collect the data necessary for an attribute group. In this case, instead of sending data to the agent, an error code can be returned. The error code gives you a way to tell the IBM® Tivoli® Monitoring environment about your problem. An example error is:

<socketData><attrGroup name="abc"/><error rc="1000"/></attrGroup></socketData>\n 

The error code must be defined in the agent in "a list" that is common to all of the socket attribute groups. When the agent receives an error code, the defined error message is logged in the agent log file. In addition, the attribute group named Performance Object Status has an Error Code attribute that is updated with the Error Code Type that is defined for the error code you send.

For the example above, you must have defined the Error Code Value of 1000 in the agent. See the following sample error code definition:

Table 25. Sample error code
Error Code Value Error Code Type Message
1000 APP_NOT_RUNNING The application is not running

When the error code is sent, a message similar to the following is logged in the agent log file:

(4D7FA153.0000-5:customproviderserver.cpp,1799,"processRC") Received error code 1000 from client. \
Message: K1C0001E The application is not running

If you select the Performance Object Status query from the Tivoli Enterprise Portal, you will see the value APP_NOT_RUNNING in the Error Code column of the row for the abc attribute group in that table.

Sending an error to a sampled attribute group clears any data that was previously received for that attribute group. Sending data to the attribute group causes the error code to no longer be displayed in the Performance Object Status attribute group. You can also send an error code of 0 to clear the error code from that table.

Sending an error to an attribute group that produces events does not clear the cache of events that have previously been sent.