FileDocCategorySizeDatePackage
SolarisSystemInfoCollector.javaAPI DocGlassfish v2 API5442Fri May 04 22:34:44 BST 2007com.sun.enterprise.diagnostics.collect

SolarisSystemInfoCollector

public class SolarisSystemInfoCollector extends Object implements Collector
Class to collect System Information for Solaris OS

Fields Summary
private static Logger
logger
private static final String
HARD_DISK_INFO_CMD
private static final String
MEMORY_INFO_CMD
private static final String
NETWORK_SETTINGS_CMD
private static final String
TCP_SETTINGS_CMD
private static final String
IP_ADDRESS_INFO_CMD
private static final String
OS_LEVEL_PATCH_INFO_CMD
private static final String
HOST_NAME_CMD
private static final String
DOMAIN_NAME_CMD
private static final String
SOFT_FILE_DESC_LIMIT_CMD
private static final String
HARD_FILE_DESC_LIMIT_CMD
private static final String
PROCESSOR_INFO_CMD
private static final String
SWAP_INFO_CMD
private String
destFolder
Constructors Summary
public SolarisSystemInfoCollector(String destFolder)

    

      
        this.destFolder = destFolder;
    
Methods Summary
public com.sun.enterprise.diagnostics.Datacapture()
To capture the system information for solaris OS

return
Data representing System Information
return
Data representing System Information


        FileData data = null;

        String outputFileName = destFolder + File.separator + Defaults.SYSTEM_INFO_FILE;

        final String ALL_CMDS =
                "( " +
                " echo 'HOST NAME' ; "+ HOST_NAME_CMD +
                " ; echo 'DOMAIN NAME' ; "+DOMAIN_NAME_CMD +
                " ; echo 'HARD DISK INFO ' ; "+HARD_DISK_INFO_CMD +
                " ; echo 'NETWORK CONFIGURATION ' ; "+NETWORK_SETTINGS_CMD +
                " ; echo 'IP ADDRESS ' ; "+ IP_ADDRESS_INFO_CMD +
                " ; echo 'OS LEVEL PATCH INFO' ; "+OS_LEVEL_PATCH_INFO_CMD +
                " ; echo 'SOFT FILE DESCRIPTOR LIMIT ' ; "+SOFT_FILE_DESC_LIMIT_CMD +
                " ; echo 'HARD FILE DESCRIPTOR LIMIT ' ; "+HARD_FILE_DESC_LIMIT_CMD +
                " ; echo 'PROCESSOR INFO' ; "+PROCESSOR_INFO_CMD +
                " ; echo 'SWAP SPACE' ; "+SWAP_INFO_CMD +
                " ; echo 'MEMORY INFO ' ; " + MEMORY_INFO_CMD +
                "  ) >> "+ outputFileName ;

        String[] cmd = {"sh", "-c", ALL_CMDS};

        ProcessExecutor executor = new ProcessExecutor(cmd, 0);
        try{
        executor.execute();

        File outputFile = new File(outputFileName);

         data = new FileData(outputFile.getName(),DataType.SYSTEM_INFO);
        }
        catch(ProcessExecutorException pee){
            logger.log(Level.WARNING, "Exception while capturing system info" +
                     " : " + pee.getMessage());
        }
        return data;