mirror of https://github.com/Icinga/icinga2.git
parent
9d07ffc5c2
commit
e07183d481
|
@ -334,6 +334,7 @@ void StatusDataWriter::DumpServiceStatusAttrs(std::ostream& fp, const Service::P
|
||||||
<< "\t" << "plugin_output=" << attrs->Get("plugin_output") << "\n"
|
<< "\t" << "plugin_output=" << attrs->Get("plugin_output") << "\n"
|
||||||
<< "\t" << "long_plugin_output=" << attrs->Get("long_plugin_output") << "\n"
|
<< "\t" << "long_plugin_output=" << attrs->Get("long_plugin_output") << "\n"
|
||||||
<< "\t" << "performance_data=" << attrs->Get("performance_data") << "\n"
|
<< "\t" << "performance_data=" << attrs->Get("performance_data") << "\n"
|
||||||
|
<< "\t" << "check_source=" << attrs->Get("check_source") << "\n"
|
||||||
<< "\t" << "last_check=" << static_cast<long>(attrs->Get("last_check")) << "\n"
|
<< "\t" << "last_check=" << static_cast<long>(attrs->Get("last_check")) << "\n"
|
||||||
<< "\t" << "next_check=" << static_cast<long>(attrs->Get("next_check")) << "\n"
|
<< "\t" << "next_check=" << static_cast<long>(attrs->Get("next_check")) << "\n"
|
||||||
<< "\t" << "current_attempt=" << attrs->Get("current_attempt") << "\n"
|
<< "\t" << "current_attempt=" << attrs->Get("current_attempt") << "\n"
|
||||||
|
|
|
@ -285,6 +285,10 @@ Dictionary::Ptr CompatUtility::GetServiceStatusAttributes(const Service::Ptr& se
|
||||||
attr->Set("next_notification", next_notification);
|
attr->Set("next_notification", next_notification);
|
||||||
attr->Set("current_notification_number", notification_number);
|
attr->Set("current_notification_number", notification_number);
|
||||||
|
|
||||||
|
String authority = service->GetCheckResultAuthority();
|
||||||
|
if (!authority.IsEmpty())
|
||||||
|
attr->Set("check_source", authority);
|
||||||
|
|
||||||
return attr;
|
return attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -603,6 +603,9 @@ void Service::ProcessCheckResult(const Dictionary::Ptr& cr, const String& author
|
||||||
olock.Lock();
|
olock.Lock();
|
||||||
SetLastCheckResult(cr);
|
SetLastCheckResult(cr);
|
||||||
|
|
||||||
|
if (!authority.IsEmpty())
|
||||||
|
SetCheckResultAuthority(authority);
|
||||||
|
|
||||||
bool was_flapping, is_flapping;
|
bool was_flapping, is_flapping;
|
||||||
|
|
||||||
was_flapping = IsFlapping();
|
was_flapping = IsFlapping();
|
||||||
|
|
|
@ -328,6 +328,19 @@ std::set<Service::Ptr> Service::GetParentServices(void) const
|
||||||
return parents;
|
return parents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Service::SetCheckResultAuthority(const String& authority)
|
||||||
|
{
|
||||||
|
m_CheckResultAuthority = authority;
|
||||||
|
}
|
||||||
|
|
||||||
|
String Service::GetCheckResultAuthority(void) const
|
||||||
|
{
|
||||||
|
if (m_CheckResultAuthority.IsEmpty())
|
||||||
|
return "(local)";
|
||||||
|
else
|
||||||
|
return m_CheckResultAuthority;
|
||||||
|
}
|
||||||
|
|
||||||
bool Service::ResolveMacro(const String& macro, const Dictionary::Ptr& cr, String *result) const
|
bool Service::ResolveMacro(const String& macro, const Dictionary::Ptr& cr, String *result) const
|
||||||
{
|
{
|
||||||
if (macro == "SERVICEDESC") {
|
if (macro == "SERVICEDESC") {
|
||||||
|
|
|
@ -142,6 +142,9 @@ public:
|
||||||
void AcknowledgeProblem(const String& author, const String& comment, AcknowledgementType type, double expiry = 0, const String& authority = String());
|
void AcknowledgeProblem(const String& author, const String& comment, AcknowledgementType type, double expiry = 0, const String& authority = String());
|
||||||
void ClearAcknowledgement(const String& authority = String());
|
void ClearAcknowledgement(const String& authority = String());
|
||||||
|
|
||||||
|
void SetCheckResultAuthority(const String& authority);
|
||||||
|
String GetCheckResultAuthority(void) const;
|
||||||
|
|
||||||
/* Checks */
|
/* Checks */
|
||||||
shared_ptr<CheckCommand> GetCheckCommand(void) const;
|
shared_ptr<CheckCommand> GetCheckCommand(void) const;
|
||||||
long GetMaxCheckAttempts(void) const;
|
long GetMaxCheckAttempts(void) const;
|
||||||
|
@ -352,6 +355,7 @@ private:
|
||||||
Value m_AcknowledgementExpiry;
|
Value m_AcknowledgementExpiry;
|
||||||
String m_HostName;
|
String m_HostName;
|
||||||
Value m_Volatile;
|
Value m_Volatile;
|
||||||
|
String m_CheckResultAuthority;
|
||||||
|
|
||||||
/* Checks */
|
/* Checks */
|
||||||
String m_CheckCommand;
|
String m_CheckCommand;
|
||||||
|
|
Loading…
Reference in New Issue