pmonframe logo
  Abstract   First Steps   XML Network Interface   Java Doc   Real World Example   FAQ   Download   Contact  

First Steps

First, download the pmonframe-0.91.jar and place it into any directory. Then open two terminal windows and, in each of them, set the Java CLASSPATH as follows:
For Windows: SET CLASSPATH=pmonframe-0.91.jar
For Unix: export CLASSPATH=pmonframe-0.91.jar
Next, start a pmonframe dummy server which communicates using the HTTP protocol. Note: this dummy server program does not measure real data, but instead, provides dummy data to simulate the CPU usage and number of DISK I/Os of a running, non-existent computer system.
To start a pmonframe dummy server, enter the following command inside the first terminal window:
java org.pmonframe.example.HttpExampleServer
The dummy server will then show the following output:
22 Jan 2010 14:51:29.328 Thread-0      HTTP server started on port 39002, log level = standard
Next, start a pmonframe client program which allows the testing of the functionality of any server.
To start the pmonframe client program, enter the following command inside the second terminal window:
java org.pmonframe.example.HttpExampleClient
The client program will show the following output:
 1 = getServerInfo
 2 = getOperable
 3 = getOsTimestamp
 4 = getDataCollectionDirectory
 5 = getDataCollectionEntry
 6 = getValues
 7 = getLatestValue
 8 = getLatestValuesSinceSeconds
 9 = getLatestValuesSinceTimestamp (Monitor for 60 Seconds)
99 = getPmonframedirectory (Directory Server)
 0 = - exit -
We recommend that you experiment a little with the client program; for example, enter 8, then CPU, and then 10:
Currently supported Collection Identifier on are: CPU,DISKIO
Enter Collection Identifier: CPU
Enter Number of Seconds: 10

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<measurementCollection identifier="CPU" dataType="percent">
<value timestamp="1264168861250">85.38453</value>
<value timestamp="1264168863250">79.45086</value>
<value timestamp="1264168865250">19.755127</value>

identifier = CPU
dataType = percent
22 Jan 2010 15:01:01.250  85.38453%
22 Jan 2010 15:01:03.250  79.45086%
22 Jan 2010 15:01:05.250  19.755127%
Instead of using a Java program as the client, you can also communicate directly over HTTP with the pmonframe server. For example, if you have installed curl on your computer, you can enter:
curl --compressed -d "<?xml version=\"1.0\"?><clientRequest><command identifier=\"CPU\">getValues</command></clientRequest>" -H "Content-Type: text/xml"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<measurementCollection identifier="CPU" dataType="percent">
<value timestamp="1264170056734">49.035393</value>
<value timestamp="1264170058734">88.203636</value>
<value timestamp="1264170060734">95.91281</value>
<value timestamp="1264170062734">11.273148</value>
You can also try communicating over raw TCP/IP connections with a pmonframe server. For this you must first start the pmonframe TCP example server by entering the following command into the first terminal window:
java org.pmonframe.example.TcpExampleServer
Now you can communicate with the TCP server by using telnet:
telnet 39001
Paste the following input into telnet (you will probably not see the pasted input in telnet):
<?xml version="1.0"?><clientRequest><command>getDataCollectionDirectory</command></clientRequest>
Next, hit the return key twice in telnet to notify the pmonframe server that the request data are fully transmitted.
You will see the following response from the server:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<title>DISK I/O</title>
<subtitle>Local I/O without SAN</subtitle>
<yAxisLabel>I/O per Second</yAxisLabel>
Note: you have only 60 seconds to paste the input and hit the return key twice because of the 60 second receive timeout on the pmonframe server.
As a next step, we recommend that you try out the real world example. You should also take a look at the example programs in the package org.pmonframe.example by unzipping the source code. If you plan to develop your own pmonframe client and server(s), we recommend that you use the HTTP protocol.

© 2010     Licensed under the Apache License, Version 2.0
Unless required by applicable law or agreed to in writing, this web page is published on an "as is" basis, without warranties or conditions of any kind, either express or implied.