Server status
Program | Host | Status |
";
if ($xmlout) {
fwrite($xmloutfile,"\n");
fwrite($xmloutfile," " . time() . "\n");
fwrite($xmloutfile," \n");
}
# Are the data-driven web sites running? Check for existence
# of stop_web. If it is there, set $web_running to -1 for
# "disabled," otherwise it will be already set to 1 for "enabled."
# Set $web_host to the name of server hosting WWW site.
$web_running = !file_exists("../../stop_web");
if ($web_running == 0) { $web_running = -1; }
show_status($web_host, "data-driven web pages", $web_running);
# Check for httpd.pid file of upload/download server.
$uldl_running = file_exists($uldl_pid);
if ($uldl_running == 0) { $uldl_running = -1; }
show_status($uldl_host, "upload/download server", $uldl_running);
# $sched_running = !file_exists("../../stop_sched");
$sched_running = file_exists($sched_pid);
if ($sched_running == 0) { $sched_running = -1; }
show_status($sched_host, "scheduler", $sched_running);
# parse through config.xml to get all daemons running
$config_xml = get_config();
$cursor = 0;
# while ($thisxml = trim(parse_next_element($config_xml,"",&$cursor))) {
$thisxml = trim(parse_next_element($config_xml,"",&$cursor));
$host = parse_element($thisxml,"");
$cmd = parse_element($thisxml,"");
list($ncmd) = explode(" ",$cmd);
$log = parse_element($thisxml,"\n \n");
}
echo "
Running: |
Program is operating normally |
Not Running: |
Program failed or ran out of work
(or the project is down) |
Disabled: |
Program has been disabled by staff
(for debugging/maintenance) |
|
Database/file status
";
$retval = db_init_aux();
if ($retval) {
echo "The database server is not accessible";
} else {
echo "
State | # |
";
show_counts("Results ready to send","results_ready_to_send",get_mysql_count("result where server_state = 2"));
show_counts("Results in progress","results_in_progress",get_mysql_count("result where server_state = 4"));
show_counts("Workunits waiting for validation","workunits_waiting_for_validation",get_mysql_count("workunit where need_validate=1"));
show_counts("Workunits waiting for assimilation","workunits_waiting_for_assimilation",get_mysql_count("workunit where assimilate_state=1"));
show_counts("Workunits waiting for deletion","workunits_waiting_for_deletion",get_mysql_count("workunit where file_delete_state=1"));
show_counts("Results waiting for deletion","results_waiting_for_deletion",get_mysql_count("result where file_delete_state=1"));
$result = mysql_query("select MIN(transition_time) as min from workunit");
$min = mysql_fetch_object($result);
mysql_free_result($result);
$gap = (time() - $min->min)/3600;
if ($gap < 0) { $gap = 0; }
show_counts("Transitioner backlog (hours)","transitioner_backlog_hours",$gap);
echo " ";
}
if ($xmlout) {
fwrite($xmloutfile," \n");
fwrite($xmloutfile,"\n");
}
echo "
|
|