/*
$Log$
+Revision 1.66 2007/12/05 10:45:19 jgrosseo
+changed order of arguments to TMonaLisaWriter
+
Revision 1.65 2007/11/26 16:58:37 acolla
Monalisa configuration added: host and table name
TString lhcPeriod(GetLHCPeriod());
if (lhcPeriod.Length() == 0)
{
- Log("SHUTTLE","StoreRunMetaDataFile - LHCPeriod not found in logbook!");
- return 0;
+ Log("SHUTTLE","Process - LHCPeriod not found in logbook!");
+ return 0;
}
if (fgkMainCDB.Length() == 0)
// Fill log string with a message
//
- void* dir = gSystem->OpenDirectory(GetShuttleLogDir());
+ TString logRunDir = GetShuttleLogDir();
+ if (GetCurrentRun() >=0)
+ logRunDir += Form("/%d", GetCurrentRun());
+
+ void* dir = gSystem->OpenDirectory(logRunDir.Data());
if (dir == NULL) {
- if (gSystem->mkdir(GetShuttleLogDir(), kTRUE)) {
+ if (gSystem->mkdir(logRunDir.Data(), kTRUE)) {
AliError(Form("Can't open directory <%s>", GetShuttleLogDir()));
return;
}
TString fileName;
if (GetCurrentRun() >= 0)
- fileName.Form("%s/%s_%d.log", GetShuttleLogDir(), detector, GetCurrentRun());
- else
+ {
+ fileName.Form("%s/%d/%s_%d.log", GetShuttleLogDir(), GetCurrentRun(),
+ detector, GetCurrentRun());
+ } else {
fileName.Form("%s/%s.log", GetShuttleLogDir(), detector);
+ }
return fileName;
}
TString body = Form("Dear %s expert(s), \n\n", fCurrentDetector.Data());
body += Form("SHUTTLE just detected that your preprocessor "
"failed processing run %d!!\n\n", GetCurrentRun());
- body += Form("Please check %s status on the SHUTTLE monitoring page: \n\n", fCurrentDetector.Data());
+ body += Form("Please check %s status on the SHUTTLE monitoring page: \n\n",
+ fCurrentDetector.Data());
body += Form("\thttp://pcalimonitor.cern.ch:8889/shuttle.jsp?time=168 \n\n");
+
+ TString logFolder = "logs";
+ if (fConfig->GetRunMode() == AliShuttleConfig::kProd)
+ logFolder += "_PROD";
+
+
body += Form("Find the %s log for the current run on \n\n"
- "\thttp://pcalishuttle01.cern.ch:8880/logs/%s_%d.log \n\n",
- fCurrentDetector.Data(), fCurrentDetector.Data(), GetCurrentRun());
- body += Form("The last 10 lines of %s log file are following:\n\n");
+ "\thttp://pcalishuttle01.cern.ch:8880/%s/%d/%s_%d.log \n\n",
+ fCurrentDetector.Data(), logFolder.Data(), GetCurrentRun(),
+ fCurrentDetector.Data(), GetCurrentRun());
+ body += Form("The last 10 lines of %s log file are following:\n\n", fCurrentDetector.Data());
AliDebug(2, Form("Body begin: %s", body.Data()));
mailBody.close();
mailBody.open(bodyFileName, ofstream::out | ofstream::app);
- TString logFileName = Form("%s/%s_%d.log", GetShuttleLogDir(), fCurrentDetector.Data(), GetCurrentRun());
+ TString logFileName = Form("%s/%d/%s_%d.log", GetShuttleLogDir(),
+ GetCurrentRun(), fCurrentDetector.Data(), GetCurrentRun());
TString tailCommand = Form("tail -n 10 %s >> %s", logFileName.Data(), bodyFileName.Data());
if (gSystem->Exec(tailCommand.Data()))
{
TString body = Form("Dear DCS experts, \n\n");
body += Form("SHUTTLE couldn\'t retrieve the data points for detector %s "
"in run %d!!\n\n", fCurrentDetector.Data(), GetCurrentRun());
- body += Form("Please check %s status on the SHUTTLE monitoring page: \n\n", fCurrentDetector.Data());
+ body += Form("Please check %s status on the SHUTTLE monitoring page: \n\n",
+ fCurrentDetector.Data());
body += Form("\thttp://pcalimonitor.cern.ch:8889/shuttle.jsp?time=168 \n\n");
+
+ TString logFolder = "logs";
+ if (fConfig->GetRunMode() == AliShuttleConfig::kProd)
+ logFolder += "_PROD";
+
+
body += Form("Find the %s log for the current run on \n\n"
- "\thttp://pcalishuttle01.cern.ch:8880/logs/%s_%d.log \n\n",
- fCurrentDetector.Data(), fCurrentDetector.Data(), GetCurrentRun());
- body += Form("The last 10 lines of %s log file are following:\n\n");
+ "\thttp://pcalishuttle01.cern.ch:8880/%s/%d/%s_%d.log \n\n",
+ fCurrentDetector.Data(), logFolder.Data(), GetCurrentRun(),
+ fCurrentDetector.Data(), GetCurrentRun());
+ body += Form("The last 10 lines of %s log file are following:\n\n", fCurrentDetector.Data());
AliDebug(2, Form("Body begin: %s", body.Data()));
mailBody.close();
mailBody.open(bodyFileName, ofstream::out | ofstream::app);
- TString logFileName = Form("%s/%s_%d.log", GetShuttleLogDir(), fCurrentDetector.Data(), GetCurrentRun());
+ TString logFileName = Form("%s/%d/%s_%d.log", GetShuttleLogDir(), GetCurrentRun(),
+ fCurrentDetector.Data(), GetCurrentRun());
TString tailCommand = Form("tail -n 10 %s >> %s", logFileName.Data(), bodyFileName.Data());
if (gSystem->Exec(tailCommand.Data()))
{
/*
$Log$
+Revision 1.25 2007/11/26 16:58:37 acolla
+Monalisa configuration added: host and table name
+
Revision 1.24 2007/10/24 10:44:08 acolla
debug AliInfo removed
fPPMaxMem(0),
fMonitorHost(""),
fMonitorTable(""),
+ fTriggerWait(3600),
+ fRunMode(kTest),
fDetectorMap(),
fDetectorList(),
fShuttleInstanceHost(""),
return 4;
}
fMonitorTable = anAttribute->GetValue();
+
+ anAttribute = anEntry->GetAttribute("triggerWait"); // MAY
+ if (!anAttribute) {
+ AliWarning(Form("triggerWait not set! default = ", fTriggerWait));
+ }
+ tmpStr = anAttribute->GetValue();
+ fTriggerWait = tmpStr.Atoi();
+ anAttribute = anEntry->GetAttribute("mode");
+ if (!anAttribute) {
+ AliWarning("Run mode not set! Running in test mode.");
+ }
+ tmpStr = anAttribute->GetValue();
+ if (tmpStr == "test")
+ {
+ fRunMode = kTest;
+ } else if (tmpStr == "prod") {
+ fRunMode = kProd;
+ } else {
+ AliWarning(Form("Not a valid run mode: %s", tmpStr.Data()));
+ AliWarning("Valid run modes are \"test\" and \"prod\". Running in test mode.");
+ }
+
return 0;
TString result;
result += '\n';
+
+ TString mode = "test";
+ if (fRunMode == kProd) mode = "production";
- result += "####################################################\n";
- result += Form(" Shuttle configuration from %s \n", fConfigHost.Data());
- result += "####################################################\n";
+ result += "########################################################################\n";
+ result += Form(" Shuttle configuration from %s - Run Mode: <%s> \n",
+ fConfigHost.Data(), mode.Data());
+ result += "########################################################################\n";
result += Form("\nShuttle running on %s \n", fShuttleInstanceHost.Data());
if(fProcessAll) {
result += "\n";
}
- result += Form("PP time out = %d - max PP mem size = %d KB - max retries = %d\n\n",
- fPPTimeOut, fPPMaxMem, fMaxRetries);
+ result += Form("PP time out = %d - max PP mem size = %d KB - max retries = %d "
+ "- DIM trigger waiting timeout = %d\n\n",
+ fPPTimeOut, fPPMaxMem, fMaxRetries, fTriggerWait);
result += "------------------------------------------------------\n";
result += Form("Logbook Configuration \n\n \tHost: %s:%d; \tUser: %s; ",
class AliShuttleConfig: public TObject {
public:
+ enum RunMode {kTest=0, kProd};
+
AliShuttleConfig(const char* host, Int_t port = LDAP_PORT,
const char* binddn = 0, const char* password = 0,
const char* basedn = "o=alice,dc=cern,dc=ch");
const char* GetMonitorHost() const {return fMonitorHost.Data();}
const char* GetMonitorTable() const {return fMonitorTable.Data();}
+ Int_t GetTriggerWait() const {return fTriggerWait;}
+
+ RunMode GetRunMode() const {return fRunMode;}
+
const TObjArray* GetDetectors() const;
Bool_t HasDetector(const char* detector) const;
TString fMonitorHost; // host of the MonaLisa monitoring server
TString fMonitorTable; // Monalisa's SHUTTLE table name
+
+ Int_t fTriggerWait; // time to wait for DIM trigger before starting new collection
+ RunMode fRunMode; // Working mode (0=test; 1=prod)
TMap fDetectorMap; // Map of the detector-by-detector configuration
TObjArray fDetectorList; // List of detectors with valid configuration