mirror of https://github.com/Icinga/icinga2.git
Store the last failed zone stage sync validation as runtime ApiListener attribute
This commit is contained in:
parent
a91bbe8acd
commit
fb367e12cc
|
@ -385,7 +385,12 @@ void ApiListener::TryActivateZonesStageCallback(const ProcessResult& pr,
|
||||||
} else {
|
} else {
|
||||||
Log(LogCritical, "ApiListener")
|
Log(LogCritical, "ApiListener")
|
||||||
<< "Config validation failed for staged cluster config sync. Aborting. Logs: '"
|
<< "Config validation failed for staged cluster config sync. Aborting. Logs: '"
|
||||||
<< GetApiZonesStageDir() + "/startup.log'";
|
<< logFile << "'";
|
||||||
|
|
||||||
|
ApiListener::Ptr listener = ApiListener::GetInstance();
|
||||||
|
|
||||||
|
if (listener)
|
||||||
|
listener->UpdateLastFailedZonesStageValidation(pr.Output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -416,3 +421,13 @@ void ApiListener::AsyncTryActivateZonesStage(const String& stageConfigDir, const
|
||||||
process->SetTimeout(300);
|
process->SetTimeout(300);
|
||||||
process->Run(std::bind(&TryActivateZonesStageCallback, _1, stageConfigDir, currentConfigDir, relativePaths, reload));
|
process->Run(std::bind(&TryActivateZonesStageCallback, _1, stageConfigDir, currentConfigDir, relativePaths, reload));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ApiListener::UpdateLastFailedZonesStageValidation(const String& log)
|
||||||
|
{
|
||||||
|
Dictionary::Ptr lastFailedZonesStageValidation = new Dictionary({
|
||||||
|
{ "log", log },
|
||||||
|
{ "ts", Utility::GetTime() }
|
||||||
|
});
|
||||||
|
|
||||||
|
SetLastFailedZonesStageValidation(lastFailedZonesStageValidation);
|
||||||
|
}
|
||||||
|
|
|
@ -187,6 +187,8 @@ private:
|
||||||
static void AsyncTryActivateZonesStage(const String& stageConfigDir, const String& currentConfigDir,
|
static void AsyncTryActivateZonesStage(const String& stageConfigDir, const String& currentConfigDir,
|
||||||
const std::vector<String>& relativePaths, bool reload);
|
const std::vector<String>& relativePaths, bool reload);
|
||||||
|
|
||||||
|
void UpdateLastFailedZonesStageValidation(const String& log);
|
||||||
|
|
||||||
/* configsync */
|
/* configsync */
|
||||||
void UpdateConfigObject(const ConfigObject::Ptr& object, const MessageOrigin::Ptr& origin,
|
void UpdateConfigObject(const ConfigObject::Ptr& object, const MessageOrigin::Ptr& origin,
|
||||||
const JsonRpcConnection::Ptr& client = nullptr);
|
const JsonRpcConnection::Ptr& client = nullptr);
|
||||||
|
|
|
@ -54,6 +54,8 @@ class ApiListener : ConfigObject
|
||||||
[state, no_user_modify] Timestamp log_message_timestamp;
|
[state, no_user_modify] Timestamp log_message_timestamp;
|
||||||
|
|
||||||
[no_user_modify] String identity;
|
[no_user_modify] String identity;
|
||||||
|
|
||||||
|
[state, no_user_modify] Dictionary::Ptr last_failed_zones_stage_validation;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue