Examples of fetchOutput()


Examples of com.sun.faban.common.CommandHandle.fetchOutput()

            try {
            // get ruby related config info
      CommandHandle ch = RunContext.exec(myServers[i], rcmd);
            outFile = RunContext.getOutDir() + "ruby_config.log." +
                RunContext.getHostName(myServers[i]);
      ch.fetchOutput(Command.STDOUT, outFile);
            } catch (Exception e) {
                logger.warning("Could not execute/fetch ruby config on " + myServers[i]);
            }
            logger.fine("getLogs Completed for " + myServers[i]);
        }
View Full Code Here

Examples of com.sun.faban.common.CommandHandle.fetchOutput()

    }

    private boolean checkListnerStarted(String hostName) throws Exception {
        boolean started = false;
        CommandHandle ch = RunContext.exec(hostName, new Command(oracleBin + "lsnrctl status"));
        if (ch.fetchOutput(0) != null){
            started = true;
        }
        return started;
    }
View Full Code Here

Examples of com.sun.faban.common.CommandHandle.fetchOutput()

                if (p.exitValue() != 0) {
                    StringBuilder b = new StringBuilder();
                    b.append("Error generating faban driver deployment " +
                             "descriptor for " + dir + ".\n");

                    byte[] output = p.fetchOutput(Command.STDOUT);
                    String o = null;
                    if (output != null)
                        o = new String(output, 0, output.length).trim();

                    if (o != null && o.length() > 0)
View Full Code Here

Examples of com.sun.faban.common.CommandHandle.fetchOutput()

                        o = new String(output, 0, output.length).trim();

                    if (o != null && o.length() > 0)
                        b.append("stdout:\n").append(o);

                    output = p.fetchOutput(Command.STDERR);
                    if (output != null) {
                        o = new String(output, 0, output.length).trim();
                        if (o.length() > 0)
                            b.append("\nstderr:\n").append(o);
                    }
View Full Code Here

Examples of com.sun.faban.common.CommandHandle.fetchOutput()

                // Run the command in the foreground
                CommandHandle ch = RunContext.exec(myServers[i], stopCmd);
               
                // Check if the server was even running before stop was issued
                // If not running, apachectl will print that on stdout
                byte[] output = ch.fetchOutput(Command.STDOUT);

                if (output != null)
                    if ((output.toString()).indexOf("not running") != -1) {
                       continue;
                    }
View Full Code Here

Examples of com.sun.faban.common.CommandHandle.fetchOutput()

                    PrintStream syslog =
                                    new PrintStream(new FileOutputStream(f));
                    Command sysinfo = new Command("sysinfo");
                    sysinfo.setStreamHandling(Command.STDOUT, Command.CAPTURE);
                    CommandHandle handle = cmds.execute(host, sysinfo, null);
                    byte[] info = handle.fetchOutput(Command.STDOUT);

                    // Write header and info to file.
                    syslog.println("<html><head><title>System Info for Server "
                            + machineName + "</title></head><body>");
View Full Code Here

Examples of com.sun.faban.common.CommandHandle.fetchOutput()

                        for (String cmdString : cmdStrings) {
                            Command c = new Command(cmdString);
                            c.setStreamHandling(Command.STDOUT,Command.CAPTURE);
                            logger.info("Executing '" + cmdString + "'");
                            handle = cmds.execute(host, c, null);
                            info = handle.fetchOutput(Command.STDOUT);
                            if (info != null) {
                                syslog.println(linesep);
                                syslog.println("<h3>" + hostConfig.userCommands+
                                        " on server " + machineName + "</h3>");
                                syslog.println("<pre>\n");
View Full Code Here

Examples of com.sun.faban.common.CommandHandle.fetchOutput()

                    cmd = new Command("/usr/sbin/psrinfo");
                    cmd.setStreamHandling(Command.STDOUT, Command.CAPTURE);
                    logger.fine("Getting cpus");
                    CommandHandle handle = cmds.execute(hosts[j], cmd, null);
                    byte[] buffer = handle.fetchOutput(Command.STDOUT);

                    if (buffer != null) {
                        StringTokenizer t =
                                new StringTokenizer(new String(buffer), "\n");
View Full Code Here

Examples of com.sun.faban.common.CommandHandle.fetchOutput()

                File f = new File(sysfile + "." + machineName);
                f.delete();
                try {
                    syslog = new PrintStream(new FileOutputStream(f));
                    handle = cmds.execute(host, c, null);
                    byte[] messages = handle.fetchOutput(Command.STDOUT);
                    syslog.println(linesep);
                    syslog.println("System messages during run from server " +
                            host);
                    syslog.println("\n");
                    if (messages != null) // Null if no messages.
View Full Code Here

Examples of com.sun.faban.common.CommandHandle.fetchOutput()

   */
    private static boolean checkServerStarted(String hostName)
            throws Exception {
        Command checkCmd = new Command(asadminCmd, "list-domains");    
        CommandHandle handle = RunContext.exec(hostName, checkCmd);
        byte[] output = handle.fetchOutput(Command.STDOUT);
        if (output != null) {
            String outStr = new String(output);
        if (outStr.indexOf("domain1 running") != -1)
            return true;
        else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.