|
|
|
|
|
|
|
|
std::string
|
|
|
std::string
|
|
|
UtilityConfig::GetStatusSecondLogFileName(void) {
|
|
|
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) {
|
|
|
if (CFGData.Scan_XML_Mode) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string
|
|
|
std::string
|
|
|
UtilityConfig::GetStatusMinuteLogFileName(void) {
|
|
|
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) {
|
|
|
if (CFGData.Scan_XML_Mode) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
string
|
|
|
UtilityConfig::GetIdentityFileName(void) {
|
|
|
UtilityConfig::GetIdentityFileName(void) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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::StatusCheckMethod
|
|
|
UtilityConfig::GetPreferredStatusCheckMethod(void) {
|
|
|
UtilityConfig::GetPreferredStatusCheckMethod(void) {
|
|
|
|
|
|
|