// will be retrieved (used by AliShuttle).
//
-
+#include <Riostream.h>
#include "AliShuttleConfig.h"
#include "AliShuttleInterface.h"
#include <TLDAPResult.h>
#include <TLDAPEntry.h>
#include <TLDAPAttribute.h>
+#include <TKey.h>
AliShuttleConfig::AliShuttleDCSConfigHolder::AliShuttleDCSConfigHolder(const TLDAPEntry* entry):
fIsValid = kTRUE;
}
-
//______________________________________________________________________________________________
void AliShuttleConfig::AliShuttleDCSConfigHolder::ExpandAndAdd(TObjArray* target, const char* entry)
{
AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port,
const char* binddn, const char* password, const char* basedn):
fConfigHost(host),
+ fAlienPath(""),
fDAQlbHost(""),
fDAQlbPort(),
fDAQlbUser(""),
fDAQlbTable(""),
fShuttlelbTable(""),
fRunTypelbTable(""),
- fMaxRetries(0),
+ fPasswdFilePath(""),
+ fTerminateFilePath(""),
+ fMaxRetries(0),
fPPTimeOut(0),
+ fDCSTimeOut(0),
+ fDCSRetries(0),
+ fDCSQueryOffset(0),
+ fDCSDelay(0),
fPPMaxMem(0),
fMonitorHost(""),
fMonitorTable(""),
fTriggerWait(3600),
+ fShuttleFileSystem("/"),
+ fFreeDiskWarningThreshold(20),
+ fFreeDiskFatalThreshold(10),
fRunMode(kTest),
fDetectorMap(),
fDetectorList(),
fDetectorList.SetOwner(0); //fDetectorList and fDetectorMap share the same object!
fProcessedDetectors.SetOwner();
- for (int i=0; i<5; i++)
+ for (int i=0; i<6; i++)
{
fAdmin[i] = new TObjArray();
fAdmin[i]->SetOwner();
result += SetGlobalConfig(&globalList);
result += SetSysConfig(&sysList);
+ result += SetPasswords();
result += SetDetConfig(&detList,&dcsList);
result += SetHostConfig(&hostList);
fDetectorMap.DeleteAll();
fDetectorList.Clear();
fProcessedDetectors.Delete();
-
- delete[] fAdmin;
-
}
//______________________________________________________________________________________________
{
//
// returns collection of TObjString which represents the list of mail addresses
- // of the system's administrator(s) (DAQ, DCS, HLT, Global, Amanda)
+ // of the system's administrator(s) (DAQ, DCS, HLT, Global, Amanda, DQM)
//
- if (sys < 0 || sys > 4) return 0;
+ if (sys < 0 || sys > 5) return 0;
return fAdmin[sys];
}
{
// Set the global configuration (DAQ Logbook + preprocessor monitoring settings)
+
TLDAPEntry* anEntry = 0;
TLDAPAttribute* anAttribute = 0;
}
+ anAttribute = anEntry->GetAttribute("AlienPath");
+ if (!anAttribute) {
+ AliError("Can't find AlienPath attribute!");
+ return 4;
+ }
+ fAlienPath = anAttribute->GetValue();
+
anAttribute = anEntry->GetAttribute("daqLbHost");
if (!anAttribute) {
AliError("Can't find daqLbHost attribute!");
}
fDAQlbUser = anAttribute->GetValue();
- anAttribute = anEntry->GetAttribute("daqLbPasswd");
- if (!anAttribute) {
- AliError("Can't find daqLbPasswd attribute!");
- return 4;
- }
- fDAQlbPass = anAttribute->GetValue();
-
anAttribute = anEntry->GetAttribute("daqLbDB");
if (!anAttribute) {
AliError("Can't find daqLbDB attribute!");
TString tmpStr = anAttribute->GetValue();
fMaxRetries = tmpStr.Atoi();
+ anAttribute = anEntry->GetAttribute("terminateFilePath");
+ if (anAttribute) {
+ fTerminateFilePath = anAttribute->GetValue();
+ }
+
anAttribute = anEntry->GetAttribute("ppTimeOut");
if (!anAttribute) {
AliError("Can't find ppTimeOut attribute!");
tmpStr = anAttribute->GetValue();
fPPTimeOut = tmpStr.Atoi();
+ anAttribute = anEntry->GetAttribute("dcsTimeOut");
+ if (!anAttribute) {
+ AliError("Can't find dcsTimeOut attribute!");
+ return 4;
+ }
+ tmpStr = anAttribute->GetValue();
+ fDCSTimeOut = tmpStr.Atoi();
+
+ anAttribute = anEntry->GetAttribute("nDCSretries");
+ if (!anAttribute) {
+ AliError("Can't find dcsTimeOut attribute!");
+ return 4;
+ }
+ tmpStr = anAttribute->GetValue();
+ fDCSRetries = tmpStr.Atoi();
+
+ anAttribute = anEntry->GetAttribute("DCSQueryOffset");
+ if (!anAttribute) {
+ AliError("Can't find DCSQueryOffset attribute!");
+ return 4;
+ }
+ tmpStr = anAttribute->GetValue();
+ fDCSQueryOffset = tmpStr.Atoi();
+
+ anAttribute = anEntry->GetAttribute("DCSDelay");
+ if (!anAttribute) {
+ AliError("Can't find DCSDelay attribute!");
+ return 4;
+ }
+ tmpStr = anAttribute->GetValue();
+ fDCSDelay = tmpStr.Atoi();
+
anAttribute = anEntry->GetAttribute("ppMaxMem");
if (!anAttribute) {
AliError("Can't find ppMaxMem attribute!");
anAttribute = anEntry->GetAttribute("triggerWait"); // MAY
if (!anAttribute) {
- AliWarning(Form("triggerWait not set! default = ", fTriggerWait));
+ AliWarning(Form("triggerWait not set! default = %d", fTriggerWait));
}
tmpStr = anAttribute->GetValue();
fTriggerWait = tmpStr.Atoi();
-
+
+ anAttribute = anEntry->GetAttribute("ShuttleFileSystem");
+ if (!anAttribute) {
+ AliWarning(Form("ShuttleFileSystem not set! default = %s", fShuttleFileSystem.Data()));
+ }
+ fShuttleFileSystem = anAttribute->GetValue();
+
+ anAttribute = anEntry->GetAttribute("FreeDiskWarningThreshold"); // MAY
+ if (!anAttribute) {
+ AliWarning(Form("FreeDiskWarningThreshold not set! default = %d", fFreeDiskWarningThreshold));
+ }
+ tmpStr = anAttribute->GetValue();
+ fFreeDiskWarningThreshold = tmpStr.Atoi();
+
+ anAttribute = anEntry->GetAttribute("FreeDiskFatalThreshold"); // MAY
+ if (!anAttribute) {
+ AliWarning(Form("FreeDiskFatalThreshold not set! default = %d", fFreeDiskFatalThreshold));
+ }
+ tmpStr = anAttribute->GetValue();
+ fFreeDiskFatalThreshold = tmpStr.Atoi();
+
anAttribute = anEntry->GetAttribute("mode");
if (!anAttribute) {
AliWarning("Run mode not set! Running in test mode.");
fSendMail = (Bool_t) sendMailStr.Atoi();
}
+ anAttribute = anEntry->GetAttribute("passwdFilePath");
+ if (!anAttribute) {
+ AliError("Can't find Passwords File Path attribute!");
+ return 4;
+ }
+ fPasswdFilePath = anAttribute->GetValue();
+
return 0;
}
//______________________________________________________________________________________________
UInt_t AliShuttleConfig::SetSysConfig(TList* list)
{
- // Set the online FXS configuration (DAQ + DCS + HLT)
-
+ // Set the online FXS configuration (DAQ + DCS + HLT + DQM)
+
+
TLDAPEntry* anEntry = 0;
TLDAPAttribute* anAttribute = 0;
- if (list->GetEntries() != 3)
+ if (list->GetEntries() != 4)
{
AliError(Form("Wrong number of online systems found: %d !", list->GetEntries()));
return 1;
iSys = kHLT;
count += 100;
}
+ else if (sysName == "DQM")
+ {
+ iSys = kDQM;
+ count += 1000;
+ }
anAttribute = anEntry->GetAttribute("dbHost");
if (!anAttribute) {
}
fFXSdbUser[iSys] = anAttribute->GetValue();
- anAttribute = anEntry->GetAttribute("dbPasswd");
- if (!anAttribute) {
- AliError(Form ("Can't find dbPasswd attribute for %s!!",
- AliShuttleInterface::GetSystemName(iSys)));
- return 5;
- }
- fFXSdbPass[iSys] = anAttribute->GetValue();
-
anAttribute = anEntry->GetAttribute("dbName");
if (!anAttribute) {
AliError(Form ("Can't find dbName attribute for %s!!",
anAttribute = anEntry->GetAttribute("fxsPasswd");
if (anAttribute) fFXSPass[iSys] = anAttribute->GetValue();
+
+ anAttribute = anEntry->GetAttribute("fxsBaseFolder");
+ if (anAttribute) fFXSBaseFolder[iSys] = anAttribute->GetValue();
anAttribute = anEntry->GetAttribute("fxsAdmin"); // MAY
if (!anAttribute)
}
- if(count != 111) {
+ if(count != 1111) {
AliError(Form("Wrong system configuration! (code = %d)", count));
return 6;
}
return 0;
}
+//______________________________________________________________________________________________
+UInt_t AliShuttleConfig::SetPasswords(){
+
+ AliInfo("Setting Passwords");
+
+ // Retrieving Passwords for DAQ lb, DAQ/DCS/HLT/DQM FXS
+
+ ifstream *inputfile = new ifstream(fPasswdFilePath.Data());
+ if (!*inputfile) {
+ AliError(Form("Error opening file %s !", fPasswdFilePath.Data()));
+ inputfile->close();
+ delete inputfile;
+ return 1;
+ }
+
+ TString line;
+ Int_t nPwd=0;
+ Int_t nPwdFake=0;
+ while (line.ReadLine(*inputfile)) {
+ TObjArray *tokens = line.Tokenize(" \t");
+ TString system = ((TObjString *)tokens->At(0))->String();
+ TString password = ((TObjString *)tokens->At(1))->String();
+ delete tokens;
+ if (system.Contains("DAQ_LB")){
+ fDAQlbPass=password;
+ nPwd++;
+ AliDebug(3,Form("DAQ_LB: Password %s for %s found", password.Data(), system.Data()));
+ }
+ else if (system.Contains("DAQ_DB")){
+ fFXSdbPass[0]=password;
+ nPwd++;
+ AliDebug(3,Form("DAQ_DB: Password %s for %s found", password.Data(), system.Data()));
+ }
+ else if (system.Contains("DCS_DB")){
+ fFXSdbPass[1]=password;
+ nPwd++;
+ AliDebug(3,Form("DCS_DB: Password %s for %s found", password.Data(), system.Data()));
+ }
+ else if (system.Contains("HLT_DB")){
+ fFXSdbPass[2]=password;
+ nPwd++;
+ AliDebug(3,Form("HLT_DB: Password %s for %s found", password.Data(), system.Data()));
+ }
+ else if (system.Contains("DQM_DB")){
+ fFXSdbPass[3]=password;
+ nPwd++;
+ AliDebug(3,Form("DQM_DB: Password %s for %s found", password.Data(), system.Data()));
+ }
+ else {
+ nPwdFake++;
+ AliDebug(3,Form("%i fake line(s) found in file %s", nPwdFake, fPasswdFilePath.Data()));
+ continue;
+ }
+ }
+
+ inputfile->close();
+ delete inputfile;
+
+ if (nPwd!=5){
+ AliError(Form("Wrong file for DAQ Logbook password found %s (some passwors missing), please Check!", fPasswdFilePath.Data()));
+ return 2;
+ }
+
+ return 0;
+
+}
//______________________________________________________________________________________________
UInt_t AliShuttleConfig::SetDetConfig(TList* detList, TList* dcsList)
{
result += "\n";
}
- result += Form("PP time out = %d - max PP mem size = %d KB - max retries = %d "
+ result += Form("PP time out = %d - DCS time out = %d - max PP mem size = %d KB - max retries = %d "
"- DIM trigger waiting timeout = %d\n",
- fPPTimeOut, fPPMaxMem, fMaxRetries, fTriggerWait);
+ fPPTimeOut, fDCSTimeOut, fPPMaxMem, fMaxRetries, fTriggerWait);
result += Form("FLAGS: keepDCSMap = %d - keepTempFolder = %d - SendMail = %d \n",
fKeepDCSMap, fKeepTempFolder, fSendMail);
const TObjArray* shuttleAdmins = GetAdmins(kGlobal);
result += Form("Logbook Configuration \n\n \tHost: %s:%d; \tUser: %s; ",
fDAQlbHost.Data(), fDAQlbPort, fDAQlbUser.Data());
-// result += "Password: ";
-// result.Append('*', fDAQlbPass.Length());
result += Form("\tDB: %s; \tTables: %s, %s, %s\n",
fDAQlbDB.Data(), fDAQlbTable.Data(), fShuttlelbTable.Data(), fRunTypelbTable.Data());
+ result += Form("Terminate file path: %s\n", fTerminateFilePath.Data());
+
result += "\n\n";
result += "------------------------------------------------------\n";
result += "FXS configuration\n\n";
- for(int iSys=0;iSys<3;iSys++){
+ for(int iSys=0;iSys<4;iSys++){
result += Form("*** %s ***\n", AliShuttleInterface::GetSystemName(iSys));
result += Form("\tDB host: %s:%d; \tUser: %s; \tName: %s; \tTable: %s\n",
fFXSdbHost[iSys].Data(), fFXSdbPort[iSys], fFXSdbUser[iSys].Data(),
fFXSdbName[iSys].Data(), fFXSdbTable[iSys].Data());
- // result += Form("DB Password:",fFXSdbPass[iSys].Data());
result += Form("\tFXS host: %s:%d; \tUser: %s\n", fFXSHost[iSys].Data(), fFXSPort[iSys],
fFXSUser[iSys].Data());
- // result += Form("FXS Password:",fFXSPass[iSys].Data());
const TObjArray* fxsAdmins = GetAdmins(iSys);
if (fxsAdmins->GetEntries() != 0)
{