]> granicus.if.org Git - icinga2/blobdiff - lib/icinga/checkable.hpp
Merge pull request #6727 from Icinga/feature/cluster-config-sync-stage
[icinga2] / lib / icinga / checkable.hpp
index 141d0a43c91bc1857895dc24f03c40e5c8610232..fcfb3f74bdbee0ef1cf36ff5cda682bbd5edbdd2 100644 (file)
@@ -1,21 +1,4 @@
-/******************************************************************************
- * Icinga 2                                                                   *
- * Copyright (C) 2012-2018 Icinga Development Team (https://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
@@ -62,6 +45,7 @@ enum SeverityFlag
 {
        SeverityFlagDowntime = 1,
        SeverityFlagAcknowledgement = 2,
+       SeverityFlagHostDown = 4,
        SeverityFlagUnhandled = 8,
        SeverityFlagPending = 16,
        SeverityFlagWarning = 32,
@@ -102,6 +86,8 @@ public:
        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;
@@ -113,7 +99,7 @@ public:
        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;
 
@@ -133,8 +119,8 @@ public:
        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;
@@ -192,6 +178,7 @@ public:
        std::vector<intrusive_ptr<Dependency> > GetReverseDependencies() const;
 
        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();