24 |
|
// first line has the format: load averages: 0.30, 0.27, 0.29 16:58:10 |
25 |
|
// tokenize it using spaces as delimiters? |
26 |
|
line = in.readLine(); |
27 |
+ |
// it seems some versions of top prefix this line with something else... lets remove it :) |
28 |
+ |
line = line.substring(line.indexOf("load averages:")); |
29 |
|
System.out.println("line1: "+line); |
30 |
|
StringTokenizer tok = new StringTokenizer(line,":",false); |
31 |
|
tok.nextToken(); // load averages |
99 |
|
// done now make it into an xml packet ;) |
100 |
|
|
101 |
|
packet = new XMLFormatter(); |
102 |
+ |
packet.addElement("sTime",sTime); |
103 |
|
packet.addNest("load"); |
104 |
|
packet.addElement("load1",load1); |
105 |
|
packet.addElement("load5",load5); |