mirror of https://github.com/Icinga/icinga2.git
Remove libdemo and libhello
This commit is contained in:
parent
c2fedb3076
commit
0354f34e5a
|
@ -32,8 +32,6 @@ option(ICINGA2_WITH_MYSQL "Build the MySQL IDO module" ON)
|
|||
option(ICINGA2_WITH_PGSQL "Build the PostgreSQL IDO module" ON)
|
||||
option(ICINGA2_WITH_CHECKER "Build the checker module" ON)
|
||||
option(ICINGA2_WITH_COMPAT "Build the compat module" ON)
|
||||
option(ICINGA2_WITH_DEMO "Build the demo module" OFF)
|
||||
option(ICINGA2_WITH_HELLO "Build the hello module" OFF)
|
||||
option(ICINGA2_WITH_LIVESTATUS "Build the Livestatus module" ON)
|
||||
option(ICINGA2_WITH_NOTIFICATION "Build the notification module" ON)
|
||||
option(ICINGA2_WITH_PERFDATA "Build the perfdata module" ON)
|
||||
|
|
|
@ -96,27 +96,6 @@ install(
|
|||
RUNTIME DESTINATION ${InstallPath}
|
||||
)
|
||||
|
||||
if(ICINGA2_WITH_HELLO)
|
||||
add_executable(hello-app $<TARGET_OBJECTS:icingaloader>)
|
||||
add_whole_static_library(hello-app base)
|
||||
add_whole_static_library(hello-app config)
|
||||
add_whole_static_library(hello-app remote)
|
||||
add_whole_static_library(hello-app cli)
|
||||
add_whole_static_library(hello-app hello)
|
||||
|
||||
set_target_properties (
|
||||
hello-app PROPERTIES
|
||||
INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
|
||||
FOLDER Bin
|
||||
OUTPUT_NAME hello
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS hello-app
|
||||
RUNTIME DESTINATION ${InstallPath}
|
||||
)
|
||||
endif()
|
||||
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/icinga2\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/icinga2\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_RUNDIR}/icinga2\")")
|
||||
|
|
|
@ -22,10 +22,6 @@ add_subdirectory(remote)
|
|||
add_subdirectory(icinga)
|
||||
add_subdirectory(methods)
|
||||
|
||||
if(ICINGA2_WITH_HELLO)
|
||||
add_subdirectory(hello)
|
||||
endif()
|
||||
|
||||
if(ICINGA2_WITH_CHECKER)
|
||||
add_subdirectory(checker)
|
||||
endif()
|
||||
|
@ -60,10 +56,6 @@ if(ICINGA2_WITH_PGSQL)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(ICINGA2_WITH_DEMO)
|
||||
add_subdirectory(demo)
|
||||
endif()
|
||||
|
||||
if(ICINGA2_WITH_LIVESTATUS)
|
||||
add_subdirectory(livestatus)
|
||||
endif()
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
# 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.
|
||||
|
||||
mkclass_target(demo.ti demo.tcpp demo.thpp)
|
||||
|
||||
set(demo_SOURCES
|
||||
demo.cpp demo.hpp demo.thpp
|
||||
)
|
||||
|
||||
if(ICINGA2_UNITY_BUILD)
|
||||
mkunity_target(demo demo demo_SOURCES)
|
||||
endif()
|
||||
|
||||
add_library(demo STATIC ${demo_SOURCES})
|
||||
|
||||
target_link_libraries(demo ${Boost_LIBRARIES} base config icinga remote)
|
||||
|
||||
set_target_properties (
|
||||
demo PROPERTIES
|
||||
FOLDER Components
|
||||
)
|
|
@ -1,68 +0,0 @@
|
|||
/******************************************************************************
|
||||
* 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 "demo/demo.hpp"
|
||||
#include "demo/demo.tcpp"
|
||||
#include "remote/apilistener.hpp"
|
||||
#include "remote/apifunction.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
#include "base/logger.hpp"
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
REGISTER_TYPE(Demo);
|
||||
|
||||
REGISTER_APIFUNCTION(HelloWorld, demo, &Demo::DemoMessageHandler);
|
||||
|
||||
/**
|
||||
* Starts the component.
|
||||
*/
|
||||
void Demo::Start(bool runtimeCreated)
|
||||
{
|
||||
ObjectImpl<Demo>::Start(runtimeCreated);
|
||||
|
||||
m_DemoTimer = new Timer();
|
||||
m_DemoTimer->SetInterval(5);
|
||||
m_DemoTimer->OnTimerExpired.connect(std::bind(&Demo::DemoTimerHandler, this));
|
||||
m_DemoTimer->Start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Periodically broadcasts an API message.
|
||||
*/
|
||||
void Demo::DemoTimerHandler()
|
||||
{
|
||||
Dictionary::Ptr message = new Dictionary();
|
||||
message->Set("method", "demo::HelloWorld");
|
||||
|
||||
ApiListener::Ptr listener = ApiListener::GetInstance();
|
||||
if (listener) {
|
||||
MessageOrigin::Ptr origin = new MessageOrigin();
|
||||
listener->RelayMessage(origin, nullptr, message, true);
|
||||
Log(LogInformation, "Demo", "Sent demo::HelloWorld message");
|
||||
}
|
||||
}
|
||||
|
||||
Value Demo::DemoMessageHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr&)
|
||||
{
|
||||
Log(LogInformation, "Demo")
|
||||
<< "Got demo message from '" << origin->FromClient->GetEndpoint()->GetName() << "'";
|
||||
|
||||
return Empty;
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
/******************************************************************************
|
||||
* 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 DEMO_H
|
||||
#define DEMO_H
|
||||
|
||||
#include "demo/demo.thpp"
|
||||
#include "remote/messageorigin.hpp"
|
||||
#include "base/timer.hpp"
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
|
||||
/**
|
||||
* @ingroup demo
|
||||
*/
|
||||
class Demo final : public ObjectImpl<Demo>
|
||||
{
|
||||
public:
|
||||
DECLARE_OBJECT(Demo);
|
||||
DECLARE_OBJECTNAME(Demo);
|
||||
|
||||
void Start(bool runtimeCreated) override;
|
||||
|
||||
static Value DemoMessageHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params);
|
||||
|
||||
|
||||
private:
|
||||
Timer::Ptr m_DemoTimer;
|
||||
|
||||
void DemoTimerHandler();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* DEMO_H */
|
|
@ -1,31 +0,0 @@
|
|||
/******************************************************************************
|
||||
* 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 "base/configobject.hpp"
|
||||
|
||||
library demo;
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
|
||||
class Demo : ConfigObject
|
||||
{
|
||||
};
|
||||
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
# 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.
|
||||
|
||||
mkclass_target(helloapplication.ti helloapplication.tcpp helloapplication.thpp)
|
||||
|
||||
set(hello_SOURCES
|
||||
helloapplication.cpp helloapplication.hpp helloapplication.thpp
|
||||
)
|
||||
|
||||
if(ICINGA2_UNITY_BUILD)
|
||||
mkunity_target(hello hello hello_SOURCES)
|
||||
endif()
|
||||
|
||||
add_library(hello STATIC ${hello_SOURCES})
|
||||
|
||||
target_link_libraries(hello ${Boost_LIBRARIES} base config)
|
||||
|
||||
set_target_properties (
|
||||
hello PROPERTIES
|
||||
FOLDER Lib
|
||||
)
|
|
@ -1,44 +0,0 @@
|
|||
/******************************************************************************
|
||||
* 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 "hello/helloapplication.hpp"
|
||||
#include "hello/helloapplication.tcpp"
|
||||
#include "base/initialize.hpp"
|
||||
#include "base/logger.hpp"
|
||||
#include "base/scriptglobal.hpp"
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
REGISTER_TYPE(HelloApplication);
|
||||
|
||||
INITIALIZE_ONCE([]() {
|
||||
ScriptGlobal::Set("ApplicationType", "HelloApplication");
|
||||
});
|
||||
|
||||
/**
|
||||
* The entry point for the hello application.
|
||||
*
|
||||
* @returns An exit status.
|
||||
*/
|
||||
int HelloApplication::Main()
|
||||
{
|
||||
Log(LogInformation, "HelloApplication", "Hello World!");
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
/******************************************************************************
|
||||
* 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 HELLOAPPLICATION_H
|
||||
#define HELLOAPPLICATION_H
|
||||
|
||||
#include "hello/helloapplication.thpp"
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
|
||||
/**
|
||||
* The hello application.
|
||||
*
|
||||
* @ingroup hello
|
||||
*/
|
||||
class HelloApplication final : public ObjectImpl<HelloApplication>
|
||||
{
|
||||
public:
|
||||
DECLARE_OBJECT(HelloApplication);
|
||||
DECLARE_OBJECTNAME(HelloApplication);
|
||||
|
||||
int Main() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* HELLOAPPLICATION_H */
|
|
@ -1,31 +0,0 @@
|
|||
/******************************************************************************
|
||||
* 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 "base/application.hpp"
|
||||
|
||||
library hello;
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
|
||||
class HelloApplication : Application
|
||||
{
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in New Issue