<machine_type> machine_name </machine_type>Here, machine_type could be vrc, etg_sb, node, or super .
machine_name is meant to be a specific instance of the object.
For example, for the first floor VRC this might be d0l3vrc1a or similar.
The monitor server will send the client a query demanding information. The format is:
<machine_type>
<item1></item1><item2></item2>...</machine_type>Here item is something like "event_counter".
The client should first check that it is of the correct machine_type to be handling the request. If so, it should "fill in" the XML with its knowledge:<machine_type>
<item1> value1 </item1><item2> value2 </item2>...</machine_type>A very easy way to do this is to iterate through all the child nodes, look at the name of each one, and if information is known about it, fill it in with:
pNode->text = value;Then at the end, simply return the filled in XML with:
return pDoc->xml;
A display can come in and ask questions to the monitor. It does this with the XML structure:
<monitor_query>
<vrc>
<all_names>
<Info1></Info1>
<Info3></Info3>
</all_names>
</vrc>
<etg_sb>
<all_names>
<Info2></Info2>
<Info5></Info5>
<Info6></Info6>
</all_names>
</etg_sb>
</monitor_query>
This will query all clients of these two types and ask them each about the defined info. By changing all_names to a specific selection, you can query a single computer. "Info" is the type of information asked of a client, and can vary from type to type.
Optionally, a timeout can be specified for each data element. This will require the monitor server to return data that is fewer younger than the specified number of seconds. The timeout is given as the "timeout" attribute of a data element, such as:
...
<Info timeout="5"></Info>
...
This will require the "Info" data to be less than 5 seconds old. Note, these timeouts will override any other default timeouts.
The monitor server's response to an XML query such as the one above is identical, except filled in... much the same way that a client's response to a server query is identical but filled in. Also, it starts with "monitor_response" instead. Thus it would look like:
<monitor_response>
<vrc>
<d0l3vrc1a>
<Info1>45</Info1>
<Info3>34</Info3>
</d0l3vrc1a>
<d0l3vrc2a>
<Info1>46</Info1>
<Info3>43</Info3>
</d0l3vrc2a>
<d0l3vrc3a>
<Info1>47</Info1>
<Info3>1992</Info3>
</d0l3vrc3a>
</vrc>
<etg_sb>
<d0l3etg>
<Info2>17</Info2>
<Info5>387343</Info5>
<Info6>stopped</Info6>
</d0l3etg>
</etg_sb>
</monitor_response>
Each data element will expire after a set number of seconds. The default is 1 second when the monitor server is started. This default timeout can be changed with a call to the monitor server of the format:
<monitor_command>
<set_default_timeout>5</set_default_timeout>
</monitor_command>
Note: This timeout is always overridden by any specific timeout that is given in a query call for a data element (see above).