-/******************************************************************************
- * Icinga 2 *
- * Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License *
- * as published by the Free Software Foundation; either version 2 *
- * of the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software Foundation *
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
- ******************************************************************************/
+/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
#ifndef CHECKABLE_H
#define CHECKABLE_H
#include "icinga/i2-icinga.hpp"
-#include "icinga/checkable.thpp"
+#include "icinga/checkable-ti.hpp"
#include "icinga/timeperiod.hpp"
#include "icinga/notification.hpp"
#include "icinga/comment.hpp"
{
SeverityFlagDowntime = 1,
SeverityFlagAcknowledgement = 2,
+ SeverityFlagHostDown = 4,
SeverityFlagUnhandled = 8,
SeverityFlagPending = 16,
SeverityFlagWarning = 32,
void ClearAcknowledgement(const MessageOrigin::Ptr& origin = nullptr);
int GetSeverity() const override;
+ bool GetProblem() const override;
+ bool GetHandled() const override;
/* Checks */
intrusive_ptr<CheckCommand> GetCheckCommand() const;
void UpdateNextCheck(const MessageOrigin::Ptr& origin = nullptr);
bool HasBeenChecked() const;
- virtual bool IsStateOK(ServiceState state) = 0;
+ virtual bool IsStateOK(ServiceState state) const = 0;
double GetLastCheck() const final;
static boost::signals2::signal<void (const Checkable::Ptr&, NotificationType, const CheckResult::Ptr&,
const String&, const String&, const MessageOrigin::Ptr&)> OnNotificationsRequested;
static boost::signals2::signal<void (const Notification::Ptr&, const Checkable::Ptr&, const User::Ptr&,
- const NotificationType&, const CheckResult::Ptr&, const String&, const String&, const String&,
- const MessageOrigin::Ptr&)> OnNotificationSentToUser;
+ const NotificationType&, const CheckResult::Ptr&, const NotificationResult::Ptr&, const String&,
+ const String&, const String&, const MessageOrigin::Ptr&)> OnNotificationSentToUser;
static boost::signals2::signal<void (const Notification::Ptr&, const Checkable::Ptr&, const std::set<User::Ptr>&,
const NotificationType&, const CheckResult::Ptr&, const String&,
const String&, const MessageOrigin::Ptr&)> OnNotificationSentToAllUsers;
void RemoveReverseDependency(const intrusive_ptr<Dependency>& dep);
std::vector<intrusive_ptr<Dependency> > GetReverseDependencies() const;
- void ValidateCheckInterval(double value, const ValidationUtils& utils) final;
- void ValidateMaxCheckAttempts(int value, const ValidationUtils& utils) final;
+ void ValidateCheckInterval(const Lazy<double>& lvalue, const ValidationUtils& value) final;
+ void ValidateRetryInterval(const Lazy<double>& lvalue, const ValidationUtils& value) final;
+ void ValidateMaxCheckAttempts(const Lazy<int>& lvalue, const ValidationUtils& value) final;
static void IncreasePendingChecks();
static void DecreasePendingChecks();
static int GetPendingChecks();
+ static void AquirePendingCheckSlot(int maxPendingChecks);
static Object::Ptr GetPrototype();
static boost::mutex m_StatsMutex;
static int m_PendingChecks;
+ static boost::condition_variable m_PendingChecksCV;
/* Downtimes */
std::set<Downtime::Ptr> m_Downtimes;