# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
mkclass_target(clusterlistener.ti clusterlistener.th)
-mkclass_target(endpoint.ti endpoint.th)
mkembedconfig_target(cluster-type.conf cluster-type.cpp)
add_library(cluster SHARED
clusterchecktask.cpp clusterlistener.cpp clusterlistener.th
- endpoint.cpp endpoint.th jsonrpc.cpp cluster-type.cpp
+ cluster-type.cpp
)
-target_link_libraries(cluster ${Boost_LIBRARIES} base config icinga)
+target_link_libraries(cluster ${Boost_LIBRARIES} base config icinga remote)
set_target_properties (
cluster PROPERTIES
%attribute name(Endpoint) "*"
}
}
-
-type Endpoint {
- %require "host",
- %attribute string "host",
-
- %require "port",
- %attribute string "port",
-
- %attribute array "config_files" {
- %attribute string "*"
- },
-
- %attribute array "config_files_recursive" {
- %attribute string "*",
- %attribute dictionary "*" {
- %attribute string "path",
- %attribute string "pattern"
- }
- },
-
- %attribute array "accept_config" {
- %attribute name(Endpoint) "*"
- }
-}
******************************************************************************/
#include "cluster/clusterchecktask.h"
-#include "cluster/endpoint.h"
#include "cluster/clusterlistener.h"
+#include "remote/endpoint.h"
#include "icinga/cib.h"
#include "icinga/service.h"
#include "icinga/icingaapplication.h"
******************************************************************************/
#include "cluster/clusterlistener.h"
-#include "cluster/endpoint.h"
+#include "remote/endpoint.h"
#include "icinga/cib.h"
#include "icinga/domain.h"
#include "icinga/icingaapplication.h"
#include "base/stdiostream.h"
#include "base/workqueue.h"
#include "icinga/service.h"
-#include "cluster/endpoint.h"
+#include "remote/endpoint.h"
namespace icinga
{
add_subdirectory(db_ido)
add_subdirectory(methods)
add_subdirectory(hello)
+add_subdirectory(remote)
#include "db_ido/dbtype.h"
#include "db_ido/dbvalue.h"
#include "icinga/service.h"
-#include "cluster/endpoint.h"
+#include "remote/endpoint.h"
#include "base/dynamictype.h"
#include "base/objectlock.h"
#include "base/utility.h"
#include "db_ido/dbobject.h"
#include "base/dynamicobject.h"
-#include "cluster/endpoint.h"
+#include "remote/endpoint.h"
namespace icinga
{
--- /dev/null
+# Icinga 2
+# Copyright (C) 2012-present Icinga Development Team (http://www.icinga.org)
+#
+# 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(endpoint.ti endpoint.th)
+
+mkembedconfig_target(remote-type.conf remote-type.cpp)
+
+add_library(remote SHARED
+ endpoint.cpp endpoint.th jsonrpc.cpp remote-type.cpp
+)
+
+target_link_libraries(remote ${Boost_LIBRARIES} base config)
+
+set_target_properties (
+ icinga PROPERTIES
+ INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
+ DEFINE_SYMBOL I2_ICINGA_BUILD
+ FOLDER Lib
+)
+
+install(
+ TARGETS remote
+ RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
+)
+
+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/
-#include "cluster/endpoint.h"
-#include "cluster/jsonrpc.h"
+#include "remote/endpoint.h"
+#include "remote/jsonrpc.h"
#include "base/application.h"
#include "base/dynamictype.h"
#include "base/objectlock.h"
thread.detach();
OnConnected(GetSelf());
- Log(LogWarning, "cluster", "Endpoint connected: " + GetName());
+ Log(LogWarning, "remote", "Endpoint connected: " + GetName());
} else {
OnDisconnected(GetSelf());
- Log(LogWarning, "cluster", "Endpoint disconnected: " + GetName());
+ Log(LogWarning, "remote", "Endpoint disconnected: " + GetName());
}
}
} catch (const std::exception& ex) {
std::ostringstream msgbuf;
msgbuf << "Error while sending JSON-RPC message for endpoint '" << GetName() << "': " << DiagnosticInformation(ex);
- Log(LogWarning, "cluster", msgbuf.str());
+ Log(LogWarning, "remote", msgbuf.str());
m_Client.reset();
OnDisconnected(GetSelf());
- Log(LogWarning, "cluster", "Endpoint disconnected: " + GetName());
+ Log(LogWarning, "remote", "Endpoint disconnected: " + GetName());
}
}
try {
message = JsonRpc::ReadMessage(stream);
} catch (const std::exception& ex) {
- Log(LogWarning, "cluster", "Error while reading JSON-RPC message for endpoint '" + GetName() + "': " + DiagnosticInformation(ex));
+ Log(LogWarning, "remote", "Error while reading JSON-RPC message for endpoint '" + GetName() + "': " + DiagnosticInformation(ex));
m_Client.reset();
OnDisconnected(GetSelf());
- Log(LogWarning, "cluster", "Endpoint disconnected: " + GetName());
+ Log(LogWarning, "remote", "Endpoint disconnected: " + GetName());
return;
}
#ifndef ENDPOINT_H
#define ENDPOINT_H
-#include "cluster/endpoint.th"
+#include "remote/endpoint.th"
#include "base/stream.h"
#include "base/array.h"
#include <boost/signals2.hpp>
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/
-#include "cluster/jsonrpc.h"
+#include "remote/jsonrpc.h"
#include "base/netstring.h"
#include "base/objectlock.h"
#include "base/logger_fwd.h"
/**
* A JSON-RPC connection.
*
- * @ingroup cluster
+ * @ingroup remote
*/
class JsonRpc
{
--- /dev/null
+/******************************************************************************
+ * Icinga 2 *
+ * Copyright (C) 2012-present Icinga Development Team (http://www.icinga.org) *
+ * *
+ * 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. *
+ ******************************************************************************/
+
+type Endpoint {
+ %require "host",
+ %attribute string "host",
+
+ %require "port",
+ %attribute string "port",
+
+ %attribute array "config_files" {
+ %attribute string "*"
+ },
+
+ %attribute array "config_files_recursive" {
+ %attribute string "*",
+ %attribute dictionary "*" {
+ %attribute string "path",
+ %attribute string "pattern"
+ }
+ },
+
+ %attribute array "accept_config" {
+ %attribute name(Endpoint) "*"
+ }
+}