| | 1 | = Server status = |
| | 2 | |
| | 3 | Each project should export its server status in two forms: |
| | 4 | |
| | 5 | * '''URL/server_status.php:''' human-readable (web page). |
| | 6 | * '''URL/server_status.php?xml=1:''' XML format, as follows: |
| | 7 | {{{ |
| | 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> |
| | 38 | }}} |
| | 39 | |
| | 40 | There are two ways to do this: |
| | 41 | |
| | 42 | 1. Copy the file `server_status.php` from `html/ops` to `html/user`. This works fine 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. |