mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Make sure the next check timestamp can't be in the past.
This commit is contained in:
parent
6698d09a72
commit
eb7d9e96f8
@ -266,6 +266,9 @@ void ExternalCommandProcessor::ScheduleHostCheck(double, const std::vector<Strin
|
|||||||
|
|
||||||
Log(LogInformation, "icinga", "Rescheduling next check for host '" + arguments[0] + "'");
|
Log(LogInformation, "icinga", "Rescheduling next check for host '" + arguments[0] + "'");
|
||||||
|
|
||||||
|
if (planned_check < Utility::GetTime())
|
||||||
|
planned_check = Utility::GetTime();
|
||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(hc);
|
ObjectLock olock(hc);
|
||||||
|
|
||||||
@ -315,6 +318,9 @@ void ExternalCommandProcessor::ScheduleSvcCheck(double, const std::vector<String
|
|||||||
|
|
||||||
Log(LogInformation, "icinga", "Rescheduling next check for service '" + arguments[1] + "'");
|
Log(LogInformation, "icinga", "Rescheduling next check for service '" + arguments[1] + "'");
|
||||||
|
|
||||||
|
if (planned_check < Utility::GetTime())
|
||||||
|
planned_check = Utility::GetTime();
|
||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(service);
|
ObjectLock olock(service);
|
||||||
|
|
||||||
@ -453,6 +459,9 @@ void ExternalCommandProcessor::ScheduleHostSvcChecks(double, const std::vector<S
|
|||||||
|
|
||||||
Host::Ptr host = Host::GetByName(arguments[0]);
|
Host::Ptr host = Host::GetByName(arguments[0]);
|
||||||
|
|
||||||
|
if (planned_check < Utility::GetTime())
|
||||||
|
planned_check = Utility::GetTime();
|
||||||
|
|
||||||
BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) {
|
BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) {
|
||||||
if (planned_check > service->GetNextCheck()) {
|
if (planned_check > service->GetNextCheck()) {
|
||||||
Log(LogInformation, "icinga", "Ignoring reschedule request for service '" +
|
Log(LogInformation, "icinga", "Ignoring reschedule request for service '" +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user