- List of SHUTTLE, Amanda and FXS sytem administrators, to whom email is sent in case of running problems;
- sendMail flag (1/0), to switch on/off sending of emails in case of running problems;
- keepDCSMap flag (1/0), to keep DCS map in the Shuttle temp folder also in case of successful processing
- keepTempFolder flag (1/0), to keep temporary folders on the Shuttle machine also in case of successful processing
/*
$Log$
+Revision 1.82 2007/12/20 16:29:43 jgrosseo
+sending number of open runs also at the end of processing
+
Revision 1.81 2007/12/20 14:24:59 jgrosseo
Do not increase count in case of StoreError
if (success) // Preprocessor finished successfully!
{
- // remove temporary folder
- // temporary commented (JF)
- //gSystem->Exec(Form("rm -rf %s",tmpDir.Data()));
+ // remove temporary folder or DCS map
+ if (!fConfig->KeepTempFolder())
+ {
+ gSystem->Exec(Form("rm -rf %s",tmpDir.Data()));
+ } else if (!fConfig->KeepDCSMap())
+ {
+ gSystem->Exec(Form("rm -f %s/DCSMap.root",tmpDir.Data()));
+ }
// Update time_processed field in FXS DB
if (UpdateTable() == kFALSE)
" Sending mail to DCS experts!", host.Data()));
UpdateShuttleStatus(AliShuttleStatus::kDCSError);
- //if (!SendMailToDCS())
- // Log("SHUTTLE", Form("ProcessCurrentDetector - Could not send mail to DCS experts!"));
+ if (!SendMailToDCS())
+ Log("SHUTTLE", Form("ProcessCurrentDetector - "
+ "Could not send mail to DCS experts!"));
delete dcsMap;
return kFALSE;
" Sending mail to DCS experts!", host.Data()));
UpdateShuttleStatus(AliShuttleStatus::kDCSError);
- //if (!SendMailToDCS())
- // Log("SHUTTLE", Form("ProcessCurrentDetector - Could not send mail to DCS experts!"));
+ if (!SendMailToDCS())
+ Log("SHUTTLE", Form("ProcessCurrentDetector - "
+ "Could not send mail to DCS experts!"));
if (aliasMap) delete aliasMap;
delete dcsMap;
if (fTestMode != kNone)
return kTRUE;
+
+ if (!fConfig->SendMail()) return kTRUE;
TString to="";
TIter iterExperts(fConfig->GetResponsibles(fCurrentDetector));
AliDebug(2, Form("to: %s",to.Data()));
if (to.IsNull()) {
- Log("SHUTTLE", "List of detector responsibles not yet set!");
+ Log("SHUTTLE", "List of detector responsibles not set!");
return kFALSE;
}
return kFALSE;
}
- TString cc="alberto.colla@cern.ch";
+ TString cc="";
+ TIter iterAdmins(fConfig->GetAdmins(AliShuttleConfig::kGlobal));
+ TObjString *anAdmin=0;
+ while ((anAdmin = (TObjString*) iterAdmins.Next()))
+ {
+ cc += Form("%s,", anAdmin->GetName());
+ }
+ if (cc.Length() > 0)
+ cc.Remove(to.Length()-1);
+ AliDebug(2, Form("cc: %s",to.Data()));
TString subject = Form("%s Shuttle preprocessor FAILED in run %d (run type = %s)!",
fCurrentDetector.Data(), GetCurrentRun(), GetRunType());
Bool_t AliShuttle::SendMailToDCS()
{
//
- // sends a mail to the DCS experts in case of DCS error
+ // sends a mail to the DCS Amanda experts in case of DCS data point retrieval error
//
if (fTestMode != kNone)
return kTRUE;
+ if (!fConfig->SendMail()) return kTRUE;
+
void* dir = gSystem->OpenDirectory(GetShuttleLogDir());
if (dir == NULL)
{
return kFALSE;
}
- TString to="Vladimir.Fekete@cern.ch, Svetozar.Kapusta@cern.ch";
- //TString to="alberto.colla@cern.ch";
+ TString to="";
+ TIter iterExperts(fConfig->GetAdmins(AliShuttleConfig::kAmanda));
+ TObjString *anExpert=0;
+ while ((anExpert = (TObjString*) iterExperts.Next()))
+ {
+ to += Form("%s,", anExpert->GetName());
+ }
+ if (to.Length() > 0)
+ to.Remove(to.Length()-1);
AliDebug(2, Form("to: %s",to.Data()));
if (to.IsNull()) {
- Log("SHUTTLE", "List of detector responsibles not yet set!");
+ Log("SHUTTLE", "List of Amanda server administrators not set!");
return kFALSE;
}
- TString cc="alberto.colla@cern.ch";
+ TString cc="";
+ TIter iterAdmins(fConfig->GetAdmins(AliShuttleConfig::kGlobal));
+ TObjString *anAdmin=0;
+ while ((anAdmin = (TObjString*) iterAdmins.Next()))
+ {
+ cc += Form("%s,", anAdmin->GetName());
+ }
+ if (cc.Length() > 0)
+ cc.Remove(to.Length()-1);
+ AliDebug(2, Form("cc: %s",to.Data()));
TString subject = Form("Retrieval of data points for %s FAILED in run %d !",
fCurrentDetector.Data(), GetCurrentRun());
/*
$Log$
+Revision 1.27 2007/12/17 03:23:32 jgrosseo
+several bugfixes
+added "empty preprocessor" as placeholder for Acorde in FDR
+
Revision 1.26 2007/12/07 19:14:36 acolla
in AliShuttleTrigger:
ExpandAndAdd(fDCSDataPoints, aDataPoint);
}
}
-
+
fIsValid = kTRUE;
}
fRunMode(kTest),
fDetectorMap(),
fDetectorList(),
+ fAdmin(),
fShuttleInstanceHost(""),
fProcessedDetectors(),
+ fKeepDCSMap(kFALSE),
+ fKeepTempFolder(kFALSE),
+ fSendMail(kFALSE),
fProcessAll(kFALSE),
fIsValid(kFALSE)
+
{
//
// host: ldap server host
fDetectorMap.SetOwner(1);
fDetectorList.SetOwner(0); //fDetectorList and fDetectorMap share the same object!
fProcessedDetectors.SetOwner();
+
+ for (int i=0; i<5; i++)
+ {
+ fAdmin[i] = new TObjArray();
+ fAdmin[i]->SetOwner();
+ }
TLDAPServer aServer(host, port, binddn, password, 3);
fDetectorMap.DeleteAll();
fDetectorList.Clear();
fProcessedDetectors.Delete();
+
+ delete[] fAdmin;
+
}
//______________________________________________________________________________________________
return aHolder->GetResponsibles();
}
+//______________________________________________________________________________________________
+const TObjArray* AliShuttleConfig::GetAdmins(Int_t sys) const
+{
+ //
+ // returns collection of TObjString which represents the list of mail addresses
+ // of the system's administrator(s) (DAQ, DCS, HLT, Global, Amanda)
+ //
+
+ if (sys < 0 || sys > 4) return 0;
+ return fAdmin[sys];
+}
+
//______________________________________________________________________________________________
Bool_t AliShuttleConfig::HostProcessDetector(const char* detector) const
{
AliWarning("Valid run modes are \"test\" and \"prod\". Running in test mode.");
}
}
-
+
+ anAttribute = anEntry->GetAttribute("keepDCSMap"); // MAY
+ if (!anAttribute)
+ {
+ AliWarning("keepDCSMap flag not set - default is FALSE");
+ } else {
+ TString keepDCSMapStr = anAttribute->GetValue();
+ if (!(keepDCSMapStr == "0" || keepDCSMapStr == "1"))
+ {
+ AliError("keepDCSMap flag must be 0 or 1!");
+ return 4;
+ }
+ fKeepDCSMap = (Bool_t) keepDCSMapStr.Atoi();
+ }
+
+ anAttribute = anEntry->GetAttribute("keepTempFolder"); // MAY
+ if (!anAttribute)
+ {
+ AliWarning("keepTempFolder flag not set - default is FALSE");
+ } else {
+ TString keepTempFolderStr = anAttribute->GetValue();
+ if (!(keepTempFolderStr == "0" || keepTempFolderStr == "1"))
+ {
+ AliError("keepTempFolder flag must be 0 or 1!");
+ return 4;
+ }
+ fKeepTempFolder = (Bool_t) keepTempFolderStr.Atoi();
+ }
+
+
+ anAttribute = anEntry->GetAttribute("shuttleAdmin"); // MAY
+ if (!anAttribute)
+ {
+ AliDebug(2, "Warning! No \"shuttleAdmin\" attribute!");
+ }
+ else
+ {
+ const char* anAdmin;
+ while ((anAdmin = anAttribute->GetValue()))
+ {
+ fAdmin[kGlobal]->AddLast(new TObjString(anAdmin));
+ }
+ }
+
+ anAttribute = anEntry->GetAttribute("amandaAdmin"); // MAY
+ if (!anAttribute)
+ {
+ AliDebug(2, "Warning! No \"amandaAdmin\" attribute!");
+ }
+ else
+ {
+ const char* anAdmin;
+ while ((anAdmin = anAttribute->GetValue()))
+ {
+ fAdmin[kAmanda]->AddLast(new TObjString(anAdmin));
+ }
+ }
+
+ anAttribute = anEntry->GetAttribute("sendMail"); // MAY
+ if (!anAttribute)
+ {
+ AliWarning("sendMail flag not set - default is FALSE");
+ } else {
+ TString sendMailStr = anAttribute->GetValue();
+ if (!(sendMailStr == "0" || sendMailStr == "1"))
+ {
+ AliError("sendMail flag must be 0 or 1!");
+ return 4;
+ }
+ fSendMail = (Bool_t) sendMailStr.Atoi();
+ }
+
return 0;
}
}
TIter iter(list);
- Int_t iSys=0, count = 0;
+ Int_t count = 0;
+ SystemCode iSys=kDAQ;
+
while ((anEntry = dynamic_cast<TLDAPEntry*> (iter.Next())))
{
anAttribute = anEntry->GetAttribute("system");
if (sysName == "DAQ")
{
- iSys = 0;
+ iSys = kDAQ;
count += 1;
}
else if (sysName == "DCS")
{
- iSys = 1;
+ iSys = kDCS;
count += 10;
}
else if (sysName == "HLT")
{
- iSys = 2;
+ iSys = kHLT;
count += 100;
}
anAttribute = anEntry->GetAttribute("fxsPasswd");
if (anAttribute) fFXSPass[iSys] = anAttribute->GetValue();
+
+ anAttribute = anEntry->GetAttribute("fxsAdmin"); // MAY
+ if (!anAttribute)
+ {
+ AliDebug(2, "Warning! No \"fxsAdmin\" attribute!");
+ }
+ else
+ {
+ const char* anAdmin;
+ while ((anAdmin = anAttribute->GetValue()))
+ {
+ fAdmin[iSys]->AddLast(new TObjString(anAdmin));
+ }
+ }
+
}
if(count != 111) {
}
result += Form("PP time out = %d - max PP mem size = %d KB - max retries = %d "
- "- DIM trigger waiting timeout = %d\n\n",
+ "- DIM trigger waiting timeout = %d\n",
fPPTimeOut, fPPMaxMem, fMaxRetries, fTriggerWait);
+ result += Form("FLAGS: keepDCSMap = %d - keepTempFolder = %d - SendMail = %d \n",
+ fKeepDCSMap, fKeepTempFolder, fSendMail);
+ const TObjArray* shuttleAdmins = GetAdmins(kGlobal);
+ if (shuttleAdmins->GetEntries() != 0)
+ {
+ result += "SHUTTLE administrator(s): ";
+ TIter it(shuttleAdmins);
+ TObjString* anAdmin;
+ while ((anAdmin = (TObjString*) it.Next()))
+ {
+ result += Form("%s ", anAdmin->String().Data());
+ }
+ result += "\n";
+ }
+ const TObjArray* amandaAdmins = GetAdmins(kAmanda);
+ if (amandaAdmins->GetEntries() != 0)
+ {
+ result += "Amanda server administrator(s): ";
+ TIter it(amandaAdmins);
+ TObjString* anAdmin;
+ while ((anAdmin = (TObjString*) it.Next()))
+ {
+ result += Form("%s ", anAdmin->String().Data());
+ }
+ result += "\n\n";
+ }
result += "------------------------------------------------------\n";
result += Form("Logbook Configuration \n\n \tHost: %s:%d; \tUser: %s; ",
fDAQlbDB.Data(), fDAQlbTable.Data(), fShuttlelbTable.Data(), fRunTypelbTable.Data());
result += "\n\n";
-
+
result += "------------------------------------------------------\n";
result += "FXS configuration\n\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\n", fFXSHost[iSys].Data(), fFXSPort[iSys],
+ 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)
+ {
+ result += "\tAdministrator(s): ";
+ TIter it(fxsAdmins);
+ TObjString* anAdmin;
+ while ((anAdmin = (TObjString*) it.Next()))
+ {
+ result += Form("%s ", anAdmin->String().Data());
+ }
+ result += "\n\n";
+ }
}
result += "------------------------------------------------------\n";
fMonitorHost.Data(), fMonitorTable.Data());
result += "\n\n";
-
+
TString optStr(option);
result += "------------------------------------------------------\n";
class AliShuttleConfig: public TObject {
public:
enum RunMode {kTest=0, kProd};
+ enum SystemCode { kDAQ = 0, kDCS, kHLT, kGlobal, kAmanda };
AliShuttleConfig(const char* host, Int_t port = LDAP_PORT,
const char* binddn = 0, const char* password = 0,
const char* GetShuttlelbTable() const {return fShuttlelbTable.Data();}
const char* GetRunTypelbTable() const {return fRunTypelbTable.Data();}
- const char* GetFXSHost(Int_t system) const {return fFXSHost[system].Data();}
- UInt_t GetFXSPort(Int_t system) const {return fFXSPort[system];}
- const char* GetFXSUser(Int_t system) const {return fFXSUser[system].Data();}
- const char* GetFXSPass(Int_t system) const {return fFXSPass[system].Data();}
+ const char* GetFXSHost(Int_t sys) const {return fFXSHost[sys].Data();}
+ UInt_t GetFXSPort(Int_t sys) const {return fFXSPort[sys];}
+ const char* GetFXSUser(Int_t sys) const {return fFXSUser[sys].Data();}
+ const char* GetFXSPass(Int_t sys) const {return fFXSPass[sys].Data();}
- const char* GetFXSdbHost(Int_t system) const {return fFXSdbHost[system].Data();}
- UInt_t GetFXSdbPort(Int_t system) const {return fFXSdbPort[system];}
- const char* GetFXSdbUser(Int_t system) const {return fFXSdbUser[system].Data();}
- const char* GetFXSdbPass(Int_t system) const {return fFXSdbPass[system].Data();}
- const char* GetFXSdbName(Int_t system) const {return fFXSdbName[system].Data();}
- const char* GetFXSdbTable(Int_t system) const {return fFXSdbTable[system].Data();}
+ const char* GetFXSdbHost(Int_t sys) const {return fFXSdbHost[sys].Data();}
+ UInt_t GetFXSdbPort(Int_t sys) const {return fFXSdbPort[sys];}
+ const char* GetFXSdbUser(Int_t sys) const {return fFXSdbUser[sys].Data();}
+ const char* GetFXSdbPass(Int_t sys) const {return fFXSdbPass[sys].Data();}
+ const char* GetFXSdbName(Int_t sys) const {return fFXSdbName[sys].Data();}
+ const char* GetFXSdbTable(Int_t sys) const {return fFXSdbTable[sys].Data();}
+ const TObjArray* GetAdmins(Int_t sys) const;
+
+ Bool_t SendMail() const { return fSendMail; }
+
Int_t GetMaxRetries() const { return fMaxRetries; }
Int_t GetPPTimeOut() const { return fPPTimeOut; }
Int_t GetPPMaxMem() const { return fPPMaxMem; }
+
+ Bool_t KeepDCSMap() const { return fKeepDCSMap; }
+ Bool_t KeepTempFolder() const { return fKeepTempFolder; }
+
const char* GetMonitorHost() const {return fMonitorHost.Data();}
const char* GetMonitorTable() const {return fMonitorTable.Data();}
TMap fDetectorMap; // Map of the detector-by-detector configuration
TObjArray fDetectorList; // List of detectors with valid configuration
+
+ TObjArray *fAdmin[4]; // Array of system administrators' email addresses (DAQ, DCS, HLT, Global, Amanda)
TString fShuttleInstanceHost; // Instance of the SHUTTLE
TObjArray fProcessedDetectors; // list of the detector to be processed by this machine
+
+ Bool_t fKeepDCSMap; // Flag to keep DCS map also in case of success
+ Bool_t fKeepTempFolder; // Flag to keep temp folder also in case of success
+
+ Bool_t fSendMail; // Send mail flag
+
Bool_t fProcessAll; // flag indicating that all detectors will be processed
Bool_t fIsValid; // flag for the validity of the configuration
fxsHost: aldaqgw01-gpn.cern.ch
fxsPort: 1443
fxsUser: shuttle_test_rw
-
+fxsAdmin: sylvain.chapeland@cern.ch
\ No newline at end of file
dbTable: dcsfes
fxsHost: aldcs030.cern.ch
fxsUser: sshd
-
+fxsAdmin: peter.chochula@cern.ch
monitorTable: SHUTTLE
triggerWait: 10
mode: test
+keepDCSMap: 0
+keepTempFolder: 0
+shuttleAdmin: alberto.colla@cern.ch
+shuttleAdmin: Jan.Fiete.Grosse-Oetringhaus@cern.ch
+amandaAdmin: svetozar.kapusta@cern.ch
+sendMail: 1
\ No newline at end of file
dbHost: alihlt-shuttle1.cern.ch
fxsHost: alihlt-shuttle1.cern.ch
fxsUser: hlt-fxs
-
+fxsAdmin: sebastian.bablok@cern.ch
attributetype ( FXS_CONFIG:9 NAME 'fxsPort' DESC 'FXS port' SUP ipServicePort SINGLE-VALUE )
attributetype ( FXS_CONFIG:10 NAME 'fxsUser' DESC 'FXS user' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
attributetype ( FXS_CONFIG:11 NAME 'fxsPasswd' DESC 'FXS Password' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( FXS_CONFIG:12 NAME 'fxsAdmin' DESC 'FXS admin(s) email address' EQUALITY caseIgnoreIA5Match SUP mail )
objectclass ( FXS_CONFIG
NAME 'fxsConfig'
DESC 'ALICE: Configuration of the Shuttle for access to the File Exchange Servers'
SUP top
MUST (system $ dbHost $ dbUser $ dbPasswd $ dbName $ dbTable $ fxsHost $ fxsUser )
- MAY ( dbPort $ fxsPasswd $ fxsPort) )
+ MAY ( dbPort $ fxsPasswd $ fxsPort $ fxsAdmin) )
objectidentifier GLOBAL_CONFIG SHUTTLE_BASE:4
attributetype ( GLOBAL_CONFIG:14 NAME 'triggerWait' DESC 'max time waiting for next trigger before starting a new collection'
EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
attributetype ( GLOBAL_CONFIG:15 NAME 'mode' DESC 'production mode (test, prod)' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:16 NAME 'shuttleAdmin' DESC 'SHUTTLE administrator(s) email address' EQUALITY caseIgnoreIA5Match SUP mail )
+attributetype ( GLOBAL_CONFIG:17 NAME 'amandaAdmin' DESC 'Amanda admin(s) email address' EQUALITY caseIgnoreIA5Match SUP mail )
+
+attributetype ( GLOBAL_CONFIG:18 NAME 'sendMail' DESC 'Send email flag (1/0)' EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:19 NAME 'keepDCSMap' DESC 'keep DCS map flag (1/0)' EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:20 NAME 'keepTempFolder' DESC 'keep temp folder flag (1/0)' EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
objectclass ( GLOBAL_CONFIG
NAME 'globalConfig'
DESC 'ALICE: settings for DAQ logbook access'
SUP top
MUST (name $ daqLbHost $ daqLbUser $ daqLbPasswd $ daqLbDB $ daqLbTable $ shuttleLbTable $ runTypeLbTable $ ppMaxRetries $ ppTimeOut $ ppMaxMem $ monitorHost $ monitorTable)
- MAY ( daqLbPort $ triggerWait $ mode) )
+ MAY ( daqLbPort $ triggerWait $ mode $ keepDCSMap $ keepTempFolder $ shuttleAdmin $ amandaAdmin $ sendMail) )
objectidentifier INSTANCE_CONFIG SHUTTLE_BASE:5