diff --git a/lib/methods/clusterzonechecktask.cpp b/lib/methods/clusterzonechecktask.cpp index 28e42f338..feaf00e33 100644 --- a/lib/methods/clusterzonechecktask.cpp +++ b/lib/methods/clusterzonechecktask.cpp @@ -137,6 +137,7 @@ void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const Che double messagesReceivedPerSecond = 0; double bytesSentPerSecond = 0; double bytesReceivedPerSecond = 0; + double secondsAwaitingMessages = 0; double secondsReadingMessages = 0; double secondsAwaitingSemaphore = 0; double secondsProcessingMessages = 0; @@ -163,6 +164,7 @@ void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const Che messagesReceivedPerSecond += endpoint->GetMessagesReceivedPerSecond(); bytesSentPerSecond += endpoint->GetBytesSentPerSecond(); bytesReceivedPerSecond += endpoint->GetBytesReceivedPerSecond(); + secondsAwaitingMessages += endpoint->GetSecondsAwaitingMessages(); secondsReadingMessages += endpoint->GetSecondsReadingMessages(); secondsAwaitingSemaphore += endpoint->GetSecondsAwaitingSemaphore(); secondsProcessingMessages += endpoint->GetSecondsProcessingMessages(); @@ -217,6 +219,7 @@ void ClusterZoneCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const Che new PerfdataValue("sum_messages_received_per_second", messagesReceivedPerSecond), new PerfdataValue("sum_bytes_sent_per_second", bytesSentPerSecond), new PerfdataValue("sum_bytes_received_per_second", bytesReceivedPerSecond), + new PerfdataValue("sum_seconds_awaiting_messages", secondsAwaitingMessages, true), new PerfdataValue("sum_seconds_reading_messages", secondsReadingMessages, true), new PerfdataValue("sum_seconds_awaiting_semaphore", secondsAwaitingSemaphore, true), new PerfdataValue("sum_seconds_processing_messages", secondsProcessingMessages, true) diff --git a/lib/methods/icingachecktask.cpp b/lib/methods/icingachecktask.cpp index 11b126ed4..972c8be53 100644 --- a/lib/methods/icingachecktask.cpp +++ b/lib/methods/icingachecktask.cpp @@ -127,6 +127,7 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes double messagesReceivedPerSecond = 0; double bytesSentPerSecond = 0; double bytesReceivedPerSecond = 0; + double secondsAwaitingMessages = 0; double secondsReadingMessages = 0; double secondsAwaitingSemaphore = 0; double secondsProcessingMessages = 0; @@ -143,6 +144,7 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes messagesReceivedPerSecond += endpoint->GetMessagesReceivedPerSecond(); bytesSentPerSecond += endpoint->GetBytesSentPerSecond(); bytesReceivedPerSecond += endpoint->GetBytesReceivedPerSecond(); + secondsAwaitingMessages += endpoint->GetSecondsAwaitingMessages(); secondsReadingMessages += endpoint->GetSecondsReadingMessages(); secondsAwaitingSemaphore += endpoint->GetSecondsAwaitingSemaphore(); secondsProcessingMessages += endpoint->GetSecondsProcessingMessages(); @@ -154,6 +156,7 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes perfdata->Add(new PerfdataValue("sum_messages_received_per_second", messagesReceivedPerSecond)); perfdata->Add(new PerfdataValue("sum_bytes_sent_per_second", bytesSentPerSecond)); perfdata->Add(new PerfdataValue("sum_bytes_received_per_second", bytesReceivedPerSecond)); + perfdata->Add(new PerfdataValue("sum_seconds_awaiting_messages", secondsAwaitingMessages, true)); perfdata->Add(new PerfdataValue("sum_seconds_reading_messages", secondsReadingMessages, true)); perfdata->Add(new PerfdataValue("sum_seconds_awaiting_semaphore", secondsAwaitingSemaphore, true)); perfdata->Add(new PerfdataValue("sum_seconds_processing_messages", secondsProcessingMessages, true)); diff --git a/lib/remote/endpoint.cpp b/lib/remote/endpoint.cpp index 67d53bc48..cddb5e6ba 100644 --- a/lib/remote/endpoint.cpp +++ b/lib/remote/endpoint.cpp @@ -137,6 +137,11 @@ double Endpoint::GetBytesReceivedPerSecond() const return m_BytesReceived.CalculateRate(Utility::GetTime(), 60); } +double Endpoint::GetSecondsAwaitingMessages() const +{ + return m_InputWaitTime; +} + double Endpoint::GetSecondsReadingMessages() const { return m_InputReadTime; diff --git a/lib/remote/endpoint.hpp b/lib/remote/endpoint.hpp index cae060c7f..fe8de16dd 100644 --- a/lib/remote/endpoint.hpp +++ b/lib/remote/endpoint.hpp @@ -58,6 +58,7 @@ public: double GetBytesSentPerSecond() const override; double GetBytesReceivedPerSecond() const override; + double GetSecondsAwaitingMessages() const override; double GetSecondsReadingMessages() const override; double GetSecondsAwaitingSemaphore() const override; double GetSecondsProcessingMessages() const override; diff --git a/lib/remote/endpoint.ti b/lib/remote/endpoint.ti index e10410cd3..c2bf2fb69 100644 --- a/lib/remote/endpoint.ti +++ b/lib/remote/endpoint.ti @@ -55,6 +55,10 @@ class Endpoint : ConfigObject get; }; + [no_user_modify, no_storage] double seconds_awaiting_messages { + get; + }; + [no_user_modify, no_storage] double seconds_reading_messages { get; };