6 | | * '''URL/server_status.php?xml=1:''' XML format, as follows: |
| 6 | * '''URL/server_status.php?xml=1:''' XML format. |
| 7 | |
| 8 | These show the status of daemon processes and counts of users and jobs. |
| 9 | |
| 10 | The database queries used for getting the counts can be slow. |
| 11 | The results are cached so that the queries are done infrequently. |
| 12 | The caching period is defined by the constant '''STATUS_PAGE_TTL''' |
| 13 | in html/project/cache_parameters.inc. |
| 14 | The default is 1 hour. |
| 15 | |
| 16 | If your project runs daemons on hosts other than the web server, |
| 17 | you'll need to run the script '''html/ops/remote_server_status.php''' |
| 18 | as a period script; i.e. put something like |
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> |
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. |
| 27 | This script uses ssh to find the status of daemons on remote hosts. |
| 28 | This can't be done directly from server_status.php because the Apache user |
| 29 | typically can't ssh to other hosts. |
| 30 | Your BOINC user (e.g. boincadm) must be able to ssh without password to |
| 31 | the hosts on which daemons run. |