app/controllers/info_controller.rb
# look at the logs coming from a left job
look at the logs coming from a left job
look at the logs coming from a left job
def inspect
    @id = params[:id]
    @type = params[:type]
    case @type
    when 'left','lcc','bict','cde'
      file = "#{Vibrant::Application.config.dropbox}/#{@type}/logs/#{@id}.txt"
      if File.exists?(file)
        @output = IO.readlines(file);
      else
        @output = ["No log found"]
      end
    when 'beast','mrbayes'
      @job = Job.find(@id)
      parts = @job.vars[:oscid].split(/\./)
      oscid = parts[0] + "." + parts[1]
      begin
        @output = ["#{$osc_host}:\n","                                                                               Req'd    Req'd      Elap\n","Job ID               Username    Queue    Jobname          SessID NDS   TSK    Memory   Time   S   Time\n","-------------------- ----------- -------- ---------------- ------ ----- ------ ------ -------- - --------\n"]
        @output << `ssh oboe@#{$osc_host}.#{$osc_domain} qstat -u oboe | grep #{oscid}`
        @output << "\n"
      rescue
        @output = ["No output available."]
      end
    else
      @output = ["Not yet implemented, sorry."]
    end
    render :layout => 'logrender'
  end
def inspect @id = params [ :id ] @type = params [ :type ] case @type when 'left' , 'lcc' , 'bict' , 'cde' file = "#{Vibrant::Application.config.dropbox}/#{@type}/logs/#{@id}.txt" if File . exists? ( file ) @output = IO . readlines ( file ) ; else @output = [ "No log found" ] end when 'beast' , 'mrbayes' @job = Job . find ( @id ) parts = @job . vars [ :oscid ] . split ( / \. / ) oscid = parts [ 0 ] + "." + parts [ 1 ] begin @output = [ "#{$osc_host}:\n" , "                                                                               Req'd    Req'd      Elap\n" , "Job ID               Username    Queue    Jobname          SessID NDS   TSK    Memory   Time   S   Time\n" , "-------------------- ----------- -------- ---------------- ------ ----- ------ ------ -------- - --------\n" ] @output << ` ssh oboe@ #{ $osc_host } . #{ $osc_domain }  qstat -u oboe | grep  #{ oscid } ` @output << "\n" rescue @output = [ "No output available." ] end else @output = [ "Not yet implemented, sorry." ] end render :layout => 'logrender' end
look at the logs coming from a left job
look at the logs coming from a left job
#@output << `ssh oboe@#{$osc_host}.#{$osc_domain} qstat -f #{@job.vars[:oscid].gsub(/$osc_host/,"")} | grep comment`