mirror of https://github.com/Icinga/icinga2.git
parent
99ce7981da
commit
fceeeba05e
|
@ -38,7 +38,7 @@ REGISTER_TYPE(CheckResultReader);
|
|||
|
||||
REGISTER_STATSFUNCTION(CheckResultReaderStats, &CheckResultReader::StatsFunc);
|
||||
|
||||
Value CheckResultReader::StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata)
|
||||
Value CheckResultReader::StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr&)
|
||||
{
|
||||
Dictionary::Ptr nodes = make_shared<Dictionary>();
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ REGISTER_SCRIPTFUNCTION(ValidateRotationMethod, &CompatLogger::ValidateRotationM
|
|||
|
||||
REGISTER_STATSFUNCTION(CompatLoggerStats, &CompatLogger::StatsFunc);
|
||||
|
||||
Value CompatLogger::StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata)
|
||||
Value CompatLogger::StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr&)
|
||||
{
|
||||
Dictionary::Ptr nodes = make_shared<Dictionary>();
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ REGISTER_TYPE(ExternalCommandListener);
|
|||
|
||||
REGISTER_STATSFUNCTION(ExternalCommandListenerStats, &ExternalCommandListener::StatsFunc);
|
||||
|
||||
Value ExternalCommandListener::StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata)
|
||||
Value ExternalCommandListener::StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr&)
|
||||
{
|
||||
Dictionary::Ptr nodes = make_shared<Dictionary>();
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ REGISTER_TYPE(StatusDataWriter);
|
|||
|
||||
REGISTER_STATSFUNCTION(StatusDataWriterStats, &StatusDataWriter::StatsFunc);
|
||||
|
||||
Value StatusDataWriter::StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata)
|
||||
Value StatusDataWriter::StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr&)
|
||||
{
|
||||
Dictionary::Ptr nodes = make_shared<Dictionary>();
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ void Demo::DemoTimerHandler(void)
|
|||
}
|
||||
}
|
||||
|
||||
Value Demo::DemoMessageHandler(const MessageOrigin& origin, const Dictionary::Ptr& params)
|
||||
Value Demo::DemoMessageHandler(const MessageOrigin& origin, const Dictionary::Ptr&)
|
||||
{
|
||||
Log(LogInformation, "demo", "Got demo message from '" + origin.FromClient->GetEndpoint()->GetName() + "'");
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ void CommentsTable::FetchRows(const AddRowFunction& addRowFn)
|
|||
}
|
||||
}
|
||||
|
||||
Object::Ptr CommentsTable::ServiceAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor)
|
||||
Object::Ptr CommentsTable::ServiceAccessor(const Value& row, const Column::ObjectAccessor&)
|
||||
{
|
||||
Comment::Ptr comment = static_cast<Comment::Ptr>(row);
|
||||
return Checkable::GetOwnerByCommentID(comment->GetId()); // XXX: this might return a Host object
|
||||
|
|
|
@ -71,7 +71,7 @@ void DowntimesTable::FetchRows(const AddRowFunction& addRowFn)
|
|||
}
|
||||
}
|
||||
|
||||
Object::Ptr DowntimesTable::ServiceAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor)
|
||||
Object::Ptr DowntimesTable::ServiceAccessor(const Value& row, const Column::ObjectAccessor&)
|
||||
{
|
||||
Downtime::Ptr downtime = static_cast<Downtime::Ptr>(row);
|
||||
return Service::GetOwnerByDowntimeID(downtime->GetId());
|
||||
|
|
|
@ -732,7 +732,7 @@ Value HostsTable::ActiveChecksEnabledAccessor(const Value& row)
|
|||
return CompatUtility::GetCheckableActiveChecksEnabled(host);
|
||||
}
|
||||
|
||||
Value HostsTable::CheckOptionsAccessor(const Value& row)
|
||||
Value HostsTable::CheckOptionsAccessor(const Value&)
|
||||
{
|
||||
/* TODO - forcexec, freshness, orphan, none */
|
||||
return Empty;
|
||||
|
|
|
@ -109,7 +109,7 @@ void LogTable::UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, int line
|
|||
addRowFn(log_entry_attrs);
|
||||
}
|
||||
|
||||
Object::Ptr LogTable::HostAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor)
|
||||
Object::Ptr LogTable::HostAccessor(const Value& row, const Column::ObjectAccessor&)
|
||||
{
|
||||
String host_name = static_cast<Dictionary::Ptr>(row)->Get("host_name");
|
||||
|
||||
|
@ -119,7 +119,7 @@ Object::Ptr LogTable::HostAccessor(const Value& row, const Column::ObjectAccesso
|
|||
return Host::GetByName(host_name);
|
||||
}
|
||||
|
||||
Object::Ptr LogTable::ServiceAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor)
|
||||
Object::Ptr LogTable::ServiceAccessor(const Value& row, const Column::ObjectAccessor&)
|
||||
{
|
||||
String host_name = static_cast<Dictionary::Ptr>(row)->Get("host_name");
|
||||
String service_description = static_cast<Dictionary::Ptr>(row)->Get("service_description");
|
||||
|
@ -130,7 +130,7 @@ Object::Ptr LogTable::ServiceAccessor(const Value& row, const Column::ObjectAcce
|
|||
return Service::GetByNamePair(host_name, service_description);
|
||||
}
|
||||
|
||||
Object::Ptr LogTable::ContactAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor)
|
||||
Object::Ptr LogTable::ContactAccessor(const Value& row, const Column::ObjectAccessor&)
|
||||
{
|
||||
String contact_name = static_cast<Dictionary::Ptr>(row)->Get("contact_name");
|
||||
|
||||
|
@ -140,7 +140,7 @@ Object::Ptr LogTable::ContactAccessor(const Value& row, const Column::ObjectAcce
|
|||
return User::GetByName(contact_name);
|
||||
}
|
||||
|
||||
Object::Ptr LogTable::CommandAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor)
|
||||
Object::Ptr LogTable::CommandAccessor(const Value& row, const Column::ObjectAccessor&)
|
||||
{
|
||||
String command_name = static_cast<Dictionary::Ptr>(row)->Get("command_name");
|
||||
|
||||
|
|
|
@ -270,7 +270,7 @@ void StateHistTable::FetchRows(const AddRowFunction& addRowFn)
|
|||
}
|
||||
}
|
||||
|
||||
Object::Ptr StateHistTable::HostAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor)
|
||||
Object::Ptr StateHistTable::HostAccessor(const Value& row, const Column::ObjectAccessor&)
|
||||
{
|
||||
String host_name = static_cast<Dictionary::Ptr>(row)->Get("host_name");
|
||||
|
||||
|
@ -280,7 +280,7 @@ Object::Ptr StateHistTable::HostAccessor(const Value& row, const Column::ObjectA
|
|||
return Host::GetByName(host_name);
|
||||
}
|
||||
|
||||
Object::Ptr StateHistTable::ServiceAccessor(const Value& row, const Column::ObjectAccessor& parentObjectAccessor)
|
||||
Object::Ptr StateHistTable::ServiceAccessor(const Value& row, const Column::ObjectAccessor&)
|
||||
{
|
||||
String host_name = static_cast<Dictionary::Ptr>(row)->Get("host_name");
|
||||
String service_description = static_cast<Dictionary::Ptr>(row)->Get("service_description");
|
||||
|
|
|
@ -213,7 +213,7 @@ Value StatusTable::LivestatusActiveConnectionsAccessor(const Value&)
|
|||
return LivestatusListener::GetClientsConnected();
|
||||
}
|
||||
|
||||
Value StatusTable::CustomVariableNamesAccessor(const Value& row)
|
||||
Value StatusTable::CustomVariableNamesAccessor(const Value&)
|
||||
{
|
||||
Dictionary::Ptr vars = IcingaApplication::GetInstance()->GetVars();
|
||||
|
||||
|
@ -231,7 +231,7 @@ Value StatusTable::CustomVariableNamesAccessor(const Value& row)
|
|||
return cv;
|
||||
}
|
||||
|
||||
Value StatusTable::CustomVariableValuesAccessor(const Value& row)
|
||||
Value StatusTable::CustomVariableValuesAccessor(const Value&)
|
||||
{
|
||||
Dictionary::Ptr vars = IcingaApplication::GetInstance()->GetVars();
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ REGISTER_TYPE(NotificationComponent);
|
|||
|
||||
REGISTER_STATSFUNCTION(NotificationComponentStats, &NotificationComponent::StatsFunc);
|
||||
|
||||
Value NotificationComponent::StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata)
|
||||
Value NotificationComponent::StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr&)
|
||||
{
|
||||
Dictionary::Ptr nodes = make_shared<Dictionary>();
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ REGISTER_TYPE(GraphiteWriter);
|
|||
|
||||
REGISTER_STATSFUNCTION(GraphiteWriterStats, &GraphiteWriter::StatsFunc);
|
||||
|
||||
Value GraphiteWriter::StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata)
|
||||
Value GraphiteWriter::StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr&)
|
||||
{
|
||||
Dictionary::Ptr nodes = make_shared<Dictionary>();
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ REGISTER_TYPE(PerfdataWriter);
|
|||
|
||||
REGISTER_STATSFUNCTION(PerfdataWriterStats, &PerfdataWriter::StatsFunc);
|
||||
|
||||
Value PerfdataWriter::StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr& perfdata)
|
||||
Value PerfdataWriter::StatsFunc(Dictionary::Ptr& status, Dictionary::Ptr&)
|
||||
{
|
||||
Dictionary::Ptr nodes = make_shared<Dictionary>();
|
||||
|
||||
|
|
|
@ -205,7 +205,7 @@ void DbConnection::CleanUpHandler(void)
|
|||
|
||||
}
|
||||
|
||||
void DbConnection::CleanUpExecuteQuery(const String& table, const String& time_column, double max_age)
|
||||
void DbConnection::CleanUpExecuteQuery(const String&, const String&, double)
|
||||
{
|
||||
/* Default handler does nothing. */
|
||||
}
|
||||
|
|
|
@ -650,7 +650,7 @@ void DbEvents::AddAcknowledgementHistory(const Checkable::Ptr& checkable, const
|
|||
fields1->Set("entry_time_usec", time_bag.second);
|
||||
fields1->Set("acknowledgement_type", type);
|
||||
fields1->Set("object_id", checkable);
|
||||
fields1->Set("state", service ? service->GetState() : host->GetState());
|
||||
fields1->Set("state", service ? static_cast<int>(service->GetState()) : static_cast<int>(host->GetState()));
|
||||
fields1->Set("author_name", author);
|
||||
fields1->Set("comment_data", comment);
|
||||
fields1->Set("is_sticky", type == AcknowledgementSticky ? 1 : 0);
|
||||
|
@ -741,7 +741,7 @@ void DbEvents::AddNotificationHistory(const Notification::Ptr& notification, con
|
|||
fields1->Set("start_time_usec", time_bag.second);
|
||||
fields1->Set("end_time", DbValue::FromTimestamp(time_bag.first));
|
||||
fields1->Set("end_time_usec", time_bag.second);
|
||||
fields1->Set("state", service ? service->GetState() : host->GetState());
|
||||
fields1->Set("state", service ? static_cast<int>(service->GetState()) : static_cast<int>(host->GetState()));
|
||||
|
||||
if (cr) {
|
||||
fields1->Set("output", CompatUtility::GetCheckResultOutput(cr));
|
||||
|
@ -807,7 +807,7 @@ void DbEvents::AddStateChangeHistory(const Checkable::Ptr& checkable, const Chec
|
|||
fields1->Set("state_time_usec", time_bag.second);
|
||||
fields1->Set("object_id", checkable);
|
||||
fields1->Set("state_change", 1); /* service */
|
||||
fields1->Set("state", service ? service->GetState() : host->GetState());
|
||||
fields1->Set("state", service ? static_cast<int>(service->GetState()) : static_cast<int>(host->GetState()));
|
||||
fields1->Set("state_type", checkable->GetStateType());
|
||||
fields1->Set("current_check_attempt", checkable->GetCheckAttempt());
|
||||
fields1->Set("max_check_attempts", checkable->GetMaxCheckAttempts());
|
||||
|
@ -1281,7 +1281,7 @@ void DbEvents::AddEventHandlerHistory(const Checkable::Ptr& checkable)
|
|||
|
||||
fields1->Set("eventhandler_type", service ? 1 : 0);
|
||||
fields1->Set("object_id", checkable);
|
||||
fields1->Set("state", service ? service->GetState() : host->GetState());
|
||||
fields1->Set("state", service ? static_cast<int>(service->GetState()) : static_cast<int>(host->GetState()));
|
||||
fields1->Set("state_type", checkable->GetStateType());
|
||||
|
||||
fields1->Set("start_time", DbValue::FromTimestamp(time_bag.first));
|
||||
|
|
|
@ -87,7 +87,7 @@ ServiceCheckStatistics CIB::CalculateServiceCheckStats(void)
|
|||
count_execution_time++;
|
||||
}
|
||||
|
||||
ServiceCheckStatistics scs = {0};
|
||||
ServiceCheckStatistics scs;
|
||||
|
||||
scs.min_latency = min_latency;
|
||||
scs.max_latency = max_latency;
|
||||
|
|
|
@ -27,16 +27,16 @@
|
|||
namespace icinga
|
||||
{
|
||||
|
||||
typedef struct {
|
||||
struct ServiceCheckStatistics {
|
||||
double min_latency;
|
||||
double max_latency;
|
||||
double avg_latency;
|
||||
double min_execution_time;
|
||||
double max_execution_time;
|
||||
double avg_execution_time;
|
||||
} ServiceCheckStatistics;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct ServiceStatistics {
|
||||
double services_ok;
|
||||
double services_warning;
|
||||
double services_critical;
|
||||
|
@ -46,9 +46,9 @@ typedef struct {
|
|||
double services_flapping;
|
||||
double services_in_downtime;
|
||||
double services_acknowledged;
|
||||
} ServiceStatistics;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct HostStatistics {
|
||||
double hosts_up;
|
||||
double hosts_down;
|
||||
double hosts_unreachable;
|
||||
|
@ -56,7 +56,7 @@ typedef struct {
|
|||
double hosts_flapping;
|
||||
double hosts_in_downtime;
|
||||
double hosts_acknowledged;
|
||||
} HostStatistics;
|
||||
};
|
||||
|
||||
/**
|
||||
* Common Information Base class. Holds some statistics (and will likely be
|
||||
|
|
|
@ -204,7 +204,7 @@ void ApiListener::NewClientHandler(const Socket::Ptr& client, ConnectionRole rol
|
|||
|
||||
Endpoint::Ptr endpoint = Endpoint::GetByName(identity);
|
||||
|
||||
bool need_sync;
|
||||
bool need_sync = false;
|
||||
|
||||
if (endpoint)
|
||||
need_sync = !endpoint->IsConnected();
|
||||
|
|
|
@ -53,10 +53,10 @@ static void lb_init(lex_buf *lb)
|
|||
lb->size = 0;
|
||||
}
|
||||
|
||||
static void lb_cleanup(lex_buf *lb)
|
||||
/*static void lb_cleanup(lex_buf *lb)
|
||||
{
|
||||
free(lb->buf);
|
||||
}
|
||||
}*/
|
||||
|
||||
static void lb_append_char(lex_buf *lb, char new_char)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue