The socket client encodes data that is sent to the agent.
It is important to be aware of how your socket client
is encoding data that is being sent to the agent.
Special characters
Data
sent to the agent must not contain any newline characters except at
the end of each event or data sample. Newline characters that occur
inside of attribute values must be replaced with a different character
or encoded as shown in (
Table 1).
You must also be careful not to break the XML syntax with your attribute
values. The following table shows the characters that occur in the
attribute values that you encode:
Table 1. Characters
to encode in attribute values
| Character |
Header |
& |
& |
< |
< |
> |
> |
“ |
" |
' |
' |
\n |
|
Note: The agent uses the newline character to separate responses
received from a client. Unexpected newline characters prevent data
from being parsed correctly.
The agent does not contain a full-featured
XML parser so you must not use special encoding for characters not
in (
Table 1). For
example, do not encode
¢ or
¢ in
place of a cent sign
¢.
Character sets
In addition to encoding special characters, the agent must
know what code page was used to encode your data. Define each socket
attribute group to indicate whether you are sending the data to the
agent as UTF-8 data or as Local code page. Be aware of how your
client is sending data. If you use a client that is written in Java™, specify UTF-8 as
the encoding on the writer you use to send data to the agent. Specify UTF-8 as the Code
Page for your attribute group. Local
code page means the local code page of the agent. If the
data is sent over a remote socket, it must conform to the local code
page of the agent or use UTF-8.
Numeric Data
Be
aware of how you are formatting your numeric attribute values. The
numeric values that you send to the agent must not contain any special
characters. One example is the thousands separator character. Other
examples are currency symbols or characters that describe the units
of the value. If the agent encounters a problem when it is parsing
numeric data, it logs an error that indicates the issue. The Performance
Object Status Error Code is not set when an attribute fails to parse.
The following is an example error message from the agent log:
(4D3F1FD6.0021-9:utilities.cpp,205,"parseNumericString") Invalid characters :00:04 \
found getting numeric value from 00:00:04, returning 0.000000
Note: For
information about how a time stamp attribute must be formatted, see
(
Time stamp).