From 3cc5bae558ce6619afd1e42e7dffbed03c1d4d56 Mon Sep 17 00:00:00 2001 From: Reinhard Prix Date: Thu, 5 Oct 2006 12:43:29 +0000 Subject: [PATCH] checkin for Bernd Machenschalk: This adds a new link to the OPS page called "List all-error Workunits". The php script it calls scans the database for Workunits that got at least min_quorum+1 (number can be configured withing the script) client errors returned and no successful result (yet). The idea is to detect problems in the workunit generation or data files. Scanning the whole result table the script stresses the database a bit, so some caching has been incorporated (300 sec by default). svn path=/trunk/boinc/; revision=11250 --- html/ops/errorwus.php | 99 +++++++++++++++++++++++++++++++++++++++++++ html/ops/index.php | 2 + 2 files changed, 101 insertions(+) create mode 100644 html/ops/errorwus.php diff --git a/html/ops/errorwus.php b/html/ops/errorwus.php new file mode 100644 index 0000000000..f5822f31f4 --- /dev/null +++ b/html/ops/errorwus.php @@ -0,0 +1,99 @@ +\n"; + + echo ""; + echo ""; + echo $id; + echo "\n"; + + echo ""; + echo $name; + echo "\n"; + + echo ""; + echo $quorum; + echo "\n"; + + echo ""; + echo ""; + echo $errors; + echo "\n"; + + echo "\n"; +} + +$dbresult = mysql_query(" + SELECT workunitid, outcome, workunit.name, min_quorum + FROM result, workunit + WHERE workunit.id = workunitid AND server_state = 5 + ORDER BY workunitid, outcome DESC +;"); + +echo "
\n"; +echo "\n"; + +$rescount = 0; +$previd = -1; +$prevname = ""; +$prevquorum = 1; +$errors = 0; + +// The current version scans for client errors only. +// In case you want to include validate errors, add "|| (outcome = 6)" to "(outcome = 3)" + +while ($res = mysql_fetch_object($dbresult)) { + $id = $res->workunitid; + if ($id != $previd) { + if ($errors > $prevquorum + $notification_level) { + print_wu($previd,$prevname,$prevquorum,$errors); + $rescount++; + } + $previd = $id; + $prevname = $res->name; + $prevquorum = $res->min_quorum; + $errors = 0; + } + if ($res->outcome == 3) { + $errors ++; + } + if ($res->outcome == 1) { + $errors = 0; + } +} +mysql_free_result($dbresult); +if ($errors > $prevquorum) { + print_wu($id,$prevname,$prevquorum,$errors); + $rescount++; +} + +echo "
WU IDWU nameQuorumErrors
\n
"; +echo $rescount; +echo " entries\n"; + +admin_page_tail(); + +end_cache($cache_sec); +?> diff --git a/html/ops/index.php b/html/ops/index.php index e2d749cbdf..00877c4438 100644 --- a/html/ops/index.php +++ b/html/ops/index.php @@ -77,10 +77,12 @@ while ($app = mysql_fetch_object($result)) { } mysql_free_result($result); +echo "
\n"; echo " Stripcharts | Show/Grep all logs | Tail MySQL logs + | List all-error Workunits "; admin_page_tail();