2019-02-25 14:48:22 +01:00
|
|
|
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
2013-07-23 09:12:38 +02:00
|
|
|
|
|
|
|
#ifndef COMPATUTILITY_H
|
|
|
|
#define COMPATUTILITY_H
|
|
|
|
|
2014-05-25 16:23:35 +02:00
|
|
|
#include "icinga/i2-icinga.hpp"
|
|
|
|
#include "icinga/host.hpp"
|
|
|
|
#include "icinga/command.hpp"
|
2013-07-23 09:12:38 +02:00
|
|
|
|
|
|
|
namespace icinga
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Compatibility utility functions.
|
|
|
|
*
|
|
|
|
* @ingroup icinga
|
|
|
|
*/
|
2017-12-31 07:22:16 +01:00
|
|
|
class CompatUtility
|
2013-07-23 09:12:38 +02:00
|
|
|
{
|
|
|
|
public:
|
2014-05-12 14:30:15 +02:00
|
|
|
/* command */
|
|
|
|
static String GetCommandLine(const Command::Ptr& command);
|
2018-01-04 08:54:18 +01:00
|
|
|
static String GetCommandName(const Command::Ptr& command);
|
2013-07-30 18:17:13 +02:00
|
|
|
|
2013-12-05 14:54:16 +01:00
|
|
|
/* service */
|
2014-08-17 17:57:20 +02:00
|
|
|
static String GetCheckableCommandArgs(const Checkable::Ptr& checkable);
|
2014-04-03 15:36:13 +02:00
|
|
|
|
2013-12-05 14:54:16 +01:00
|
|
|
/* notification */
|
2014-04-03 15:36:13 +02:00
|
|
|
static int GetCheckableNotificationsEnabled(const Checkable::Ptr& checkable);
|
|
|
|
static int GetCheckableNotificationLastNotification(const Checkable::Ptr& checkable);
|
|
|
|
static int GetCheckableNotificationNextNotification(const Checkable::Ptr& checkable);
|
|
|
|
static int GetCheckableNotificationNotificationNumber(const Checkable::Ptr& checkable);
|
|
|
|
static double GetCheckableNotificationNotificationInterval(const Checkable::Ptr& checkable);
|
|
|
|
static int GetCheckableNotificationTypeFilter(const Checkable::Ptr& checkable);
|
|
|
|
static int GetCheckableNotificationStateFilter(const Checkable::Ptr& checkable);
|
|
|
|
|
|
|
|
static std::set<User::Ptr> GetCheckableNotificationUsers(const Checkable::Ptr& checkable);
|
|
|
|
static std::set<UserGroup::Ptr> GetCheckableNotificationUserGroups(const Checkable::Ptr& checkable);
|
2013-10-01 15:37:50 +02:00
|
|
|
|
2013-12-05 14:54:16 +01:00
|
|
|
/* check result */
|
|
|
|
static String GetCheckResultOutput(const CheckResult::Ptr& cr);
|
|
|
|
static String GetCheckResultLongOutput(const CheckResult::Ptr& cr);
|
2013-09-24 18:48:24 +02:00
|
|
|
|
2013-12-05 14:54:16 +01:00
|
|
|
/* misc */
|
2013-07-23 09:12:38 +02:00
|
|
|
static String EscapeString(const String& str);
|
2015-05-27 16:05:10 +02:00
|
|
|
static String UnEscapeString(const String& str);
|
2013-07-23 09:12:38 +02:00
|
|
|
|
|
|
|
private:
|
2018-01-04 04:25:35 +01:00
|
|
|
CompatUtility();
|
2014-05-12 14:30:15 +02:00
|
|
|
|
2018-01-04 08:54:18 +01:00
|
|
|
static String GetCommandNamePrefix(const Command::Ptr& command);
|
2013-07-23 09:12:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* COMPATUTILITY_H */
|