*/
public static SimpleOrderedMap<Object> getSystemInfo() throws Exception
{
SimpleOrderedMap<Object> info = new SimpleOrderedMap<Object>();
OperatingSystemMXBean os = ManagementFactory.getOperatingSystemMXBean();
info.add( "name", os.getName() );
info.add( "version", os.getVersion() );
info.add( "arch", os.getArch() );
// Java 1.6
addGetterIfAvaliable( os, "systemLoadAverage", info );
// com.sun.management.UnixOperatingSystemMXBean
addGetterIfAvaliable( os, "openFileDescriptorCount", info );
addGetterIfAvaliable( os, "maxFileDescriptorCount", info );
// com.sun.management.OperatingSystemMXBean
addGetterIfAvaliable( os, "committedVirtualMemorySize", info );
addGetterIfAvaliable( os, "totalPhysicalMemorySize", info );
addGetterIfAvaliable( os, "totalSwapSpaceSize", info );
addGetterIfAvaliable( os, "processCpuTime", info );
try {
if( !os.getName().toLowerCase(Locale.ENGLISH).startsWith( "windows" ) ) {
// Try some command line things
info.add( "uname", execute( "uname -a" ) );
info.add( "ulimit", execute( "ulimit -n" ) );
info.add( "uptime", execute( "uptime" ) );
}