2005-04-18 18:26:14 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 University of California
|
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2005-04-18 18:26:14 +00:00
|
|
|
|
2014-02-06 01:21:03 +00:00
|
|
|
// DEPRECATED - the email by this script doesn't tell the
|
|
|
|
// volunteer anything specific or useful.
|
|
|
|
|
2005-04-18 18:26:14 +00:00
|
|
|
require_once("../inc/db.inc");
|
|
|
|
require_once("../inc/util_ops.inc");
|
|
|
|
require_once("../inc/email.inc");
|
|
|
|
|
2014-02-06 01:21:03 +00:00
|
|
|
exit();
|
2005-04-18 18:26:14 +00:00
|
|
|
|
2007-07-23 20:30:30 +00:00
|
|
|
|
|
|
|
function send_problem_email($user, $host) {
|
|
|
|
global $master_url;
|
|
|
|
$body = "";
|
2023-05-05 18:05:20 +00:00
|
|
|
|
2007-07-23 20:30:30 +00:00
|
|
|
$host_content = "ID: ".$host->id."
|
|
|
|
Created: ".time_str($host->create_time)."
|
|
|
|
Venue: ".$host->venue."
|
|
|
|
Total credit: ".$host->total_credit."
|
|
|
|
Average credit: ".$host->expavg_credit."
|
|
|
|
Average update time: ".time_str($host->expavg_time)."
|
|
|
|
IP address: $host->last_ip_addr (same the last $host->nsame_ip_addr times)
|
|
|
|
Domain name: " . $host->domain_name;
|
|
|
|
$x = $host->timezone/3600;
|
|
|
|
if ($x >= 0) $x="+$x";
|
|
|
|
$host_content.="
|
|
|
|
Local Time = UTC $x hours
|
|
|
|
Number of CPUs: " . $host->p_ncpus."
|
|
|
|
CPU: $host->p_vendor $host->p_model
|
|
|
|
FP ops/sec: ".$host->p_fpops."
|
|
|
|
Int ops/sec: ".$host->p_iops."
|
|
|
|
memory bandwidth: ".$host->p_membw."
|
|
|
|
Operating System: $host->os_name $host->os_version";
|
|
|
|
$x = $host->m_nbytes/(1024*1024);
|
|
|
|
$y = round($x, 2);
|
|
|
|
$host_content.="
|
|
|
|
Memory: $y MB";
|
|
|
|
$x = $host->m_cache/1024;
|
|
|
|
$y = round($x, 2);
|
|
|
|
$host_content.="
|
|
|
|
Cache: $y KB";
|
|
|
|
$x = $host->m_swap/(1024*1024);
|
|
|
|
$y = round($x, 2);
|
|
|
|
$host_content.="
|
|
|
|
Swap Space: $y MB";
|
|
|
|
$x = $host->d_total/(1024*1024*1024);
|
|
|
|
$y = round($x, 2);
|
|
|
|
$host_content.="
|
|
|
|
Total Disk Space: $y GB";
|
|
|
|
$x = $host->d_free/(1024*1024*1024);
|
|
|
|
$y = round($x, 2);
|
|
|
|
$host_content.="
|
|
|
|
Free Disk Space: $y GB
|
|
|
|
Avg network bandwidth (upstream): $host->n_bwup bytes/sec
|
|
|
|
Avg network bandwidth (downstream): $host->n_bwdown bytes/sec";
|
|
|
|
$x = $host->avg_turnaround/86400;
|
|
|
|
$host_content.="
|
|
|
|
Average turnaround: ".round($x, 2)." days
|
|
|
|
Number of RPCs: $host->rpc_seqno
|
|
|
|
Last RPC: ".time_str($host->rpc_time)."
|
|
|
|
% of time client on: ". 100*$host->on_frac." %
|
|
|
|
% of time host connected: " . 100*$host->connected_frac." %
|
|
|
|
% of time user active: " . 100*$host->active_frac." %
|
|
|
|
# of results today: " . $host->nresults_today;
|
2023-05-05 18:05:20 +00:00
|
|
|
|
2007-07-23 20:30:30 +00:00
|
|
|
$subject = PROJECT." notice for $user->name";
|
|
|
|
$body = PROJECT." notification:
|
|
|
|
|
|
|
|
Dear $user->name
|
|
|
|
Your machine (host # $host->id) described below appears to have a misconfigured BOINC
|
|
|
|
installation. Could you please have a look at it?
|
|
|
|
|
|
|
|
Sincerely,
|
|
|
|
The ". PROJECT." team
|
|
|
|
";
|
|
|
|
$body .= "
|
|
|
|
|
|
|
|
This is the content of our database:
|
|
|
|
" . $host_content."
|
|
|
|
|
|
|
|
For further information and assistance with ".PROJECT." go to $master_url";
|
2023-05-05 18:05:20 +00:00
|
|
|
echo nl2br($body) . "<br><br>";
|
2007-07-23 20:30:30 +00:00
|
|
|
return send_email($user, $subject, $body);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-02-06 01:21:03 +00:00
|
|
|
$hostid = get_int("hostid", true);
|
2005-04-18 18:26:14 +00:00
|
|
|
|
|
|
|
if (!$hostid) {
|
|
|
|
admin_page_head("Misconfigured Host");
|
|
|
|
echo "This script sends an email to the owner of the supplied host which says that something gone wrong with his configuration.<br>";
|
|
|
|
echo "<br><form method=\"get\" action=\"problem_host.php\">
|
2023-05-05 18:05:20 +00:00
|
|
|
Host ID:
|
2005-04-18 18:26:14 +00:00
|
|
|
<input type=\"text\" size=\"5\" name=\"hostid\">
|
2014-10-02 19:15:54 +00:00
|
|
|
<input class=\"btn btn-default\" type=\"submit\" value=\"Send Email\">
|
2005-04-18 18:26:14 +00:00
|
|
|
</form>
|
|
|
|
";
|
|
|
|
} else {
|
2014-02-06 01:21:03 +00:00
|
|
|
$host = BoincHost::lookup_id($hostid);
|
2005-04-19 19:56:23 +00:00
|
|
|
if (!$host) {
|
|
|
|
echo "<h2>No host with that ID</h2>
|
|
|
|
<center>Please <a href=\"problem_host.php\">try again</a></center>";
|
|
|
|
} else {
|
2014-02-06 01:21:03 +00:00
|
|
|
$user = BoincUser::lookup_id($host->userid);
|
2005-04-25 15:06:22 +00:00
|
|
|
echo "<a href=\"problem_host.php\">Do another?</a><br><br>";
|
2005-04-19 19:56:23 +00:00
|
|
|
send_problem_email($user, $host);
|
2005-04-25 15:06:22 +00:00
|
|
|
echo "Email to ".$user->email_addr." has been sent.<br>";
|
2005-04-19 19:56:23 +00:00
|
|
|
}
|
2005-04-18 18:26:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
admin_page_tail();
|
2008-08-05 22:43:14 +00:00
|
|
|
$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit
|
2005-04-18 18:26:14 +00:00
|
|
|
?>
|