mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
Add NotificationResult class
This commit is contained in:
parent
34e03644fb
commit
9621fd2e4b
@ -13,6 +13,7 @@ mkclass_target(host.ti host-ti.cpp host-ti.hpp)
|
|||||||
mkclass_target(icingaapplication.ti icingaapplication-ti.cpp icingaapplication-ti.hpp)
|
mkclass_target(icingaapplication.ti icingaapplication-ti.cpp icingaapplication-ti.hpp)
|
||||||
mkclass_target(customvarobject.ti customvarobject-ti.cpp customvarobject-ti.hpp)
|
mkclass_target(customvarobject.ti customvarobject-ti.cpp customvarobject-ti.hpp)
|
||||||
mkclass_target(notificationcommand.ti notificationcommand-ti.cpp notificationcommand-ti.hpp)
|
mkclass_target(notificationcommand.ti notificationcommand-ti.cpp notificationcommand-ti.hpp)
|
||||||
|
mkclass_target(notificationresult.ti notificationresult-ti.cpp notificationresult-ti.hpp)
|
||||||
mkclass_target(notification.ti notification-ti.cpp notification-ti.hpp)
|
mkclass_target(notification.ti notification-ti.cpp notification-ti.hpp)
|
||||||
mkclass_target(scheduleddowntime.ti scheduleddowntime-ti.cpp scheduleddowntime-ti.hpp)
|
mkclass_target(scheduleddowntime.ti scheduleddowntime-ti.cpp scheduleddowntime-ti.hpp)
|
||||||
mkclass_target(servicegroup.ti servicegroup-ti.cpp servicegroup-ti.hpp)
|
mkclass_target(servicegroup.ti servicegroup-ti.cpp servicegroup-ti.hpp)
|
||||||
@ -51,6 +52,7 @@ set(icinga_SOURCES
|
|||||||
macroresolver.hpp
|
macroresolver.hpp
|
||||||
notification.cpp notification.hpp notification-ti.hpp notification-apply.cpp
|
notification.cpp notification.hpp notification-ti.hpp notification-apply.cpp
|
||||||
notificationcommand.cpp notificationcommand.hpp notificationcommand-ti.hpp
|
notificationcommand.cpp notificationcommand.hpp notificationcommand-ti.hpp
|
||||||
|
notificationresult.cpp notificationresult.hpp notificationresult-ti.hpp
|
||||||
objectutils.cpp objectutils.hpp
|
objectutils.cpp objectutils.hpp
|
||||||
pluginutility.cpp pluginutility.hpp
|
pluginutility.cpp pluginutility.hpp
|
||||||
scheduleddowntime.cpp scheduleddowntime.hpp scheduleddowntime-ti.hpp scheduleddowntime-apply.cpp
|
scheduleddowntime.cpp scheduleddowntime.hpp scheduleddowntime-ti.hpp scheduleddowntime-apply.cpp
|
||||||
|
31
lib/icinga/notificationresult.cpp
Normal file
31
lib/icinga/notificationresult.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* 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. *
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
#include "icinga/notificationresult.hpp"
|
||||||
|
#include "icinga/notificationresult-ti.cpp"
|
||||||
|
#include "base/scriptglobal.hpp"
|
||||||
|
|
||||||
|
using namespace icinga;
|
||||||
|
|
||||||
|
REGISTER_TYPE(NotificationResult);
|
||||||
|
|
||||||
|
double NotificationResult::CalculateExecutionTime() const
|
||||||
|
{
|
||||||
|
return GetExecutionEnd() - GetExecutionStart();
|
||||||
|
}
|
44
lib/icinga/notificationresult.hpp
Normal file
44
lib/icinga/notificationresult.hpp
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* 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. *
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
#ifndef NOTIFICATIONRESULT_H
|
||||||
|
#define NOTIFICATIONRESULT_H
|
||||||
|
|
||||||
|
#include "icinga/i2-icinga.hpp"
|
||||||
|
#include "icinga/notificationresult-ti.hpp"
|
||||||
|
|
||||||
|
namespace icinga
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A notification result.
|
||||||
|
*
|
||||||
|
* @ingroup icinga
|
||||||
|
*/
|
||||||
|
class NotificationResult final : public ObjectImpl<NotificationResult>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DECLARE_OBJECT(NotificationResult);
|
||||||
|
|
||||||
|
double CalculateExecutionTime() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* NOTIFICATIONRESULT_H */
|
41
lib/icinga/notificationresult.ti
Normal file
41
lib/icinga/notificationresult.ti
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* 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. *
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
library icinga;
|
||||||
|
|
||||||
|
namespace icinga
|
||||||
|
{
|
||||||
|
|
||||||
|
class NotificationResult
|
||||||
|
{
|
||||||
|
[state] Timestamp execution_start;
|
||||||
|
[state] Timestamp execution_end;
|
||||||
|
|
||||||
|
[state] Value command;
|
||||||
|
[state] int exit_status;
|
||||||
|
[state] String output;
|
||||||
|
|
||||||
|
[state] bool active {
|
||||||
|
default {{{ return true; }}}
|
||||||
|
};
|
||||||
|
|
||||||
|
[state] String execution_endpoint;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user