Changes between Version 2 and Version 3 of ServerStatus


Ignore:
Timestamp:
Nov 30, 2014, 8:23:58 PM (9 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ServerStatus

    v2 v3  
    11= Server status =
    22
    3 Each project should export its server status in two forms:
     3A project exports its server status in two forms:
    44
    55 * '''URL/server_status.php:''' human-readable (web page).
    6  * '''URL/server_status.php?xml=1:''' XML format, as follows:
     6 * '''URL/server_status.php?xml=1:''' XML format.
     7
     8These show the status of daemon processes and counts of users and jobs.
     9
     10The database queries used for getting the counts can be slow.
     11The results are cached so that the queries are done infrequently.
     12The caching period is defined by the constant '''STATUS_PAGE_TTL'''
     13in html/project/cache_parameters.inc.
     14The default is 1 hour.
     15
     16If your project runs daemons on hosts other than the web server,
     17you'll need to run the script '''html/ops/remote_server_status.php'''
     18as a period script; i.e. put something like
    719{{{
    8 <server_status>
    9     <update_time>1127772607</update_time>
    10     <daemon_status>
    11         <daemon>
    12             <host>jocelyn</host>
    13             <command>BOINC database</command>
    14             <status>running</status>
    15         </daemon>
    16         <daemon>
    17             <host>castelli</host>
    18             <command>master science database</command>
    19             <status>running</status>
    20         </daemon>
    21         <daemon>
    22             <host>kryten</host>
    23             <command>sah_validate4</command>
    24             <status>running</status>
    25         </daemon>
    26         ...
    27     </daemon_status>
    28     <database_file_states>
    29         <results_ready_to_send>563389</results_ready_to_send>
    30         <results_in_progress>1198237</results_in_progress>
    31         <workunits_waiting_for_validation>19</workunits_waiting_for_validation>
    32         <workunits_waiting_for_assimilation>16</workunits_waiting_for_assimilation>
    33         <workunits_waiting_for_deletion>0</workunits_waiting_for_deletion>
    34         <results_waiting_for_deletion>0</results_waiting_for_deletion>
    35         <transitioner_backlog_hours>-0.0002777</transitioner_backlog_hours>
    36     </database_file_states>
    37 </server_status>
     20<task>
     21   <cmd>run_in_ops remote_server_status.php</cmd>
     22   <period>1 hour</period>
     23</task>
    3824}}}
     25in the '''<tasks>''' section of your config.xml.
    3926
    40 There are two ways to do this:
    41 
    42  1. Copy `html/ops/sample_server_status.php` to `html/user/server_status.php`. This works as long as you don't need any customization, and the DB queries in the page only take a few seconds (the page is cached, so they are done infrequently).
    43  1. Write a periodic script that generates the 2 pages as files, and put a script in `user/server_status.php` that echoes one file or the other.
     27This script uses ssh to find the status of daemons on remote hosts.
     28This can't be done directly from server_status.php because the Apache user
     29typically can't ssh to other hosts.
     30Your BOINC user (e.g. boincadm) must be able to ssh without password to
     31the hosts on which daemons run.