Commit 64439031 authored by Mike Hibler's avatar Mike Hibler

Return info about whether to collect/check when running nodecheck.

Controlled by new sitevars.
parent 95a8b0d6
......@@ -123,6 +123,8 @@ INSERT INTO sitevariables VALUES ('protogeni/wrapper_ch_debug_level',NULL,'0','W
INSERT INTO sitevariables VALUES ('protogeni/wrapper_cm_debug_level',NULL,'1','When set, send debugging email for CM wrapper calls',0);
INSERT INTO sitevariables VALUES ('protogeni/wrapper_am_debug_level',NULL,'1','When set, send debugging email for AM wrapper calls',0);
INSERT INTO sitevariables VALUES ('protogeni/wrapper_debug_sendlog',NULL,'1','When set, wrapper debugging email will send log files in addition to the metadata',0);
INSERT INTO sitevariables VALUES ('nodecheck/collect',NULL,'0','When set, collect and record node hardware info in /proj/<pid>/nodecheck/.',0);
INSERT INTO sitevariables VALUES ('nodecheck/check',NULL,'0','When set, perform nodecheck at swapin.',0);
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
......
#
# Add sitevars for nodecheck
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
DBQueryFatal("INSERT INTO sitevariables VALUES ".
" ('nodecheck/collect',NULL,'0', ".
" 'When set, collect and record node hardware info ".
"in /proj/<pid>/nodecheck/.',0)")
if (!TBSiteVarExists("nodecheck/collect"));
DBQueryFatal("INSERT INTO sitevariables VALUES ".
" ('nodecheck/check',NULL,'0', ".
" 'When set, perform nodecheck at swapin.',0)")
if (!TBSiteVarExists("nodecheck/check"));
return 0;
}
1;
# Local Variables:
# mode:perl
# End:
......@@ -11103,6 +11103,10 @@ COMMAND_PROTOTYPE(dodisks)
* Return info about hardware that should be present on the node.
* Current info looks like:
*
* General test info:
*
* TESTINFO LOGDIR=<path> COLLECT=<1|0> CHECK=<1|0>
*
* CPU (one line per node):
*
* CPUINFO SOCKETS=<#> CORES=<#> THREADS=<#> SPEED=<MHz> BITS=<32|64> HV=<1|0>
......@@ -11129,12 +11133,60 @@ COMMAND_PROTOTYPE(dohwinfo)
char buf[MYBUFSIZE];
char *bufp = buf, *ebufp = &buf[sizeof(buf)];
int nrows;
int collect = 0, check = 0;
char *path = NULL;
/* XXX only done for allocated physical nodes right now */
if (!reqp->allocated || reqp->isvnode) {
return 0;
}
/*
* Are we collecting, checking, or both?
*/
res = mydb_query("select value,defaultvalue from sitevariables "
"where name='nodecheck/collect'", 2);
if (res && (int)mysql_num_rows(res) > 0) {
row = mysql_fetch_row(res);
if (row[0] && row[0][0])
collect = atoi(row[0]);
else if (row[1] && row[1][0])
collect = atoi(row[1]);
}
if (res)
mysql_free_result(res);
res = mydb_query("select value,defaultvalue from sitevariables "
"where name='nodecheck/check'", 2);
if (res && (int)mysql_num_rows(res) > 0) {
row = mysql_fetch_row(res);
if (row[0] && row[0][0])
check = atoi(row[0]);
else if (row[1] && row[1][0])
check = atoi(row[1]);
}
if (res)
mysql_free_result(res);
/*
* If collecting, set the path
* XXX hardwired for now.
*/
if (collect) {
path = malloc(strlen("/proj//nodecheck") +
strlen(reqp->pid) + 1);
if (path)
sprintf(path, "/proj/%s/nodecheck", reqp->pid);
}
bufp += OUTPUT(bufp, ebufp - bufp,
"TESTINFO LOGDIR=\"%s\" COLLECT=%d CHECK=%d\n",
(path ? path : ""), collect, check);
client_writeback(sock, buf, strlen(buf), tcp);
bufp = buf;
if (path)
free(path);
/*
* CPU and memory info comes from node_type_attributes or
* node_attributes.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment