IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30469


Ignore:
Timestamp:
Feb 2, 2011, 5:03:06 PM (15 years ago)
Author:
bills
Message:

Add a task to periodically gather the postage stamp server status and save
it into a file in the pstamp/web directory rather than getting the status directly.

Location:
trunk
Files:
1 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/pstamp.pro

    r30317 r30469  
    905905    end
    906906end
     907
     908task pstamp.save.status
     909    host        local
     910
     911    periods     -poll $LOADPOLL
     912    periods     -exec 45
     913    periods     -timeout 20
     914    npending    1
     915
     916    task.exec
     917        stdout NULL
     918        stderr $LOGSUBDIR/pstamp.save.status.log
     919
     920        $run = pstamp_save_server_status.pl --update-link
     921        command $run
     922    end
     923
     924    task.exit $EXIT_SUCCESS
     925        # echo nothing to do
     926    end
     927
     928    task.exit   default
     929        showcommand failure
     930    end
     931
     932    task.exit   crash
     933        showcommand crash
     934    end
     935
     936    task.exit   timeout
     937        showcommand timeout
     938    end
     939end
  • trunk/pstamp/scripts/Makefile.am

    r29330 r30469  
    1717        pstamp_runcommand.sh \
    1818        pstamp_server_status \
     19        pstamp_save_server_status.pl \
    1920        pstamp_webrequest.pl \
    2021        pstamp_get_image_job.pl \
    2122        psmkreq \
     23        psstatus \
    2224        pstampstopfaulted \
    2325        pstamp_checkdependent.pl \
  • trunk/pstamp/scripts/pstamp_server_status

    r30317 r30469  
    2525
    2626pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    27 #pod2usage( -msg => "Required options: --first --stage",
    28 #          -exitval => 3) unless
    29 #    defined $first and
    30 #    defined $stage;
    3127
    3228# Look for programs we need
     
    3935}
    4036
     37# XXX: Note under pantasks this will be the curent directory, so this
     38# isn't necessary if the pstamp/web stuff is configured to point at the
     39# ipp build. But currently it's running out of Bill's build
    4140my $ipphome = "/home/panstarrs/ipp";
     41my $status_cmd = "psstatus";
     42
    4243$rundir = "$ipphome/pstamp" if !$rundir;
    4344
     
    5051    exit 0;
    5152}
     53
     54my $now = `date -u`;
     55
     56print "<b>Status updated: &nbsp;&nbsp;&nbsp;</b> $now<br /><br />\n";
    5257
    5358my ($pts, $pantasks_script) = tempfile ('/tmp/pts.XXXX', UNLINK => !$save_temps);
     
    138143        print "Task pstamp.job.run not found.<br />\n";
    139144    }
     145
     146    # now run the script psstatus to check the status of running requests and finished requests
    140147    print "<br /><b>Unfinished Requests</b><br />\n";
    141148    print "<pre>\n";
    142     system "/home/panstarrs/bills/ipp/tools/psstatus -r ";
     149    system "$status_cmd --running";
    143150    print "</pre>\n";
     151
     152if (0) {
     153    # these are included in running requests above
     154    print "<br /><b>Requests building results fileset</b><br/>\n";
     155    print "<pre>\n";
     156    system "$status_cmd --finishing";
     157    print "</pre>\n";
     158}
     159
    144160    print "<br /><b>Requests completed in last 24 hours (most recently completed first)</b><br />\n";
    145161    print "<pre>\n";
    146     # finished requests
    147     system "/home/panstarrs/bills/ipp/tools/psstatus -f";
     162    system "$status_cmd --finished";
    148163    print "</pre>\n";
     164
    149165} else {
    150166    print "Task pstamp.request.run not found.\n";
     
    153169
    154170
    155 
    156171exit 0;
Note: See TracChangeset for help on using the changeset viewer.