|
|
@@ -280,7 +280,11 @@ UtilityConfig::GetLogPath(void) { |
|
|
|
std::string
|
|
|
|
UtilityConfig::GetStatusSecondLogFileName(void) {
|
|
|
|
|
|
|
|
std::string FileName = CFGData.paths_log_path + CFGData.node_licenseid + ".status.second.log";
|
|
|
|
std::string FileName = CFGData.paths_log_path + CFGData.node_licenseid + ".status.second";
|
|
|
|
|
|
|
|
AppendDatestampToLogFileName(&FileName);
|
|
|
|
|
|
|
|
FileName += ".log";
|
|
|
|
|
|
|
|
if (CFGData.Scan_XML_Mode) {
|
|
|
|
|
|
|
@@ -295,7 +299,11 @@ UtilityConfig::GetStatusSecondLogFileName(void) { |
|
|
|
std::string
|
|
|
|
UtilityConfig::GetStatusMinuteLogFileName(void) {
|
|
|
|
|
|
|
|
std::string FileName = CFGData.paths_log_path + CFGData.node_licenseid + ".status.minute.log";
|
|
|
|
std::string FileName = CFGData.paths_log_path + CFGData.node_licenseid + ".status.minute";
|
|
|
|
|
|
|
|
AppendDatestampToLogFileName(&FileName);
|
|
|
|
|
|
|
|
FileName += ".log";
|
|
|
|
|
|
|
|
if (CFGData.Scan_XML_Mode) {
|
|
|
|
|
|
|
@@ -307,6 +315,41 @@ UtilityConfig::GetStatusMinuteLogFileName(void) { |
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
UtilityConfig::AppendDatestampToLogFileName(std::string *FileBaseName) {
|
|
|
|
|
|
|
|
|
|
|
|
if (CFGData.Scan_XML_Rotate ||
|
|
|
|
CFGData.Status_MinuteReport_Append_OnOff ||
|
|
|
|
CFGData.Status_SecondReport_Append_OnOff) {
|
|
|
|
char TimestampBuffer[20];
|
|
|
|
tm *BrokenDownTime;
|
|
|
|
time_t Timestamp;
|
|
|
|
|
|
|
|
time(&Timestamp);
|
|
|
|
|
|
|
|
if (CFGData.Logs_Rotation_LocalTime_OnOff) {
|
|
|
|
|
|
|
|
BrokenDownTime = gmtime(&Timestamp);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
BrokenDownTime = localtime(&Timestamp);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
snprintf(TimestampBuffer, sizeof TimestampBuffer, "%04d%02d%02d",
|
|
|
|
BrokenDownTime->tm_year+1900,
|
|
|
|
BrokenDownTime->tm_mon+1,
|
|
|
|
BrokenDownTime->tm_mday);
|
|
|
|
|
|
|
|
*FileBaseName += ".";
|
|
|
|
*FileBaseName += TimestampBuffer;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
string
|
|
|
|
UtilityConfig::GetIdentityFileName(void) {
|
|
|
|
|
|
|
@@ -393,6 +436,23 @@ UtilityConfig::LoadInfo(){ |
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
UtilityConfig::LoadCredentials(void) {
|
|
|
|
|
|
|
|
if(0 < CFGData.node_identity.length()) { // If an identity path was provided
|
|
|
|
ConfigurationData Identity(CFGData.node_identity.c_str()); // then get the data from that file.
|
|
|
|
ConfigurationElement IdentityReader("snf"); // Create an Identity reader and
|
|
|
|
IdentityReader // configure it.
|
|
|
|
.Element("identity")
|
|
|
|
.Attribute("licenseid", CFGData.node_licenseid)
|
|
|
|
.Attribute("authentication", CFGData.node_authentication)
|
|
|
|
.End("identity")
|
|
|
|
.End("snf");
|
|
|
|
IdentityReader.interpret(Identity); // Then read the data.
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
UtilityConfig::StatusCheckMethod
|
|
|
|
UtilityConfig::GetPreferredStatusCheckMethod(void) {
|
|
|
|
|