4 |
|
class DecodeCPU_TXT { |
5 |
|
|
6 |
|
XMLFormatter packet; |
7 |
– |
|
8 |
– |
public static final String VERSION = "statgrab.pl $Revision$"; |
7 |
|
|
8 |
|
public DecodeCPU_TXT(){ |
9 |
|
HashMap data; |
25 |
|
} |
26 |
|
catch (Exception e) {} |
27 |
|
|
30 |
– |
String version = (String) data.get("version"); |
31 |
– |
if(!version.equals(VERSION)) { |
32 |
– |
System.out.println("!!!!!! statgrab.pl has changed version, please check code is still up-to-date !!!!!!"); |
33 |
– |
} |
34 |
– |
|
28 |
|
String load1 = (String) data.get("packet.load.load1"); |
29 |
|
String load5 = (String) data.get("packet.load.load5"); |
30 |
|
String load15 = (String) data.get("packet.load.load15"); |
62 |
|
packet.addElement("platform",osplatform); |
63 |
|
packet.addElement("sysname",ossysname); |
64 |
|
packet.addElement("version",osversion); |
65 |
+ |
packet.closeNest(); |
66 |
|
packet.addNest("load"); |
67 |
|
packet.addElement("load1",load1); |
68 |
|
packet.addElement("load5",load5); |
88 |
|
packet.addNest("swap"); |
89 |
|
packet.addElement("inuse",swapInUse); |
90 |
|
packet.addElement("free",swapFree); |
91 |
+ |
packet.closeNest(); |
92 |
|
packet.addNest("users"); |
93 |
|
packet.addElement("count",usercount); |
94 |
< |
packet.addElement("list",userlist); |
94 |
> |
//packet.addElement("list",userlist); |
95 |
|
packet.closeNest(); |
96 |
|
|
97 |
|
in.close(); |