From 3d5e199f5b6baff976c6a113c1465a2b9e784c91 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Fri, 13 May 2005 18:07:27 +0000 Subject: [PATCH] use shell commands --- .../src/net/hyperic/sigar/cmd/SysInfo.java | 56 +++---------------- 1 file changed, 8 insertions(+), 48 deletions(-) diff --git a/bindings/java/src/net/hyperic/sigar/cmd/SysInfo.java b/bindings/java/src/net/hyperic/sigar/cmd/SysInfo.java index 6309c18b..07cab548 100644 --- a/bindings/java/src/net/hyperic/sigar/cmd/SysInfo.java +++ b/bindings/java/src/net/hyperic/sigar/cmd/SysInfo.java @@ -1,7 +1,5 @@ package net.hyperic.sigar.cmd; -import net.hyperic.sigar.CpuInfo; -import net.hyperic.sigar.OperatingSystem; import net.hyperic.sigar.SigarException; /** @@ -21,60 +19,22 @@ public class SysInfo extends SigarCommandBase { return "Display system information"; } - private String getJavaProp(String name) { - return System.getProperty("java." + name); - } - public void output(String[] args) throws SigarException { - /** - * OS info - */ - OperatingSystem os = OperatingSystem.getInstance(); - - println(os.getName() + " " + - os.getVersion() + " " + - os.getArch()); - - if (os.getName().equals("Linux")) { - println(os.getVendor() + " " + os.getVendorVersion()); - } - - /** - * JVM info - */ - println(getJavaProp("vm.name") + " - " + - getJavaProp("vm.vendor") + " [" + - getJavaProp("vm.version") + "]"); - - println(getJavaProp("specification.vendor") + " " + - getJavaProp("specification.name") + " " + - getJavaProp("specification.version")); - println("JAVA_HOME=" + getJavaProp("home")); + //sigar/os info + Version.printInfo(this.out); println(""); - /** - * uptime - */ + //uptime new Uptime(this.shell).output(args); println(""); - /** - * CPU info - */ - CpuInfo[] infos = this.sigar.getCpuInfoList(); - for (int i=0; i