diff --git a/components/compat/checkresultreader.hpp b/components/compat/checkresultreader.hpp index 83799794d..12655eebd 100644 --- a/components/compat/checkresultreader.hpp +++ b/components/compat/checkresultreader.hpp @@ -38,7 +38,7 @@ public: 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); diff --git a/components/compat/compatlogger.cpp b/components/compat/compatlogger.cpp index de9ef7564..0f901cf07 100644 --- a/components/compat/compatlogger.cpp +++ b/components/compat/compatlogger.cpp @@ -257,14 +257,14 @@ void CompatLogger::NotificationSentHandler(const Notification::Ptr& notification 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: " @@ -277,22 +277,22 @@ void CompatLogger::NotificationSentHandler(const Notification::Ptr& 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(); + } } /** @@ -325,7 +325,7 @@ void CompatLogger::FlappingHandler(const Checkable::Ptr& checkable, FlappingStat return; } - std::ostringstream msgbuf; + std::ostringstream msgbuf; if (service) { msgbuf << "SERVICE FLAPPING ALERT: " @@ -335,32 +335,32 @@ void CompatLogger::FlappingHandler(const Checkable::Ptr& checkable, FlappingStat << 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& arguments) { - std::ostringstream msgbuf; - msgbuf << "EXTERNAL COMMAND: " - << command << ";" - << boost::algorithm::join(arguments, ";") - << ""; + std::ostringstream msgbuf; + msgbuf << "EXTERNAL COMMAND: " + << command << ";" + << boost::algorithm::join(arguments, ";") + << ""; - { - ObjectLock oLock(this); - WriteLine(msgbuf.str()); - } + { + ObjectLock oLock(this); + WriteLine(msgbuf.str()); + } } void CompatLogger::EventCommandHandler(const Checkable::Ptr& checkable) @@ -373,7 +373,7 @@ 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: " @@ -385,7 +385,7 @@ void CompatLogger::EventCommandHandler(const Checkable::Ptr& checkable) << 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 << ";" @@ -395,8 +395,8 @@ void CompatLogger::EventCommandHandler(const Checkable::Ptr& checkable) { ObjectLock oLock(this); WriteLine(msgbuf.str()); - Flush(); - } + Flush(); + } } void CompatLogger::WriteLine(const String& line) diff --git a/components/compat/compatlogger.hpp b/components/compat/compatlogger.hpp index 05081b1c1..512d2a349 100644 --- a/components/compat/compatlogger.hpp +++ b/components/compat/compatlogger.hpp @@ -39,7 +39,7 @@ public: 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); @@ -52,8 +52,8 @@ private: 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); diff --git a/components/compat/externalcommandlistener.hpp b/components/compat/externalcommandlistener.hpp index db65fadb2..7e2fed7c0 100644 --- a/components/compat/externalcommandlistener.hpp +++ b/components/compat/externalcommandlistener.hpp @@ -37,9 +37,9 @@ class ExternalCommandListener : public ObjectImpl { 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); @@ -49,7 +49,7 @@ private: 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 */ }; diff --git a/components/compat/statusdatawriter.cpp b/components/compat/statusdatawriter.cpp index 5e9687872..b0b714bf6 100644 --- a/components/compat/statusdatawriter.cpp +++ b/components/compat/statusdatawriter.cpp @@ -236,7 +236,7 @@ void StatusDataWriter::DumpHostObject(std::ostream& fp, const Host::Ptr& host) "\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"; @@ -300,24 +300,24 @@ void StatusDataWriter::DumpHostObject(std::ostream& fp, const Host::Ptr& host) 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"; @@ -344,7 +344,7 @@ void StatusDataWriter::DumpCheckableStatusAttrs(std::ostream& fp, const Checkabl 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; @@ -363,7 +363,7 @@ void StatusDataWriter::DumpCheckableStatusAttrs(std::ostream& fp, const Checkabl if (cr) { fp << "\t" << "check_source=" << cr->GetCheckSource() << "\n" - "\t" "last_check=" << static_cast(cr->GetScheduleEnd()) << "\n"; + "\t" "last_check=" << static_cast(cr->GetScheduleEnd()) << "\n"; } fp << "\t" << "next_check=" << static_cast(checkable->GetNextCheck()) << "\n" @@ -446,13 +446,13 @@ void StatusDataWriter::DumpServiceObject(std::ostream& fp, const Service::Ptr& s 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(); @@ -460,11 +460,11 @@ void StatusDataWriter::DumpServiceObject(std::ostream& fp, const Service::Ptr& s 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()) @@ -480,24 +480,24 @@ void StatusDataWriter::DumpServiceObject(std::ostream& fp, const Service::Ptr& s 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"; @@ -712,7 +712,7 @@ void StatusDataWriter::UpdateObjectsCache(void) Service::Ptr child_service; tie(child_host, child_service) = GetHostService(child); - int state_filter = dep->GetStateFilter(); + int state_filter = dep->GetStateFilter(); std::vector failure_criteria; if (state_filter & StateFilterOK || state_filter & StateFilterUp) failure_criteria.push_back("o"); diff --git a/components/db_ido_mysql/idomysqlconnection.hpp b/components/db_ido_mysql/idomysqlconnection.hpp index 7a784a817..188dcaf70 100644 --- a/components/db_ido_mysql/idomysqlconnection.hpp +++ b/components/db_ido_mysql/idomysqlconnection.hpp @@ -42,7 +42,7 @@ public: 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); diff --git a/components/db_ido_pgsql/idopgsqlconnection.cpp b/components/db_ido_pgsql/idopgsqlconnection.cpp index 9fe413dfb..8130da7c9 100644 --- a/components/db_ido_pgsql/idopgsqlconnection.cpp +++ b/components/db_ido_pgsql/idopgsqlconnection.cpp @@ -363,8 +363,8 @@ IdoPgsqlResult IdoPgsqlConnection::Query(const String& query) BOOST_THROW_EXCEPTION( database_error() - << errinfo_message(message) - << errinfo_database_query(query) + << errinfo_message(message) + << errinfo_database_query(query) ); } @@ -384,8 +384,8 @@ IdoPgsqlResult IdoPgsqlConnection::Query(const String& query) BOOST_THROW_EXCEPTION( database_error() - << errinfo_message(message) - << errinfo_database_query(query) + << errinfo_message(message) + << errinfo_database_query(query) ); } diff --git a/components/db_ido_pgsql/idopgsqlconnection.hpp b/components/db_ido_pgsql/idopgsqlconnection.hpp index d1951d0f5..ff137dcc5 100644 --- a/components/db_ido_pgsql/idopgsqlconnection.hpp +++ b/components/db_ido_pgsql/idopgsqlconnection.hpp @@ -40,9 +40,9 @@ class IdoPgsqlConnection : public ObjectImpl { 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); @@ -51,7 +51,7 @@ protected: 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: diff --git a/components/livestatus/commandstable.hpp b/components/livestatus/commandstable.hpp index 5c018ff73..44bcf917a 100644 --- a/components/livestatus/commandstable.hpp +++ b/components/livestatus/commandstable.hpp @@ -51,8 +51,8 @@ protected: 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); }; } diff --git a/components/livestatus/endpointstable.hpp b/components/livestatus/endpointstable.hpp index 0765c67e2..9ccc9f230 100644 --- a/components/livestatus/endpointstable.hpp +++ b/components/livestatus/endpointstable.hpp @@ -47,9 +47,9 @@ protected: 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); }; } diff --git a/components/livestatus/historytable.hpp b/components/livestatus/historytable.hpp index 787139014..6f3f00036 100644 --- a/components/livestatus/historytable.hpp +++ b/components/livestatus/historytable.hpp @@ -33,7 +33,7 @@ namespace icinga 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); }; } diff --git a/components/livestatus/hoststable.cpp b/components/livestatus/hoststable.cpp index fdf2ddeaa..4140270e3 100644 --- a/components/livestatus/hoststable.cpp +++ b/components/livestatus/hoststable.cpp @@ -584,7 +584,7 @@ Value HostsTable::CurrentNotificationNumberAccessor(const Value& row) if (!host) return Empty; - return CompatUtility::GetCheckableNotificationNotificationNumber(host); + return CompatUtility::GetCheckableNotificationNotificationNumber(host); } Value HostsTable::TotalServicesAccessor(const Value& row) diff --git a/components/livestatus/hoststable.hpp b/components/livestatus/hoststable.hpp index 44ca9400e..9896615e0 100644 --- a/components/livestatus/hoststable.hpp +++ b/components/livestatus/hoststable.hpp @@ -62,7 +62,7 @@ protected: 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); @@ -141,8 +141,8 @@ protected: 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); }; } diff --git a/components/livestatus/livestatus-type.conf b/components/livestatus/livestatus-type.conf index ec4a2097c..96143258e 100644 --- a/components/livestatus/livestatus-type.conf +++ b/components/livestatus/livestatus-type.conf @@ -26,5 +26,5 @@ %attribute %string "bind_host", %attribute %string "bind_port", - %attribute %string "compat_log_path", + %attribute %string "compat_log_path", } diff --git a/components/livestatus/livestatuslistener.hpp b/components/livestatus/livestatuslistener.hpp index 63341dfbb..5ddc0ac18 100644 --- a/components/livestatus/livestatuslistener.hpp +++ b/components/livestatus/livestatuslistener.hpp @@ -37,9 +37,9 @@ class LivestatusListener : public ObjectImpl { 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); diff --git a/components/livestatus/livestatuslogutility.cpp b/components/livestatus/livestatuslogutility.cpp index 1fcec9f99..c7a85c976 100644 --- a/components/livestatus/livestatuslogutility.cpp +++ b/components/livestatus/livestatuslogutility.cpp @@ -120,27 +120,27 @@ void LivestatusLogUtility::CreateLogCache(std::map index, Histor Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text) { - Dictionary::Ptr bag = make_shared(); + Dictionary::Ptr bag = make_shared(); - /* - * [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 tokens; boost::algorithm::split(tokens, options, boost::is_any_of(";")); @@ -260,7 +260,7 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text) 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]); @@ -274,9 +274,9 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text) 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]); @@ -292,41 +292,41 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text) 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...") || @@ -336,8 +336,8 @@ Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text) type.Contains("standby mode...")) { bag->Set("log_class", LogEntryClassProgram); - return bag; + return bag; } - return bag; + return bag; } diff --git a/components/livestatus/logtable.hpp b/components/livestatus/logtable.hpp index 7767d22a3..44c3e1dc7 100644 --- a/components/livestatus/logtable.hpp +++ b/components/livestatus/logtable.hpp @@ -44,15 +44,15 @@ public: 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); @@ -71,11 +71,11 @@ protected: static Value CommandNameAccessor(const Value& row); private: - std::map m_LogFileIndex; - std::map m_RowsCache; - time_t m_TimeFrom; - time_t m_TimeUntil; - String m_CompatLogPath; + std::map m_LogFileIndex; + std::map m_RowsCache; + time_t m_TimeFrom; + time_t m_TimeUntil; + String m_CompatLogPath; }; } diff --git a/components/livestatus/servicestable.cpp b/components/livestatus/servicestable.cpp index 5ba508cfb..782a4dfc8 100644 --- a/components/livestatus/servicestable.cpp +++ b/components/livestatus/servicestable.cpp @@ -519,7 +519,7 @@ Value ServicesTable::NoMoreNotificationsAccessor(const Value& row) if (!service) return Empty; - return CompatUtility::GetCheckableNoMoreNotifications(service); + return CompatUtility::GetCheckableNoMoreNotifications(service); } Value ServicesTable::LastTimeOkAccessor(const Value& row) diff --git a/components/livestatus/servicestable.hpp b/components/livestatus/servicestable.hpp index 56fd8a969..105d6d0be 100644 --- a/components/livestatus/servicestable.hpp +++ b/components/livestatus/servicestable.hpp @@ -95,7 +95,7 @@ protected: 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); @@ -124,8 +124,8 @@ protected: 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); }; } diff --git a/components/livestatus/statehisttable.hpp b/components/livestatus/statehisttable.hpp index 55eebaabc..fa01cdca7 100644 --- a/components/livestatus/statehisttable.hpp +++ b/components/livestatus/statehisttable.hpp @@ -50,8 +50,8 @@ public: 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); @@ -81,11 +81,11 @@ protected: static Value DurationPartUnmonitoredAccessor(const Value& row); private: - std::map m_LogFileIndex; - std::map m_CheckablesCache; - time_t m_TimeFrom; - time_t m_TimeUntil; - String m_CompatLogPath; + std::map m_LogFileIndex; + std::map m_CheckablesCache; + time_t m_TimeFrom; + time_t m_TimeUntil; + String m_CompatLogPath; }; } diff --git a/components/livestatus/statustable.hpp b/components/livestatus/statustable.hpp index a1f8e78b0..43a694bde 100644 --- a/components/livestatus/statustable.hpp +++ b/components/livestatus/statustable.hpp @@ -48,10 +48,10 @@ protected: 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); @@ -60,7 +60,7 @@ protected: 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); diff --git a/components/notification/notificationcomponent.hpp b/components/notification/notificationcomponent.hpp index 337fb4531..6365e8cb0 100644 --- a/components/notification/notificationcomponent.hpp +++ b/components/notification/notificationcomponent.hpp @@ -35,9 +35,9 @@ class NotificationComponent : public ObjectImpl { 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); diff --git a/components/perfdata/graphitewriter.hpp b/components/perfdata/graphitewriter.hpp index d0e516f22..7eeb595a3 100644 --- a/components/perfdata/graphitewriter.hpp +++ b/components/perfdata/graphitewriter.hpp @@ -41,20 +41,20 @@ public: 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); }; diff --git a/components/perfdata/perfdata-type.conf b/components/perfdata/perfdata-type.conf index 81a87ed69..69ecd334a 100644 --- a/components/perfdata/perfdata-type.conf +++ b/components/perfdata/perfdata-type.conf @@ -28,6 +28,6 @@ } %type GraphiteWriter { - %attribute %string "host", - %attribute %string "port", + %attribute %string "host", + %attribute %string "port", } diff --git a/components/perfdata/perfdatawriter.hpp b/components/perfdata/perfdatawriter.hpp index f22b63047..e8a5bdb12 100644 --- a/components/perfdata/perfdatawriter.hpp +++ b/components/perfdata/perfdatawriter.hpp @@ -40,7 +40,7 @@ public: 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); @@ -52,7 +52,7 @@ private: 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); }; diff --git a/lib/base/filelogger.hpp b/lib/base/filelogger.hpp index bbf5ff056..072caa6af 100644 --- a/lib/base/filelogger.hpp +++ b/lib/base/filelogger.hpp @@ -35,9 +35,9 @@ class I2_BASE_API FileLogger : public ObjectImpl { 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); diff --git a/lib/base/stacktrace.cpp b/lib/base/stacktrace.cpp index cea0768c5..92fcc0e58 100644 --- a/lib/base/stacktrace.cpp +++ b/lib/base/stacktrace.cpp @@ -136,7 +136,7 @@ void StackTrace::Print(std::ostream& fp, int ignoreFrames) const } } - fp << "\t(" << i - ignoreFrames - 1 << ") " << message << std::endl; + fp << "\t(" << i - ignoreFrames - 1 << ") " << message << std::endl; } free(messages); diff --git a/lib/base/streamlogger.hpp b/lib/base/streamlogger.hpp index 192a44c60..8c898ab25 100644 --- a/lib/base/streamlogger.hpp +++ b/lib/base/streamlogger.hpp @@ -45,7 +45,7 @@ public: 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); diff --git a/lib/base/sysloglogger.hpp b/lib/base/sysloglogger.hpp index 53952a3be..968840f48 100644 --- a/lib/base/sysloglogger.hpp +++ b/lib/base/sysloglogger.hpp @@ -36,9 +36,9 @@ class I2_BASE_API SyslogLogger : public ObjectImpl { 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); diff --git a/lib/base/tlsutility.hpp b/lib/base/tlsutility.hpp index 6bd744e40..edfdb1c09 100644 --- a/lib/base/tlsutility.hpp +++ b/lib/base/tlsutility.hpp @@ -47,17 +47,17 @@ typedef boost::error_info errinfo_openssl_er 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(); } } diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp index 362764959..86b0e0bd5 100644 --- a/lib/base/utility.cpp +++ b/lib/base/utility.cpp @@ -777,22 +777,22 @@ String Utility::FormatErrorNumber(int code) { 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 diff --git a/lib/config/configcompilercontext.hpp b/lib/config/configcompilercontext.hpp index d4319f0f9..22f611287 100644 --- a/lib/config/configcompilercontext.hpp +++ b/lib/config/configcompilercontext.hpp @@ -54,7 +54,7 @@ public: static ConfigCompilerContext *GetInstance(void); private: - std::vector m_Messages; + std::vector m_Messages; mutable boost::mutex m_Mutex; }; diff --git a/lib/db_ido/commanddbobject.hpp b/lib/db_ido/commanddbobject.hpp index ed6250c8c..c414b6cd7 100644 --- a/lib/db_ido/commanddbobject.hpp +++ b/lib/db_ido/commanddbobject.hpp @@ -42,7 +42,7 @@ public: virtual Dictionary::Ptr GetStatusFields(void) const; protected: - virtual void OnConfigUpdate(void); + virtual void OnConfigUpdate(void); }; } diff --git a/lib/db_ido/db_ido-type.conf b/lib/db_ido/db_ido-type.conf index b9e6847f1..9272484cf 100644 --- a/lib/db_ido/db_ido-type.conf +++ b/lib/db_ido/db_ido-type.conf @@ -18,31 +18,31 @@ ******************************************************************************/ %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", } diff --git a/lib/db_ido/dbconnection.cpp b/lib/db_ido/dbconnection.cpp index 72d2088c8..7b2c45229 100644 --- a/lib/db_ido/dbconnection.cpp +++ b/lib/db_ido/dbconnection.cpp @@ -419,9 +419,8 @@ void DbConnection::ValidateFailoverTimeout(const String& location, const Diction 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."); } } diff --git a/lib/db_ido/dbconnection.hpp b/lib/db_ido/dbconnection.hpp index e800bfdcb..b0812250d 100644 --- a/lib/db_ido/dbconnection.hpp +++ b/lib/db_ido/dbconnection.hpp @@ -63,10 +63,10 @@ public: 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); @@ -85,7 +85,7 @@ protected: private: std::map m_ObjectIDs; std::map, DbReference> m_InsertIDs; - std::map m_NotificationInsertIDs; + std::map m_NotificationInsertIDs; std::set m_ActiveObjects; std::set m_ConfigUpdates; std::set m_StatusUpdates; diff --git a/lib/db_ido/dbevents.cpp b/lib/db_ido/dbevents.cpp index 691511b0c..038b9657a 100644 --- a/lib/db_ido/dbevents.cpp +++ b/lib/db_ido/dbevents.cpp @@ -1087,18 +1087,18 @@ void DbEvents::AddFlappingLogHistory(const Checkable::Ptr& checkable, FlappingSt 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); diff --git a/lib/db_ido/dbevents.hpp b/lib/db_ido/dbevents.hpp index f21e925de..3044bebdf 100644 --- a/lib/db_ido/dbevents.hpp +++ b/lib/db_ido/dbevents.hpp @@ -71,16 +71,16 @@ public: 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); @@ -102,34 +102,34 @@ public: 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& users, NotificationType type, const CheckResult::Ptr& cr, const String& author, - const String& text); + const std::set& 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& arguments); + static void AddEventHandlerHistory(const Checkable::Ptr& checkable); + static void AddExternalCommandHistory(double time, const String& command, const std::vector& arguments); private: DbEvents(void); diff --git a/lib/db_ido/endpointdbobject.hpp b/lib/db_ido/endpointdbobject.hpp index d65665371..e11fe1b85 100644 --- a/lib/db_ido/endpointdbobject.hpp +++ b/lib/db_ido/endpointdbobject.hpp @@ -39,17 +39,17 @@ public: EndpointDbObject(const shared_ptr& 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); }; } diff --git a/lib/db_ido/userdbobject.hpp b/lib/db_ido/userdbobject.hpp index 4156ee4e0..6ad2225a4 100644 --- a/lib/db_ido/userdbobject.hpp +++ b/lib/db_ido/userdbobject.hpp @@ -41,7 +41,7 @@ public: 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; }; diff --git a/lib/icinga/checkable.hpp b/lib/icinga/checkable.hpp index b5905da07..f21f3f6db 100644 --- a/lib/icinga/checkable.hpp +++ b/lib/icinga/checkable.hpp @@ -190,7 +190,7 @@ public: 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); diff --git a/lib/icinga/cib.hpp b/lib/icinga/cib.hpp index fc3d99761..8269f9250 100644 --- a/lib/icinga/cib.hpp +++ b/lib/icinga/cib.hpp @@ -37,25 +37,25 @@ struct CheckableCheckStatistics { }; 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; }; /** @@ -79,12 +79,12 @@ public: 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 GetFeatureStats(void); + static std::pair GetFeatureStats(void); private: CIB(void); diff --git a/lib/icinga/compatutility.cpp b/lib/icinga/compatutility.cpp index 6fa8700ff..93b6364f2 100644 --- a/lib/icinga/compatutility.cpp +++ b/lib/icinga/compatutility.cpp @@ -314,8 +314,8 @@ int CompatUtility::GetCheckableIsAcknowledged(const Checkable::Ptr& checkable) 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; } diff --git a/lib/icinga/compatutility.hpp b/lib/icinga/compatutility.hpp index 4670334d0..1c2f9336f 100644 --- a/lib/icinga/compatutility.hpp +++ b/lib/icinga/compatutility.hpp @@ -49,7 +49,7 @@ public: 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); @@ -62,7 +62,7 @@ public: 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); diff --git a/lib/icinga/externalcommandprocessor.hpp b/lib/icinga/externalcommandprocessor.hpp index 309a02855..f543b8523 100644 --- a/lib/icinga/externalcommandprocessor.hpp +++ b/lib/icinga/externalcommandprocessor.hpp @@ -127,10 +127,10 @@ private: static void ChangeSvcModattr(double time, const std::vector& arguments); static void ChangeHostModattr(double time, const std::vector& arguments); - static void ChangeUserModattr(double time, const std::vector& arguments); - static void ChangeCheckcommandModattr(double time, const std::vector& arguments); - static void ChangeEventcommandModattr(double time, const std::vector& arguments); - static void ChangeNotificationcommandModattr(double time, const std::vector& arguments); + static void ChangeUserModattr(double time, const std::vector& arguments); + static void ChangeCheckcommandModattr(double time, const std::vector& arguments); + static void ChangeEventcommandModattr(double time, const std::vector& arguments); + static void ChangeNotificationcommandModattr(double time, const std::vector& arguments); static void ChangeNormalSvcCheckInterval(double time, const std::vector& arguments); static void ChangeNormalHostCheckInterval(double time, const std::vector& arguments); @@ -148,12 +148,12 @@ private: static void ChangeMaxSvcCheckAttempts(double time, const std::vector& arguments); static void ChangeHostCheckTimeperiod(double time, const std::vector& arguments); static void ChangeSvcCheckTimeperiod(double time, const std::vector& arguments); - static void ChangeCustomHostVar(double time, const std::vector& arguments); - static void ChangeCustomSvcVar(double time, const std::vector& arguments); - static void ChangeCustomUserVar(double time, const std::vector& arguments); - static void ChangeCustomCheckcommandVar(double time, const std::vector& arguments); - static void ChangeCustomEventcommandVar(double time, const std::vector& arguments); - static void ChangeCustomNotificationcommandVar(double time, const std::vector& arguments); + static void ChangeCustomHostVar(double time, const std::vector& arguments); + static void ChangeCustomSvcVar(double time, const std::vector& arguments); + static void ChangeCustomUserVar(double time, const std::vector& arguments); + static void ChangeCustomCheckcommandVar(double time, const std::vector& arguments); + static void ChangeCustomEventcommandVar(double time, const std::vector& arguments); + static void ChangeCustomNotificationcommandVar(double time, const std::vector& arguments); static void EnableHostgroupHostNotifications(double time, const std::vector& arguments); static void EnableHostgroupSvcNotifications(double time, const std::vector& arguments); @@ -165,8 +165,8 @@ private: static void DisableServicegroupSvcNotifications(double time, const std::vector& 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); }; } diff --git a/lib/icinga/hostgroup.cpp b/lib/icinga/hostgroup.cpp index 144b9a986..cb6cd209e 100644 --- a/lib/icinga/hostgroup.cpp +++ b/lib/icinga/hostgroup.cpp @@ -34,10 +34,10 @@ INITIALIZE_ONCE(&HostGroup::RegisterObjectRuleHandler); 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(); diff --git a/lib/icinga/hostgroup.hpp b/lib/icinga/hostgroup.hpp index 76cf9c759..69c39a789 100644 --- a/lib/icinga/hostgroup.hpp +++ b/lib/icinga/hostgroup.hpp @@ -44,17 +44,17 @@ public: 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 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& rules); + static void EvaluateObjectRules(const std::vector& rules); }; } diff --git a/lib/icinga/icinga-type.conf b/lib/icinga/icinga-type.conf index 7f98f5deb..de9861f6c 100644 --- a/lib/icinga/icinga-type.conf +++ b/lib/icinga/icinga-type.conf @@ -21,8 +21,8 @@ } %type IcingaStatusWriter { - %attribute %string "status_path", - %attribute %number "update_interval" + %attribute %string "status_path", + %attribute %number "update_interval" } %type Checkable { diff --git a/lib/icinga/icingaapplication.hpp b/lib/icinga/icingaapplication.hpp index 00aa3e7c9..7071c4a25 100644 --- a/lib/icinga/icingaapplication.hpp +++ b/lib/icinga/icingaapplication.hpp @@ -42,13 +42,13 @@ public: 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; diff --git a/lib/icinga/icingastatuswriter.cpp b/lib/icinga/icingastatuswriter.cpp index 807c3817e..9ab93b54f 100644 --- a/lib/icinga/icingastatuswriter.cpp +++ b/lib/icinga/icingastatuswriter.cpp @@ -143,29 +143,29 @@ void IcingaStatusWriter::StatusTimerHandler(void) { 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"); } diff --git a/lib/icinga/servicegroup.cpp b/lib/icinga/servicegroup.cpp index d02719c07..6a00651e9 100644 --- a/lib/icinga/servicegroup.cpp +++ b/lib/icinga/servicegroup.cpp @@ -34,10 +34,10 @@ INITIALIZE_ONCE(&ServiceGroup::RegisterObjectRuleHandler); 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(); diff --git a/lib/icinga/servicegroup.hpp b/lib/icinga/servicegroup.hpp index b025a137c..8bffe6de4 100644 --- a/lib/icinga/servicegroup.hpp +++ b/lib/icinga/servicegroup.hpp @@ -44,17 +44,17 @@ public: 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 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& rules); + static void EvaluateObjectRules(const std::vector& rules); }; } diff --git a/lib/icinga/usergroup.cpp b/lib/icinga/usergroup.cpp index 6b8da4dcf..a9d5a96b3 100644 --- a/lib/icinga/usergroup.cpp +++ b/lib/icinga/usergroup.cpp @@ -34,10 +34,10 @@ INITIALIZE_ONCE(&UserGroup::RegisterObjectRuleHandler); 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(); diff --git a/lib/icinga/usergroup.hpp b/lib/icinga/usergroup.hpp index 9e9d6c1ed..9570161d0 100644 --- a/lib/icinga/usergroup.hpp +++ b/lib/icinga/usergroup.hpp @@ -44,17 +44,17 @@ public: 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 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& rules); + static void EvaluateObjectRules(const std::vector& rules); }; } diff --git a/lib/methods/clusterchecktask.hpp b/lib/methods/clusterchecktask.hpp index 9ca3b3780..e6902bfbf 100644 --- a/lib/methods/clusterchecktask.hpp +++ b/lib/methods/clusterchecktask.hpp @@ -37,7 +37,7 @@ public: private: ClusterCheckTask(void); - static String FormatArray(const Array::Ptr& arr); + static String FormatArray(const Array::Ptr& arr); }; } diff --git a/lib/methods/plugineventtask.hpp b/lib/methods/plugineventtask.hpp index 5a71ee1ca..35fc1a97a 100644 --- a/lib/methods/plugineventtask.hpp +++ b/lib/methods/plugineventtask.hpp @@ -40,7 +40,7 @@ public: 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); }; }