String output;
String long_output;
String perfdata;
+ String check_source;
double schedule_end = -1;
String check_period_str;
output = output_bag->Get("output");
long_output = output_bag->Get("long_output");
+ check_source = cr->Get("check_source");
+
perfdata = GetCheckResultPerfdata(cr);
schedule_end = cr->Get("schedule_end");
}
attr->Set("plugin_output", output);
attr->Set("long_plugin_output", long_output);
attr->Set("performance_data", perfdata);
+ attr->Set("check_source", check_source);
attr->Set("check_type", (service->GetEnableActiveChecks() ? 1 : 0));
attr->Set("last_check", schedule_end);
attr->Set("next_check", service->GetNextCheck());
attr->Set("next_notification", next_notification);
attr->Set("current_notification_number", notification_number);
- String authority = service->GetCheckResultAuthority();
- if (!authority.IsEmpty())
- attr->Set("check_source", authority);
-
return attr;
}
if (!cr->Contains("execution_end"))
cr->Set("execution_end", now);
+ if (!cr->Contains("check_source"))
+ cr->Set("check_source", authority);
+
bool reachable = IsReachable();
Host::Ptr host = GetHost();
olock.Lock();
SetLastCheckResult(cr);
- if (!authority.IsEmpty())
- SetCheckResultAuthority(authority);
-
bool was_flapping, is_flapping;
was_flapping = IsFlapping();
return parents;
}
-void Service::SetCheckResultAuthority(const String& authority)
-{
- m_CheckResultAuthority = authority;
-}
-
-String Service::GetCheckResultAuthority(void) const
-{
- if (m_CheckResultAuthority.IsEmpty())
- return "(i2 local)";
- else
- return m_CheckResultAuthority;
-}
-
bool Service::ResolveMacro(const String& macro, const Dictionary::Ptr& cr, String *result) const
{
if (macro == "SERVICEDESC") {
void AcknowledgeProblem(const String& author, const String& comment, AcknowledgementType type, double expiry = 0, const String& authority = String());
void ClearAcknowledgement(const String& authority = String());
- void SetCheckResultAuthority(const String& authority);
- String GetCheckResultAuthority(void) const;
-
/* Checks */
shared_ptr<CheckCommand> GetCheckCommand(void) const;
long GetMaxCheckAttempts(void) const;
Value m_AcknowledgementExpiry;
String m_HostName;
Value m_Volatile;
- String m_CheckResultAuthority;
/* Checks */
String m_CheckCommand;