Package org.hyperic.sigar

Examples of org.hyperic.sigar.OperatingSystem


    public boolean isNative() {
        return true;
    }

    public OperatingSystemType getOperatingSystemType() {
        OperatingSystem os = OperatingSystem.getInstance();
        if (OperatingSystem.NAME_LINUX.equals(os.getName())) {
            return OperatingSystemType.LINUX;
        }

        if (OperatingSystem.NAME_SOLARIS.equals(os.getName())) {
            return OperatingSystemType.SOLARIS;
        }

        if (OperatingSystem.NAME_WIN32.equals(os.getName())) {
            return OperatingSystemType.WINDOWS;
        }

        if (OperatingSystem.NAME_HPUX.equals(os.getName())) {
            return OperatingSystemType.HPUX;
        }

        if (OperatingSystem.NAME_AIX.equals(os.getName())) {
            return OperatingSystemType.AIX;
        }

        if (OperatingSystem.NAME_MACOSX.equals(os.getName())) {
            return OperatingSystemType.OSX;
        }

        if (OperatingSystem.NAME_FREEBSD.equals(os.getName())) {
            return OperatingSystemType.BSD;
        }

        log.warn("Could not parse operating system name from " + os.getName() + ", returning Java platform");

        return OperatingSystemType.JAVA;
    }
View Full Code Here


        return OperatingSystemType.JAVA;
    }

    public String getOperatingSystemName() {
        OperatingSystem os = OperatingSystem.getInstance();
        // SIGAR returns "Win32" as the OS name for all Windows systems, even 64-bit ones. Work around this by instead
        // returning "Windows" for all Windows systems, which is more consistent with the UNIX operating systems anyway.
        // (https://jira.hyperic.com/browse/SIGAR-238)
        return (OperatingSystem.NAME_WIN32.equals(os.getName()) ? "Windows" : os.getName());
    }
View Full Code Here

        }
        return dirUsage;
    }

    public String getSystemArchitecture() {
        OperatingSystem op = OperatingSystem.getInstance();
        return op.getArch();
    }
View Full Code Here

        os.println("Current user........" +
                   System.getProperty("user.name"));
        os.println("");
       
        OperatingSystem sys = OperatingSystem.getInstance();
        os.println("OS description......" + sys.getDescription());
        os.println("OS name............." + sys.getName());
        os.println("OS arch............." + sys.getArch());
        os.println("OS machine.........." + sys.getMachine());
        os.println("OS version.........." + sys.getVersion());
        os.println("OS patch level......" + sys.getPatchLevel());
        os.println("OS vendor..........." + sys.getVendor());
        os.println("OS vendor version..." + sys.getVendorVersion());
        if (sys.getVendorCodeName() != null) {
            os.println("OS code name........" + sys.getVendorCodeName());
        }
        os.println("OS data model......." + sys.getDataModel());
        os.println("OS cpu endian......." + sys.getCpuEndian());

        os.println("Java vm version....." +
                   System.getProperty("java.vm.version"));
        os.println("Java vm vendor......" +
                System.getProperty("java.vm.vendor"));
View Full Code Here

        }
    }

    private OSInformationObject getOSInformation() {
        OSInformationObject osObj = new OSInformationObject();
        OperatingSystem sys = OperatingSystem.getInstance();
        osObj.setName(sys.getName());
        osObj.setDescription(sys.getDescription());
        osObj.setArchitecture(sys.getArch());
        osObj.setVendor(sys.getVendor());
        osObj.setVenderVersion(sys.getVendorVersion());
        osObj.setDataModel(sys.getDataModel());
        osObj.setOSCPUEndian(sys.getCpuEndian());
        return osObj;
    }
View Full Code Here

        os.println("Current user........" +
                   System.getProperty("user.name"));
        os.println("");
       
        OperatingSystem sys = OperatingSystem.getInstance();
        os.println("OS description......" + sys.getDescription());
        os.println("OS name............." + sys.getName());
        os.println("OS arch............." + sys.getArch());
        os.println("OS machine.........." + sys.getMachine());
        os.println("OS version.........." + sys.getVersion());
        os.println("OS patch level......" + sys.getPatchLevel());
        os.println("OS vendor..........." + sys.getVendor());
        os.println("OS vendor version..." + sys.getVendorVersion());
        if (sys.getVendorCodeName() != null) {
            os.println("OS code name........" + sys.getVendorCodeName());
        }
        os.println("OS data model......." + sys.getDataModel());
        os.println("OS cpu endian......." + sys.getCpuEndian());

        os.println("Java vm version....." +
                   System.getProperty("java.vm.version"));
        os.println("Java vm vendor......" +
                System.getProperty("java.vm.vendor"));
View Full Code Here

        os.println("Current user........" +
                   System.getProperty("user.name"));
        os.println("");
       
        OperatingSystem sys = OperatingSystem.getInstance();
        os.println("OS description......" + sys.getDescription());
        os.println("OS name............." + sys.getName());
        os.println("OS arch............." + sys.getArch());
        os.println("OS machine.........." + sys.getMachine());
        os.println("OS version.........." + sys.getVersion());
        os.println("OS patch level......" + sys.getPatchLevel());
        os.println("OS vendor..........." + sys.getVendor());
        os.println("OS vendor version..." + sys.getVendorVersion());
        if (sys.getVendorCodeName() != null) {
            os.println("OS code name........" + sys.getVendorCodeName());
        }
        os.println("OS data model......." + sys.getDataModel());
        os.println("OS cpu endian......." + sys.getCpuEndian());

        os.println("Java vm version....." +
                   System.getProperty("java.vm.version"));
        os.println("Java vm vendor......" +
                System.getProperty("java.vm.vendor"));
View Full Code Here

        os.println("Current user........" +
                   System.getProperty("user.name"));
        os.println("");
       
        OperatingSystem sys = OperatingSystem.getInstance();
        os.println("OS description......" + sys.getDescription());
        os.println("OS name............." + sys.getName());
        os.println("OS arch............." + sys.getArch());
        os.println("OS machine.........." + sys.getMachine());
        os.println("OS version.........." + sys.getVersion());
        os.println("OS patch level......" + sys.getPatchLevel());
        os.println("OS vendor..........." + sys.getVendor());
        os.println("OS vendor version..." + sys.getVendorVersion());
        if (sys.getVendorCodeName() != null) {
            os.println("OS code name........" + sys.getVendorCodeName());
        }
        os.println("OS data model......." + sys.getDataModel());
        os.println("OS cpu endian......." + sys.getCpuEndian());

        os.println("Java vm version....." +
                   System.getProperty("java.vm.version"));
        os.println("Java vm vendor......" +
                System.getProperty("java.vm.vendor"));
View Full Code Here

TOP

Related Classes of org.hyperic.sigar.OperatingSystem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.