$pid = parse_element($thisxml, "<pid_file>");
    if (!$pid) {
        $pid = $cmd . ".pid";
    }
    $disabled = parse_element($thisxml, "<disabled>");
    // surrogate for command
    list($c) = explode(".", $log);
    show_daemon_status($host, $pid, $c, $disabled);
}
$xmlstring = "  </daemon_status>\n  <database_file_states>\n";
if ($xml) {
    echo $xmlstring;
} else {
    echo "\n        <tr><td align=right><b>" . tra("Running:") . "</b></td>\n        <td colspan=2>" . tra("Program is operating normally") . "</td></tr>\n        <tr><td align=right><b>" . tra("Not Running:") . "</b></td>\n        <td colspan=2>" . tra("Program failed or the project is down") . "</td></tr>\n        <tr><td align=right><b>" . tra("Disabled:") . "</b></td>\n        <td colspan=2>" . tra("Program is disabled") . "</td></tr>\n        </table>\n        </td>\n        <td valign=top>\n        <h2>" . tra("Computing status") . "</h2>\n    ";
}
if (BoincDB::get_aux(true) == null) {
    echo tra("The database server is not accessible");
} else {
    if (!$xml) {
        echo "<table border=0 cellpadding=0 cellspacing=0><tr><td>\n            <table border=0 cellpadding=4>\n            <tr><th>" . tra("Work") . "</th><th>#</th></tr>\n        ";
    }
    // If you are reading these values from a file rather than
    // making live queries to the database, do something like this:
    //
    // $sendfile = "/home/boincadm/server_status_data/count_results_unsent.out";
    // $n = `/bin/tail -1 $sendfile`;
    // show_counts("Tasks ready to send","results_ready_to_send",$n);
    show_counts(tra("Tasks ready to send"), "results_ready_to_send", get_mysql_count("result", "server_state = 2"));
    show_counts(tra("Tasks in progress"), "results_in_progress", get_mysql_count("result", "server_state = 4"));
    show_counts(tra("Workunits waiting for validation"), "workunits_waiting_for_validation", get_mysql_count("workunit", "need_validate=1"));
    show_counts(tra("Workunits waiting for assimilation"), "workunits_waiting_for_assimilation", get_mysql_count("workunit", "assimilate_state=1"));