DECLARE_PTR_TYPEDEFS(CheckResultReader);
DECLARE_TYPENAME(CheckResultReader);
- static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
+ static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
protected:
virtual void Start(void);
author_comment = author + ";" + comment_text;
}
- if (!cr)
- return;
+ if (!cr)
+ return;
String output;
if (cr)
output = CompatUtility::GetCheckResultOutput(cr);
- std::ostringstream msgbuf;
+ std::ostringstream msgbuf;
if (service) {
msgbuf << "SERVICE NOTIFICATION: "
<< author_comment
<< "";
} else {
- msgbuf << "HOST NOTIFICATION: "
+ msgbuf << "HOST NOTIFICATION: "
<< user->GetName() << ";"
- << host->GetName() << ";"
- << notification_type_str << " "
+ << host->GetName() << ";"
+ << notification_type_str << " "
<< "(" << (host->IsReachable() ? Host::StateToString(host->GetState()) : "UNREACHABLE") << ");"
<< command_name << ";"
<< output << ";"
<< author_comment
- << "";
+ << "";
}
{
ObjectLock oLock(this);
WriteLine(msgbuf.str());
- Flush();
- }
+ Flush();
+ }
}
/**
return;
}
- std::ostringstream msgbuf;
+ std::ostringstream msgbuf;
if (service) {
msgbuf << "SERVICE FLAPPING ALERT: "
<< flapping_output
<< "";
} else {
- msgbuf << "HOST FLAPPING ALERT: "
- << host->GetName() << ";"
- << flapping_state_str << "; "
- << flapping_output
- << "";
+ msgbuf << "HOST FLAPPING ALERT: "
+ << host->GetName() << ";"
+ << flapping_state_str << "; "
+ << flapping_output
+ << "";
}
{
ObjectLock oLock(this);
WriteLine(msgbuf.str());
- Flush();
- }
+ Flush();
+ }
}
void CompatLogger::ExternalCommandHandler(const String& command, const std::vector<String>& arguments)
{
- std::ostringstream msgbuf;
- msgbuf << "EXTERNAL COMMAND: "
- << command << ";"
- << boost::algorithm::join(arguments, ";")
- << "";
-
- {
- ObjectLock oLock(this);
- WriteLine(msgbuf.str());
- }
+ std::ostringstream msgbuf;
+ msgbuf << "EXTERNAL COMMAND: "
+ << command << ";"
+ << boost::algorithm::join(arguments, ";")
+ << "";
+
+ {
+ ObjectLock oLock(this);
+ WriteLine(msgbuf.str());
+ }
}
void CompatLogger::EventCommandHandler(const Checkable::Ptr& checkable)
String event_command_name = event_command->GetName();
long current_attempt = checkable->GetCheckAttempt();
- std::ostringstream msgbuf;
+ std::ostringstream msgbuf;
if (service) {
msgbuf << "SERVICE EVENT HANDLER: "
<< event_command_name;
} else {
msgbuf << "HOST EVENT HANDLER: "
- << host->GetName() << ";"
+ << host->GetName() << ";"
<< (host->IsReachable() ? Host::StateToString(host->GetState()) : "UNREACHABLE") << ";"
<< Host::StateTypeToString(host->GetStateType()) << ";"
<< current_attempt << ";"
{
ObjectLock oLock(this);
WriteLine(msgbuf.str());
- Flush();
- }
+ Flush();
+ }
}
void CompatLogger::WriteLine(const String& line)
DECLARE_PTR_TYPEDEFS(CompatLogger);
DECLARE_TYPENAME(CompatLogger);
- static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
+ static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
static void ValidateRotationMethod(const String& location, const Dictionary::Ptr& attrs);
void CheckResultHandler(const Checkable::Ptr& service, const CheckResult::Ptr& cr);
void NotificationSentHandler(const Notification::Ptr& notification, const Checkable::Ptr& service,
- const User::Ptr& user, NotificationType const& notification_type, CheckResult::Ptr const& cr,
- const String& author, const String& comment_text, const String& command_name);
+ const User::Ptr& user, NotificationType const& notification_type, CheckResult::Ptr const& cr,
+ const String& author, const String& comment_text, const String& command_name);
void FlappingHandler(const Checkable::Ptr& service, FlappingState flapping_state);
void TriggerDowntimeHandler(const Checkable::Ptr& service, const Downtime::Ptr& downtime);
void RemoveDowntimeHandler(const Checkable::Ptr& service, const Downtime::Ptr& downtime);
{
public:
DECLARE_PTR_TYPEDEFS(ExternalCommandListener);
- DECLARE_TYPENAME(ExternalCommandListener);
+ DECLARE_TYPENAME(ExternalCommandListener);
- static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
+ static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
protected:
virtual void Start(void);
boost::thread m_CommandThread;
void CommandPipeThread(const String& commandPath);
- void ClientHandler(const String& commandPath, int fd);
+ void ClientHandler(const String& commandPath, int fd);
#endif /* _WIN32 */
};
"\t" "host_name" "\t" << host->GetName() << "\n";
if (!display_name.IsEmpty()) {
fp << "\t" "display_name" "\t" << host->GetDisplayName() << "\n"
- "\t" "alias" "\t" << host->GetDisplayName() << "\n";
+ "\t" "alias" "\t" << host->GetDisplayName() << "\n";
}
if (!address.IsEmpty())
fp << "\t" "address" "\t" << address << "\n";
fp << "\t" "host_groups" "\t";
bool first = true;
- Array::Ptr groups = host->GetGroups();
+ Array::Ptr groups = host->GetGroups();
- if (groups) {
- ObjectLock olock(groups);
+ if (groups) {
+ ObjectLock olock(groups);
- BOOST_FOREACH(const String& name, groups) {
- HostGroup::Ptr hg = HostGroup::GetByName(name);
+ BOOST_FOREACH(const String& name, groups) {
+ HostGroup::Ptr hg = HostGroup::GetByName(name);
- if (hg) {
+ if (hg) {
if (!first)
fp << ",";
else
first = false;
fp << hg->GetName();
- }
- }
- }
+ }
+ }
+ }
fp << "\n";
if (cr) {
fp << "\t" << "check_execution_time=" << Convert::ToString(Service::CalculateExecutionTime(cr)) << "\n"
- "\t" "check_latency=" << Convert::ToString(Service::CalculateLatency(cr)) << "\n";
+ "\t" "check_latency=" << Convert::ToString(Service::CalculateLatency(cr)) << "\n";
}
Host::Ptr host;
if (cr) {
fp << "\t" << "check_source=" << cr->GetCheckSource() << "\n"
- "\t" "last_check=" << static_cast<long>(cr->GetScheduleEnd()) << "\n";
+ "\t" "last_check=" << static_cast<long>(cr->GetScheduleEnd()) << "\n";
}
fp << "\t" << "next_check=" << static_cast<long>(checkable->GetNextCheck()) << "\n"
if (eventcommand)
fp << "\t" "event_handler" "\t" << CompatUtility::GetCommandName(eventcommand) << "\n";
- fp << "\t" "contacts" "\t";
- DumpNameList(fp, CompatUtility::GetCheckableNotificationUsers(service));
- fp << "\n";
+ fp << "\t" "contacts" "\t";
+ DumpNameList(fp, CompatUtility::GetCheckableNotificationUsers(service));
+ fp << "\n";
- fp << "\t" "contact_groups" "\t";
- DumpNameList(fp, CompatUtility::GetCheckableNotificationUserGroups(service));
- fp << "\n";
+ fp << "\t" "contact_groups" "\t";
+ DumpNameList(fp, CompatUtility::GetCheckableNotificationUserGroups(service));
+ fp << "\n";
String notes = service->GetNotes();
String notes_url = service->GetNotesUrl();
String icon_image = service->GetIconImage();
String icon_image_alt = service->GetIconImageAlt();
- fp << "\t" "initial_state" "\t" "o" "\n"
- "\t" "low_flap_threshold" "\t" << service->GetFlappingThreshold() << "\n"
- "\t" "high_flap_threshold" "\t" << service->GetFlappingThreshold() << "\n"
- "\t" "process_perf_data" "\t" << CompatUtility::GetCheckableProcessPerformanceData(service) << "\n"
- "\t" "check_freshness" << "\t" "1" "\n";
+ fp << "\t" "initial_state" "\t" "o" "\n"
+ "\t" "low_flap_threshold" "\t" << service->GetFlappingThreshold() << "\n"
+ "\t" "high_flap_threshold" "\t" << service->GetFlappingThreshold() << "\n"
+ "\t" "process_perf_data" "\t" << CompatUtility::GetCheckableProcessPerformanceData(service) << "\n"
+ "\t" "check_freshness" << "\t" "1" "\n";
if (!notes.IsEmpty())
fp << "\t" "notes" "\t" << notes << "\n";
if (!notes_url.IsEmpty())
fp << "\t" "service_groups" "\t";
bool first = true;
- Array::Ptr groups = service->GetGroups();
+ Array::Ptr groups = service->GetGroups();
- if (groups) {
- ObjectLock olock(groups);
+ if (groups) {
+ ObjectLock olock(groups);
- BOOST_FOREACH(const String& name, groups) {
- ServiceGroup::Ptr sg = ServiceGroup::GetByName(name);
+ BOOST_FOREACH(const String& name, groups) {
+ ServiceGroup::Ptr sg = ServiceGroup::GetByName(name);
- if (sg) {
+ if (sg) {
if (!first)
fp << ",";
else
first = false;
fp << sg->GetName();
- }
- }
- }
+ }
+ }
+ }
fp << "\n";
Service::Ptr child_service;
tie(child_host, child_service) = GetHostService(child);
- int state_filter = dep->GetStateFilter();
+ int state_filter = dep->GetStateFilter();
std::vector<String> failure_criteria;
if (state_filter & StateFilterOK || state_filter & StateFilterUp)
failure_criteria.push_back("o");
DECLARE_PTR_TYPEDEFS(IdoMysqlConnection);
DECLARE_TYPENAME(IdoMysqlConnection);
- static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
+ static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
protected:
virtual void Resume(void);
BOOST_THROW_EXCEPTION(
database_error()
- << errinfo_message(message)
- << errinfo_database_query(query)
+ << errinfo_message(message)
+ << errinfo_database_query(query)
);
}
BOOST_THROW_EXCEPTION(
database_error()
- << errinfo_message(message)
- << errinfo_database_query(query)
+ << errinfo_message(message)
+ << errinfo_database_query(query)
);
}
{
public:
DECLARE_PTR_TYPEDEFS(IdoPgsqlConnection);
- DECLARE_TYPENAME(IdoPgsqlConnection);
+ DECLARE_TYPENAME(IdoPgsqlConnection);
- static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
+ static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
protected:
virtual void Resume(void);
virtual void ActivateObject(const DbObject::Ptr& dbobj);
virtual void DeactivateObject(const DbObject::Ptr& dbobj);
virtual void ExecuteQuery(const DbQuery& query);
- virtual void CleanUpExecuteQuery(const String& table, const String& time_key, double time_value);
+ virtual void CleanUpExecuteQuery(const String& table, const String& time_key, double time_value);
virtual void FillIDCache(const DbType::Ptr& type);
private:
static Value CustomVariableNamesAccessor(const Value& row);
static Value CustomVariableValuesAccessor(const Value& row);
static Value CustomVariablesAccessor(const Value& row);
- static Value ModifiedAttributesAccessor(const Value& row);
- static Value ModifiedAttributesListAccessor(const Value& row);
+ static Value ModifiedAttributesAccessor(const Value& row);
+ static Value ModifiedAttributesListAccessor(const Value& row);
};
}
virtual void FetchRows(const AddRowFunction& addRowFn);
static Value NameAccessor(const Value& row);
- static Value IdentityAccessor(const Value& row);
- static Value NodeAccessor(const Value& row);
- static Value IsConnectedAccessor(const Value& row);
+ static Value IdentityAccessor(const Value& row);
+ static Value NodeAccessor(const Value& row);
+ static Value IsConnectedAccessor(const Value& row);
};
}
class HistoryTable : public Table
{
public:
- virtual void UpdateLogEntries(const Dictionary::Ptr& bag, int line_count, int lineno, const AddRowFunction& addRowFn);
+ virtual void UpdateLogEntries(const Dictionary::Ptr& bag, int line_count, int lineno, const AddRowFunction& addRowFn);
};
}
if (!host)
return Empty;
- return CompatUtility::GetCheckableNotificationNotificationNumber(host);
+ return CompatUtility::GetCheckableNotificationNotificationNumber(host);
}
Value HostsTable::TotalServicesAccessor(const Value& row)
static Value ActionUrlAccessor(const Value& row);
static Value ActionUrlExpandedAccessor(const Value& row);
static Value PluginOutputAccessor(const Value& row);
- static Value PerfDataAccessor(const Value& row);
+ static Value PerfDataAccessor(const Value& row);
static Value IconImageAccessor(const Value& row);
static Value IconImageExpandedAccessor(const Value& row);
static Value IconImageAltAccessor(const Value& row);
static Value ServicesAccessor(const Value& row);
static Value ServicesWithStateAccessor(const Value& row);
static Value ServicesWithInfoAccessor(const Value& row);
- static Value CheckSourceAccessor(const Value& row);
- static Value IsReachableAccessor(const Value& row);
+ static Value CheckSourceAccessor(const Value& row);
+ static Value IsReachableAccessor(const Value& row);
};
}
%attribute %string "bind_host",
%attribute %string "bind_port",
- %attribute %string "compat_log_path",
+ %attribute %string "compat_log_path",
}
{
public:
DECLARE_PTR_TYPEDEFS(LivestatusListener);
- DECLARE_TYPENAME(LivestatusListener);
+ DECLARE_TYPENAME(LivestatusListener);
- static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
+ static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
static int GetClientsConnected(void);
static int GetConnections(void);
Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text)
{
- Dictionary::Ptr bag = make_shared<Dictionary>();
+ Dictionary::Ptr bag = make_shared<Dictionary>();
- /*
- * [1379025342] SERVICE NOTIFICATION: contactname;hostname;servicedesc;WARNING;true;foo output
- */
- unsigned long time = atoi(text.SubStr(1, 11).CStr());
+ /*
+ * [1379025342] SERVICE NOTIFICATION: contactname;hostname;servicedesc;WARNING;true;foo output
+ */
+ unsigned long time = atoi(text.SubStr(1, 11).CStr());
- Log(LogDebug, "LivestatusLogUtility", "Processing log line: '" + text + "'.");
- bag->Set("time", time);
+ Log(LogDebug, "LivestatusLogUtility", "Processing log line: '" + text + "'.");
+ bag->Set("time", time);
- size_t colon = text.FindFirstOf(':');
- size_t colon_offset = colon - 13;
+ size_t colon = text.FindFirstOf(':');
+ size_t colon_offset = colon - 13;
- String type = String(text.SubStr(13, colon_offset));
- String options = String(text.SubStr(colon + 1));
+ String type = String(text.SubStr(13, colon_offset));
+ String options = String(text.SubStr(colon + 1));
- type.Trim();
- options.Trim();
+ type.Trim();
+ options.Trim();
- bag->Set("type", type);
- bag->Set("options", options);
+ bag->Set("type", type);
+ bag->Set("options", options);
std::vector<String> tokens;
boost::algorithm::split(tokens, options, boost::is_any_of(";"));
bag->Set("contact_name", tokens[0]);
bag->Set("host_name", tokens[1]);
bag->Set("state_type", tokens[2].CStr());
- bag->Set("state", Service::StateFromString(tokens[3]));
+ bag->Set("state", Service::StateFromString(tokens[3]));
bag->Set("command_name", tokens[4]);
bag->Set("plugin_output", tokens[5]);
bag->Set("contact_name", tokens[0]);
bag->Set("host_name", tokens[1]);
- bag->Set("service_description", tokens[2]);
+ bag->Set("service_description", tokens[2]);
bag->Set("state_type", tokens[3].CStr());
- bag->Set("state", Service::StateFromString(tokens[4]));
+ bag->Set("state", Service::StateFromString(tokens[4]));
bag->Set("command_name", tokens[5]);
bag->Set("plugin_output", tokens[6]);
bag->Set("state", Host::StateFromString(tokens[1]));
bag->Set("plugin_output", tokens[2]);
- bag->Set("log_class", LogEntryClassPassive);
+ bag->Set("log_class", LogEntryClassPassive);
- return bag;
+ return bag;
} else if (type.Contains("PASSIVE SERVICE CHECK")) {
if (tokens.size() < 4)
return bag;
bag->Set("host_name", tokens[0]);
- bag->Set("service_description", tokens[1]);
+ bag->Set("service_description", tokens[1]);
bag->Set("state", Host::StateFromString(tokens[2]));
bag->Set("plugin_output", tokens[3]);
- bag->Set("log_class", LogEntryClassPassive);
+ bag->Set("log_class", LogEntryClassPassive);
- return bag;
+ return bag;
} else if (type.Contains("EXTERNAL COMMAND")) {
bag->Set("log_class", LogEntryClassCommand);
/* string processing not implemented in 1.x */
- return bag;
+ return bag;
} else if (type.Contains("LOG VERSION")) {
bag->Set("log_class", LogEntryClassProgram);
bag->Set("log_type", LogEntryTypeVersion);
- return bag;
+ return bag;
} else if (type.Contains("logging initial states")) {
bag->Set("log_class", LogEntryClassProgram);
bag->Set("log_type", LogEntryTypeInitialStates);
- return bag;
+ return bag;
} else if (type.Contains("starting... (PID=")) {
bag->Set("log_class", LogEntryClassProgram);
bag->Set("log_type", LogEntryTypeProgramStarting);
- return bag;
+ return bag;
}
/* program */
else if (type.Contains("restarting...") ||
type.Contains("standby mode...")) {
bag->Set("log_class", LogEntryClassProgram);
- return bag;
+ return bag;
}
- return bag;
+ return bag;
}
virtual String GetName(void) const;
virtual String GetPrefix(void) const;
- void UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, int line_count, int lineno, const AddRowFunction& addRowFn);
+ void UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, int line_count, int lineno, const AddRowFunction& addRowFn);
protected:
virtual void FetchRows(const AddRowFunction& addRowFn);
- static Object::Ptr HostAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor);
- static Object::Ptr ServiceAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor);
- static Object::Ptr ContactAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor);
- static Object::Ptr CommandAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor);
+ static Object::Ptr HostAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor);
+ static Object::Ptr ServiceAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor);
+ static Object::Ptr ContactAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor);
+ static Object::Ptr CommandAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor);
static Value TimeAccessor(const Value& row);
static Value LinenoAccessor(const Value& row);
static Value CommandNameAccessor(const Value& row);
private:
- std::map<time_t, String> m_LogFileIndex;
- std::map<time_t, Dictionary::Ptr> m_RowsCache;
- time_t m_TimeFrom;
- time_t m_TimeUntil;
- String m_CompatLogPath;
+ std::map<time_t, String> m_LogFileIndex;
+ std::map<time_t, Dictionary::Ptr> m_RowsCache;
+ time_t m_TimeFrom;
+ time_t m_TimeUntil;
+ String m_CompatLogPath;
};
}
if (!service)
return Empty;
- return CompatUtility::GetCheckableNoMoreNotifications(service);
+ return CompatUtility::GetCheckableNoMoreNotifications(service);
}
Value ServicesTable::LastTimeOkAccessor(const Value& row)
static Value AcceptPassiveChecksAccessor(const Value& row);
static Value EventHandlerEnabledAccessor(const Value& row);
static Value NotificationsEnabledAccessor(const Value& row);
- static Value ProcessPerformanceDataAccessor(const Value& row);
+ static Value ProcessPerformanceDataAccessor(const Value& row);
static Value ActiveChecksEnabledAccessor(const Value& row);
static Value CheckOptionsAccessor(const Value& row);
static Value FlapDetectionEnabledAccessor(const Value& row);
static Value CustomVariablesAccessor(const Value& row);
static Value GroupsAccessor(const Value& row);
static Value ContactGroupsAccessor(const Value& row);
- static Value CheckSourceAccessor(const Value& row);
- static Value IsReachableAccessor(const Value& row);
+ static Value CheckSourceAccessor(const Value& row);
+ static Value IsReachableAccessor(const Value& row);
};
}
protected:
virtual void FetchRows(const AddRowFunction& addRowFn);
- static Object::Ptr HostAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor);
- static Object::Ptr ServiceAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor);
+ static Object::Ptr HostAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor);
+ static Object::Ptr ServiceAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor);
static Value TimeAccessor(const Value& row);
static Value LinenoAccessor(const Value& row);
static Value DurationPartUnmonitoredAccessor(const Value& row);
private:
- std::map<time_t, String> m_LogFileIndex;
- std::map<Checkable::Ptr, Array::Ptr> m_CheckablesCache;
- time_t m_TimeFrom;
- time_t m_TimeUntil;
- String m_CompatLogPath;
+ std::map<time_t, String> m_LogFileIndex;
+ std::map<Checkable::Ptr, Array::Ptr> m_CheckablesCache;
+ time_t m_TimeFrom;
+ time_t m_TimeUntil;
+ String m_CompatLogPath;
};
}
static Value ConnectionsAccessor(const Value& row);
static Value ConnectionsRateAccessor(const Value& row);
- static Value ServiceChecksAccessor(const Value& row);
- static Value ServiceChecksRateAccessor(const Value& row);
- static Value HostChecksAccessor(const Value& row);
- static Value HostChecksRateAccessor(const Value& row);
+ static Value ServiceChecksAccessor(const Value& row);
+ static Value ServiceChecksRateAccessor(const Value& row);
+ static Value HostChecksAccessor(const Value& row);
+ static Value HostChecksRateAccessor(const Value& row);
static Value ExternalCommandsAccessor(const Value& row);
static Value ExternalCommandsRateAccessor(const Value& row);
static Value NagiosPidAccessor(const Value& row);
static Value ExecuteHostChecksAccessor(const Value& row);
static Value EnableEventHandlersAccessor(const Value& row);
static Value EnableFlapDetectionAccessor(const Value& row);
- static Value ProcessPerformanceDataAccessor(const Value& row);
+ static Value ProcessPerformanceDataAccessor(const Value& row);
static Value ProgramStartAccessor(const Value& row);
static Value NumHostsAccessor(const Value& row);
static Value NumServicesAccessor(const Value& row);
{
public:
DECLARE_PTR_TYPEDEFS(NotificationComponent);
- DECLARE_TYPENAME(NotificationComponent);
+ DECLARE_TYPENAME(NotificationComponent);
- static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
+ static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
virtual void Start(void);
DECLARE_PTR_TYPEDEFS(GraphiteWriter);
DECLARE_TYPENAME(GraphiteWriter);
- static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
+ static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
protected:
virtual void Start(void);
private:
Stream::Ptr m_Stream;
-
+
Timer::Ptr m_ReconnectTimer;
void CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr);
- void SendMetric(const String& prefix, const String& name, double value);
- void SendPerfdata(const String& prefix, const CheckResult::Ptr& cr);
- static void SanitizeMetric(String& str);
+ void SendMetric(const String& prefix, const String& name, double value);
+ void SendPerfdata(const String& prefix, const CheckResult::Ptr& cr);
+ static void SanitizeMetric(String& str);
void ReconnectTimerHandler(void);
};
}
%type GraphiteWriter {
- %attribute %string "host",
- %attribute %string "port",
+ %attribute %string "host",
+ %attribute %string "port",
}
DECLARE_PTR_TYPEDEFS(PerfdataWriter);
DECLARE_TYPENAME(PerfdataWriter);
- static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
+ static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
protected:
virtual void Start(void);
void RotationTimerHandler(void);
std::ofstream m_ServiceOutputFile;
- std::ofstream m_HostOutputFile;
+ std::ofstream m_HostOutputFile;
void RotateFile(std::ofstream& output, const String& temp_path, const String& perfdata_path);
};
{
public:
DECLARE_PTR_TYPEDEFS(FileLogger);
- DECLARE_TYPENAME(FileLogger);
+ DECLARE_TYPENAME(FileLogger);
- static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
+ static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
virtual void Start(void);
}
}
- fp << "\t(" << i - ignoreFrames - 1 << ") " << message << std::endl;
+ fp << "\t(" << i - ignoreFrames - 1 << ") " << message << std::endl;
}
free(messages);
void BindStream(std::ostream *stream, bool ownsStream);
static void ProcessLogEntry(std::ostream& stream, bool tty, const LogEntry& entry);
- static bool IsTty(std::ostream& stream);
+ static bool IsTty(std::ostream& stream);
protected:
virtual void ProcessLogEntry(const LogEntry& entry);
{
public:
DECLARE_PTR_TYPEDEFS(SyslogLogger);
- DECLARE_TYPENAME(SyslogLogger);
+ DECLARE_TYPENAME(SyslogLogger);
- static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
+ static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
protected:
virtual void ProcessLogEntry(const LogEntry& entry);
inline std::string to_string(const errinfo_openssl_error& e)
{
- std::ostringstream tmp;
- int code = e.value();
+ std::ostringstream tmp;
+ int code = e.value();
char errbuf[120];
- const char *message = ERR_error_string(code, errbuf);
+ const char *message = ERR_error_string(code, errbuf);
- if (message == NULL)
- message = "Unknown error.";
+ if (message == NULL)
+ message = "Unknown error.";
- tmp << code << ", \"" << message << "\"";
- return tmp.str();
+ tmp << code << ", \"" << message << "\"";
+ return tmp.str();
}
}
std::ostringstream msgbuf;
#ifdef _WIN32
- char *message;
- String result = "Unknown error.";
+ char *message;
+ String result = "Unknown error.";
- DWORD rc = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM, NULL, code, 0, (char *)&message,
- 0, NULL);
+ DWORD rc = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM, NULL, code, 0, (char *)&message,
+ 0, NULL);
- if (rc != 0) {
- result = String(message);
- LocalFree(message);
+ if (rc != 0) {
+ result = String(message);
+ LocalFree(message);
- /* remove trailing new-line characters */
- boost::algorithm::trim_right(result);
- }
+ /* remove trailing new-line characters */
+ boost::algorithm::trim_right(result);
+ }
- msgbuf << code << ", \"" << result << "\"";
+ msgbuf << code << ", \"" << result << "\"";
#else
msgbuf << strerror(code);
#endif
static ConfigCompilerContext *GetInstance(void);
private:
- std::vector<ConfigCompilerMessage> m_Messages;
+ std::vector<ConfigCompilerMessage> m_Messages;
mutable boost::mutex m_Mutex;
};
virtual Dictionary::Ptr GetStatusFields(void) const;
protected:
- virtual void OnConfigUpdate(void);
+ virtual void OnConfigUpdate(void);
};
}
******************************************************************************/
%type DbConnection {
- %validator "ValidateFailoverTimeout"
+ %validator "ValidateFailoverTimeout"
%attribute %string "table_prefix",
%attribute %dictionary "cleanup" {
%attribute %number "acknowledgements_age",
- %attribute %number "commenthistory_age",
- %attribute %number "contactnotifications_age",
- %attribute %number "contactnotificationmethods_age",
- %attribute %number "downtimehistory_age",
- %attribute %number "eventhandlers_age",
- %attribute %number "externalcommands_age",
- %attribute %number "flappinghistory_age",
- %attribute %number "hostchecks_age",
- %attribute %number "logentries_age",
- %attribute %number "notifications_age",
- %attribute %number "processevents_age",
- %attribute %number "statehistory_age",
- %attribute %number "servicechecks_age",
- %attribute %number "systemcommands_age",
+ %attribute %number "commenthistory_age",
+ %attribute %number "contactnotifications_age",
+ %attribute %number "contactnotificationmethods_age",
+ %attribute %number "downtimehistory_age",
+ %attribute %number "eventhandlers_age",
+ %attribute %number "externalcommands_age",
+ %attribute %number "flappinghistory_age",
+ %attribute %number "hostchecks_age",
+ %attribute %number "logentries_age",
+ %attribute %number "notifications_age",
+ %attribute %number "processevents_age",
+ %attribute %number "statehistory_age",
+ %attribute %number "servicechecks_age",
+ %attribute %number "systemcommands_age",
},
%attribute %number "categories",
- %attribute %number "enable_ha",
+ %attribute %number "enable_ha",
- %attribute %number "failover_timeout",
+ %attribute %number "failover_timeout",
}
if (!attrs->Contains("failover_timeout"))
return;
- Value failover_timeout = attrs->Get("failover_timeout");
- if (failover_timeout < 60) {
- ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " +
- location + ": Failover timeout minimum is 60s.");
+ if (attrs->Get("failover_timeout") < 60) {
+ ConfigCompilerContext::GetInstance()->AddMessage(true, "Validation failed for " +
+ location + ": Failover timeout minimum is 60s.");
}
}
void SetStatusUpdate(const DbObject::Ptr& dbobj, bool hasupdate);
bool GetStatusUpdate(const DbObject::Ptr& dbobj) const;
- static void ValidateFailoverTimeout(const String& location, const Dictionary::Ptr& attrs);
+ static void ValidateFailoverTimeout(const String& location, const Dictionary::Ptr& attrs);
protected:
- virtual void OnConfigLoaded(void);
+ virtual void OnConfigLoaded(void);
virtual void Start(void);
virtual void Resume(void);
virtual void Pause(void);
private:
std::map<DbObject::Ptr, DbReference> m_ObjectIDs;
std::map<std::pair<DbType::Ptr, DbReference>, DbReference> m_InsertIDs;
- std::map<CustomVarObject::Ptr, DbReference> m_NotificationInsertIDs;
+ std::map<CustomVarObject::Ptr, DbReference> m_NotificationInsertIDs;
std::set<DbObject::Ptr> m_ActiveObjects;
std::set<DbObject::Ptr> m_ConfigUpdates;
std::set<DbObject::Ptr> m_StatusUpdates;
std::ostringstream msgbuf;
if (service) {
- msgbuf << "SERVICE FLAPPING ALERT: "
- << host->GetName() << ";"
- << service->GetShortName() << ";"
- << flapping_state_str << "; "
- << flapping_output
- << "";
+ msgbuf << "SERVICE FLAPPING ALERT: "
+ << host->GetName() << ";"
+ << service->GetShortName() << ";"
+ << flapping_state_str << "; "
+ << flapping_output
+ << "";
} else {
- msgbuf << "HOST FLAPPING ALERT: "
- << host->GetName() << ";"
- << flapping_state_str << "; "
- << flapping_output
- << "";
+ msgbuf << "HOST FLAPPING ALERT: "
+ << host->GetName() << ";"
+ << flapping_state_str << "; "
+ << flapping_output
+ << "";
}
AddLogHistory(checkable, msgbuf.str(), LogEntryTypeInfoMessage);
static void StaticInitialize(void);
static void AddCommentByType(const DynamicObject::Ptr& object, const Comment::Ptr& comment, bool historical);
- static void AddComments(const Checkable::Ptr& checkable);
- static void RemoveComments(const Checkable::Ptr& checkable);
+ static void AddComments(const Checkable::Ptr& checkable);
+ static void RemoveComments(const Checkable::Ptr& checkable);
- static void AddDowntimeByType(const Checkable::Ptr& checkable, const Downtime::Ptr& downtime, bool historical);
- static void AddDowntimes(const Checkable::Ptr& checkable);
- static void RemoveDowntimes(const Checkable::Ptr& checkable);
+ static void AddDowntimeByType(const Checkable::Ptr& checkable, const Downtime::Ptr& downtime, bool historical);
+ static void AddDowntimes(const Checkable::Ptr& checkable);
+ static void RemoveDowntimes(const Checkable::Ptr& checkable);
- static void AddLogHistory(const Checkable::Ptr& checkable, String buffer, LogEntryType type);
+ static void AddLogHistory(const Checkable::Ptr& checkable, String buffer, LogEntryType type);
- /* Status */
+ /* Status */
static void NextCheckChangedHandler(const Checkable::Ptr& checkable, double nextCheck);
static void FlappingChangedHandler(const Checkable::Ptr& checkable, FlappingState state);
static void LastNotificationChangedHandler(const Notification::Ptr& notification, const Checkable::Ptr& checkable);
static void RemoveAcknowledgement(const Checkable::Ptr& checkable);
static void AddAcknowledgementInternal(const Checkable::Ptr& checkable, AcknowledgementType type, bool add);
- /* comment, downtime, acknowledgement history */
- static void AddCommentHistory(const Checkable::Ptr& checkable, const Comment::Ptr& comment);
+ /* comment, downtime, acknowledgement history */
+ static void AddCommentHistory(const Checkable::Ptr& checkable, const Comment::Ptr& comment);
static void AddDowntimeHistory(const Checkable::Ptr& checkable, const Downtime::Ptr& downtime);
- static void AddAcknowledgementHistory(const Checkable::Ptr& checkable, const String& author, const String& comment,
- AcknowledgementType type, double expiry);
+ static void AddAcknowledgementHistory(const Checkable::Ptr& checkable, const String& author, const String& comment,
+ AcknowledgementType type, double expiry);
- /* notification & contactnotification history */
+ /* notification & contactnotification history */
static void AddNotificationHistory(const Notification::Ptr& notification, const Checkable::Ptr& checkable,
- const std::set<User::Ptr>& users, NotificationType type, const CheckResult::Ptr& cr, const String& author,
- const String& text);
+ const std::set<User::Ptr>& users, NotificationType type, const CheckResult::Ptr& cr, const String& author,
+ const String& text);
- /* statehistory */
+ /* statehistory */
static void AddStateChangeHistory(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type);
- /* logentries */
+ /* logentries */
static void AddCheckResultLogHistory(const Checkable::Ptr& checkable, const CheckResult::Ptr &cr);
- static void AddTriggerDowntimeLogHistory(const Checkable::Ptr& checkable, const Downtime::Ptr& downtime);
- static void AddRemoveDowntimeLogHistory(const Checkable::Ptr& checkable, const Downtime::Ptr& downtime);
+ static void AddTriggerDowntimeLogHistory(const Checkable::Ptr& checkable, const Downtime::Ptr& downtime);
+ static void AddRemoveDowntimeLogHistory(const Checkable::Ptr& checkable, const Downtime::Ptr& downtime);
static void AddNotificationSentLogHistory(const Notification::Ptr& notification, const Checkable::Ptr& checkable,
- const User::Ptr& user, NotificationType notification_type, const CheckResult::Ptr& cr, const String& author,
- const String& comment_text);
- static void AddFlappingLogHistory(const Checkable::Ptr& checkable, FlappingState flapping_state);
+ const User::Ptr& user, NotificationType notification_type, const CheckResult::Ptr& cr, const String& author,
+ const String& comment_text);
+ static void AddFlappingLogHistory(const Checkable::Ptr& checkable, FlappingState flapping_state);
- /* other history */
- static void AddFlappingHistory(const Checkable::Ptr& checkable, FlappingState flapping_state);
+ /* other history */
+ static void AddFlappingHistory(const Checkable::Ptr& checkable, FlappingState flapping_state);
static void AddServiceCheckHistory(const Checkable::Ptr& checkable, const CheckResult::Ptr &cr);
- static void AddEventHandlerHistory(const Checkable::Ptr& checkable);
- static void AddExternalCommandHistory(double time, const String& command, const std::vector<String>& arguments);
+ static void AddEventHandlerHistory(const Checkable::Ptr& checkable);
+ static void AddExternalCommandHistory(double time, const String& command, const std::vector<String>& arguments);
private:
DbEvents(void);
EndpointDbObject(const shared_ptr<DbType>& type, const String& name1, const String& name2);
- static void StaticInitialize(void);
+ static void StaticInitialize(void);
virtual Dictionary::Ptr GetConfigFields(void) const;
virtual Dictionary::Ptr GetStatusFields(void) const;
protected:
- virtual void OnConfigUpdate(void);
+ virtual void OnConfigUpdate(void);
private:
- static void UpdateConnectedStatus(const Endpoint::Ptr& endpoint);
- static int EndpointIsConnected(const Endpoint::Ptr& endpoint);
+ static void UpdateConnectedStatus(const Endpoint::Ptr& endpoint);
+ static int EndpointIsConnected(const Endpoint::Ptr& endpoint);
};
}
virtual Dictionary::Ptr GetConfigFields(void) const;
virtual Dictionary::Ptr GetStatusFields(void) const;
- virtual void OnConfigUpdate(void);
+ virtual void OnConfigUpdate(void);
virtual bool IsStatusAttribute(const String& attribute) const;
};
static void RemoveDowntime(const String& id, bool cancelled, const MessageOrigin& origin = MessageOrigin());
- void TriggerDowntimes(void);
+ void TriggerDowntimes(void);
static void TriggerDowntime(const String& id);
static String GetDowntimeIDFromLegacyID(int id);
};
struct ServiceStatistics {
- double services_ok;
- double services_warning;
- double services_critical;
- double services_unknown;
- double services_pending;
- double services_unreachable;
- double services_flapping;
- double services_in_downtime;
- double services_acknowledged;
+ double services_ok;
+ double services_warning;
+ double services_critical;
+ double services_unknown;
+ double services_pending;
+ double services_unreachable;
+ double services_flapping;
+ double services_in_downtime;
+ double services_acknowledged;
};
struct HostStatistics {
- double hosts_up;
- double hosts_down;
- double hosts_unreachable;
- double hosts_pending;
- double hosts_flapping;
- double hosts_in_downtime;
- double hosts_acknowledged;
+ double hosts_up;
+ double hosts_down;
+ double hosts_unreachable;
+ double hosts_pending;
+ double hosts_flapping;
+ double hosts_in_downtime;
+ double hosts_acknowledged;
};
/**
static void UpdatePassiveServiceChecksStatistics(long tv, int num);
static int GetPassiveServiceChecksStatistics(long timespan);
- static CheckableCheckStatistics CalculateHostCheckStats(void);
- static CheckableCheckStatistics CalculateServiceCheckStats(void);
- static HostStatistics CalculateHostStats(void);
- static ServiceStatistics CalculateServiceStats(void);
+ static CheckableCheckStatistics CalculateHostCheckStats(void);
+ static CheckableCheckStatistics CalculateServiceCheckStats(void);
+ static HostStatistics CalculateHostStats(void);
+ static ServiceStatistics CalculateServiceStats(void);
- static std::pair<Dictionary::Ptr, Dictionary::Ptr> GetFeatureStats(void);
+ static std::pair<Dictionary::Ptr, Dictionary::Ptr> GetFeatureStats(void);
private:
CIB(void);
int CompatUtility::GetCheckableNoMoreNotifications(const Checkable::Ptr& checkable)
{
- if (CompatUtility::GetCheckableNotificationNotificationInterval(checkable) == 0 && !checkable->GetVolatile())
- return 1;
+ if (CompatUtility::GetCheckableNotificationNotificationInterval(checkable) == 0 && !checkable->GetVolatile())
+ return 1;
return 0;
}
static int GetHostNotifyOnUnreachable(const Host::Ptr& host);
/* service */
- static String GetCheckableCommandArgs(const Checkable::Ptr& checkable);
+ static String GetCheckableCommandArgs(const Checkable::Ptr& checkable);
static int GetCheckableCheckType(const Checkable::Ptr& checkable);
static double GetCheckableCheckInterval(const Checkable::Ptr& checkable);
static double GetCheckableRetryInterval(const Checkable::Ptr& checkable);
static int GetCheckableEventHandlerEnabled(const Checkable::Ptr& checkable);
static int GetCheckableFlapDetectionEnabled(const Checkable::Ptr& checkable);
static int GetCheckableIsFlapping(const Checkable::Ptr& checkable);
- static int GetCheckableIsReachable(const Checkable::Ptr& checkable);
+ static int GetCheckableIsReachable(const Checkable::Ptr& checkable);
static String GetCheckablePercentStateChange(const Checkable::Ptr& checkable);
static int GetCheckableProcessPerformanceData(const Checkable::Ptr& checkable);
static void ChangeSvcModattr(double time, const std::vector<String>& arguments);
static void ChangeHostModattr(double time, const std::vector<String>& arguments);
- static void ChangeUserModattr(double time, const std::vector<String>& arguments);
- static void ChangeCheckcommandModattr(double time, const std::vector<String>& arguments);
- static void ChangeEventcommandModattr(double time, const std::vector<String>& arguments);
- static void ChangeNotificationcommandModattr(double time, const std::vector<String>& arguments);
+ static void ChangeUserModattr(double time, const std::vector<String>& arguments);
+ static void ChangeCheckcommandModattr(double time, const std::vector<String>& arguments);
+ static void ChangeEventcommandModattr(double time, const std::vector<String>& arguments);
+ static void ChangeNotificationcommandModattr(double time, const std::vector<String>& arguments);
static void ChangeNormalSvcCheckInterval(double time, const std::vector<String>& arguments);
static void ChangeNormalHostCheckInterval(double time, const std::vector<String>& arguments);
static void ChangeMaxSvcCheckAttempts(double time, const std::vector<String>& arguments);
static void ChangeHostCheckTimeperiod(double time, const std::vector<String>& arguments);
static void ChangeSvcCheckTimeperiod(double time, const std::vector<String>& arguments);
- static void ChangeCustomHostVar(double time, const std::vector<String>& arguments);
- static void ChangeCustomSvcVar(double time, const std::vector<String>& arguments);
- static void ChangeCustomUserVar(double time, const std::vector<String>& arguments);
- static void ChangeCustomCheckcommandVar(double time, const std::vector<String>& arguments);
- static void ChangeCustomEventcommandVar(double time, const std::vector<String>& arguments);
- static void ChangeCustomNotificationcommandVar(double time, const std::vector<String>& arguments);
+ static void ChangeCustomHostVar(double time, const std::vector<String>& arguments);
+ static void ChangeCustomSvcVar(double time, const std::vector<String>& arguments);
+ static void ChangeCustomUserVar(double time, const std::vector<String>& arguments);
+ static void ChangeCustomCheckcommandVar(double time, const std::vector<String>& arguments);
+ static void ChangeCustomEventcommandVar(double time, const std::vector<String>& arguments);
+ static void ChangeCustomNotificationcommandVar(double time, const std::vector<String>& arguments);
static void EnableHostgroupHostNotifications(double time, const std::vector<String>& arguments);
static void EnableHostgroupSvcNotifications(double time, const std::vector<String>& arguments);
static void DisableServicegroupSvcNotifications(double time, const std::vector<String>& arguments);
private:
- static void ChangeCommandModattrInternal(const Command::Ptr& command, int mod_attr);
- static void ChangeCustomCommandVarInternal(const Command::Ptr& command, const String& name, const Value& value);
+ static void ChangeCommandModattrInternal(const Command::Ptr& command, int mod_attr);
+ static void ChangeCustomCommandVarInternal(const Command::Ptr& command, const String& name, const Value& value);
};
}
void HostGroup::RegisterObjectRuleHandler(void)
{
- ObjectRule::RegisterType("HostGroup", &HostGroup::EvaluateObjectRules);
+ ObjectRule::RegisterType("HostGroup", &HostGroup::EvaluateObjectRules);
}
-bool HostGroup::EvaluateObjectRuleOne(const Host::Ptr host, const ObjectRule& rule)
+bool HostGroup::EvaluateObjectRuleOne(const Host::Ptr& host, const ObjectRule& rule)
{
DebugInfo di = rule.GetDebugInfo();
void AddMember(const Host::Ptr& host);
void RemoveMember(const Host::Ptr& host);
- bool ResolveGroupMembership(Host::Ptr const& host, bool add = true, int rstack = 0);
+ bool ResolveGroupMembership(const Host::Ptr& host, bool add = true, int rstack = 0);
- static void RegisterObjectRuleHandler(void);
+ static void RegisterObjectRuleHandler(void);
private:
mutable boost::mutex m_HostGroupMutex;
std::set<Host::Ptr> m_Members;
- static bool EvaluateObjectRuleOne(const Host::Ptr host, const ObjectRule& rule);
+ static bool EvaluateObjectRuleOne(const Host::Ptr& host, const ObjectRule& rule);
static void EvaluateObjectRule(const ObjectRule& rule);
- static void EvaluateObjectRules(const std::vector<ObjectRule>& rules);
+ static void EvaluateObjectRules(const std::vector<ObjectRule>& rules);
};
}
}
%type IcingaStatusWriter {
- %attribute %string "status_path",
- %attribute %number "update_interval"
+ %attribute %string "status_path",
+ %attribute %number "update_interval"
}
%type Checkable {
int Main(void);
- static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
+ static Value StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata);
static IcingaApplication::Ptr GetInstance(void);
String GetPidPath(void) const;
Dictionary::Ptr GetVars(void) const;
- String GetNodeName(void) const;
+ String GetNodeName(void) const;
virtual bool ResolveMacro(const String& macro, const CheckResult::Ptr& cr, String *result) const;
{
Log(LogNotice, "IcingaStatusWriter", "Writing status.json file");
- String statuspath = GetStatusPath();
- String statuspathtmp = statuspath + ".tmp"; /* XXX make this a global definition */
+ String statuspath = GetStatusPath();
+ String statuspathtmp = statuspath + ".tmp"; /* XXX make this a global definition */
- std::ofstream statusfp;
- statusfp.open(statuspathtmp.CStr(), std::ofstream::out | std::ofstream::trunc);
+ std::ofstream statusfp;
+ statusfp.open(statuspathtmp.CStr(), std::ofstream::out | std::ofstream::trunc);
- statusfp << std::fixed;
+ statusfp << std::fixed;
statusfp << JsonSerialize(GetStatusData());
- statusfp.close();
+ statusfp.close();
#ifdef _WIN32
- _unlink(statuspath.CStr());
+ _unlink(statuspath.CStr());
#endif /* _WIN32 */
- if (rename(statuspathtmp.CStr(), statuspath.CStr()) < 0) {
- BOOST_THROW_EXCEPTION(posix_error()
- << boost::errinfo_api_function("rename")
- << boost::errinfo_errno(errno)
- << boost::errinfo_file_name(statuspathtmp));
- }
+ if (rename(statuspathtmp.CStr(), statuspath.CStr()) < 0) {
+ BOOST_THROW_EXCEPTION(posix_error()
+ << boost::errinfo_api_function("rename")
+ << boost::errinfo_errno(errno)
+ << boost::errinfo_file_name(statuspathtmp));
+ }
- Log(LogNotice, "IcingaStatusWriter", "Finished writing status.json file");
+ Log(LogNotice, "IcingaStatusWriter", "Finished writing status.json file");
}
void ServiceGroup::RegisterObjectRuleHandler(void)
{
- ObjectRule::RegisterType("ServiceGroup", &ServiceGroup::EvaluateObjectRules);
+ ObjectRule::RegisterType("ServiceGroup", &ServiceGroup::EvaluateObjectRules);
}
-bool ServiceGroup::EvaluateObjectRuleOne(const Service::Ptr service, const ObjectRule& rule)
+bool ServiceGroup::EvaluateObjectRuleOne(const Service::Ptr& service, const ObjectRule& rule)
{
DebugInfo di = rule.GetDebugInfo();
void AddMember(const Service::Ptr& service);
void RemoveMember(const Service::Ptr& service);
- bool ResolveGroupMembership(Service::Ptr const& service, bool add = true, int rstack = 0);
+ bool ResolveGroupMembership(const Service::Ptr& service, bool add = true, int rstack = 0);
- static void RegisterObjectRuleHandler(void);
+ static void RegisterObjectRuleHandler(void);
private:
mutable boost::mutex m_ServiceGroupMutex;
std::set<Service::Ptr> m_Members;
- static bool EvaluateObjectRuleOne(const Service::Ptr service, const ObjectRule& rule);
+ static bool EvaluateObjectRuleOne(const Service::Ptr& service, const ObjectRule& rule);
static void EvaluateObjectRule(const ObjectRule& rule);
- static void EvaluateObjectRules(const std::vector<ObjectRule>& rules);
+ static void EvaluateObjectRules(const std::vector<ObjectRule>& rules);
};
}
void UserGroup::RegisterObjectRuleHandler(void)
{
- ObjectRule::RegisterType("UserGroup", &UserGroup::EvaluateObjectRules);
+ ObjectRule::RegisterType("UserGroup", &UserGroup::EvaluateObjectRules);
}
-bool UserGroup::EvaluateObjectRuleOne(const User::Ptr user, const ObjectRule& rule)
+bool UserGroup::EvaluateObjectRuleOne(const User::Ptr& user, const ObjectRule& rule)
{
DebugInfo di = rule.GetDebugInfo();
void AddMember(const User::Ptr& user);
void RemoveMember(const User::Ptr& user);
- bool ResolveGroupMembership(User::Ptr const& user, bool add = true, int rstack = 0);
+ bool ResolveGroupMembership(const User::Ptr& user, bool add = true, int rstack = 0);
- static void RegisterObjectRuleHandler(void);
+ static void RegisterObjectRuleHandler(void);
private:
mutable boost::mutex m_UserGroupMutex;
std::set<User::Ptr> m_Members;
- static bool EvaluateObjectRuleOne(const User::Ptr user, const ObjectRule& rule);
+ static bool EvaluateObjectRuleOne(const User::Ptr& user, const ObjectRule& rule);
static void EvaluateObjectRule(const ObjectRule& rule);
- static void EvaluateObjectRules(const std::vector<ObjectRule>& rules);
+ static void EvaluateObjectRules(const std::vector<ObjectRule>& rules);
};
}
private:
ClusterCheckTask(void);
- static String FormatArray(const Array::Ptr& arr);
+ static String FormatArray(const Array::Ptr& arr);
};
}
private:
PluginEventTask(void);
- static void ProcessFinishedHandler(const Checkable::Ptr& checkable, const Value& command, const ProcessResult& pr);
+ static void ProcessFinishedHandler(const Checkable::Ptr& checkable, const Value& command, const ProcessResult& pr);
};
}