summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQiuwen Lu <[email protected]>2020-09-19 15:59:14 +0800
committer陆秋文 <[email protected]>2020-09-19 16:02:46 +0800
commiteedca2990e249e7192a3374b8d12b940d6f523ae (patch)
tree9fb39e3a106d3e313437f4f6dd2470340fb7923c
parent51d4f97db7ba463e3c6109928a4373dd66e3a054 (diff)
调整CMakeLists.txt,增加APM服务的定义、样例配置文件。v4.3.27-20200919
-rw-r--r--cmake/Package.cmake1
-rw-r--r--conf/CMakeLists.txt1
-rw-r--r--conf/mrapm.conf4
-rw-r--r--tools/monit_device/monit_device.py2
-rw-r--r--tools/monit_stream/monit_stream.py2
-rw-r--r--tools/systemd/CMakeLists.txt8
-rw-r--r--tools/systemd/mrapm_device.service.in13
-rw-r--r--tools/systemd/mrapm_stream.service.in12
8 files changed, 39 insertions, 4 deletions
diff --git a/cmake/Package.cmake b/cmake/Package.cmake
index 37ea68a..2531aa6 100644
--- a/cmake/Package.cmake
+++ b/cmake/Package.cmake
@@ -34,5 +34,6 @@ endif()
# setup %config(noreplace)
set(CPACK_RPM_USER_FILELIST "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/etc/mrglobal.conf"
"%config(noreplace) ${CMAKE_INSTALL_PREFIX}/etc/mrtunnat.conf"
+ "%config(noreplace) ${CMAKE_INSTALL_PREFIX}/etc/mrapm.conf"
"%config(noreplace) /etc/sysconfig/mrzcpd")
include(CPack)
diff --git a/conf/CMakeLists.txt b/conf/CMakeLists.txt
index b0c0eba..e4d76c8 100644
--- a/conf/CMakeLists.txt
+++ b/conf/CMakeLists.txt
@@ -6,6 +6,7 @@ configure_file(mrzcpd.sh.in mrzcpd.sh)
install(FILES mrglobal.conf DESTINATION etc COMPONENT Profile)
install(FILES mrtunnat.conf DESTINATION etc COMPONENT Profile)
+install(FILES mrapm.conf DESTINATION etc COMPONENT Profile)
install(FILES ${CMAKE_BINARY_DIR}/conf/mrzcpd.conf DESTINATION ${MR_INSTALL_LDCONFDIR} COMPONENT Profile)
install(FILES ${CMAKE_BINARY_DIR}/conf/mrzcpd.pc DESTINATION ${MR_INSTALL_LIBDIR}/pkgconfig COMPONENT Profile)
install(FILES ${CMAKE_BINARY_DIR}/conf/mrzcpd DESTINATION ${MR_INSTALL_SYSUNITCONFDIR} COMPONENT Profile)
diff --git a/conf/mrapm.conf b/conf/mrapm.conf
new file mode 100644
index 0000000..d4ae4f1
--- /dev/null
+++ b/conf/mrapm.conf
@@ -0,0 +1,4 @@
+[sendlog_apm]
+apm_device_server=udp://127.0.0.1:8100
+apm_stream_server=udp://127.0.0.1:8100
+apm_send_interval=15 \ No newline at end of file
diff --git a/tools/monit_device/monit_device.py b/tools/monit_device/monit_device.py
index 299f81b..4e82bcc 100644
--- a/tools/monit_device/monit_device.py
+++ b/tools/monit_device/monit_device.py
@@ -142,7 +142,7 @@ def setup_argv_parser(phydev_list):
parser.add_argument('--sendlog-apm', help='send log to apm server',
action='store_true', default=0)
parser.add_argument('--sendlog-apm-cfg', help='send log configure file',
- type=str, default='/opt/mrzcpd/etc/mrsendlog.conf')
+ type=str, default='/opt/mrzcpd/etc/mrapm.conf')
return parser.parse_args()
diff --git a/tools/monit_stream/monit_stream.py b/tools/monit_stream/monit_stream.py
index e7a5840..9175ef0 100644
--- a/tools/monit_stream/monit_stream.py
+++ b/tools/monit_stream/monit_stream.py
@@ -291,7 +291,7 @@ def setup_argv_parser(applist):
parser.add_argument('--sendlog-apm', help='send log to apm server',
action='store_true', default=0)
parser.add_argument('--sendlog-apm-cfg', help='send log configure file',
- type=str, default='/opt/mrzcpd/etc/mrsendlog.conf')
+ type=str, default='/opt/mrzcpd/etc/mrapm.conf')
return parser.parse_args()
diff --git a/tools/systemd/CMakeLists.txt b/tools/systemd/CMakeLists.txt
index 96022a6..ea91982 100644
--- a/tools/systemd/CMakeLists.txt
+++ b/tools/systemd/CMakeLists.txt
@@ -1,7 +1,8 @@
configure_file(mrenv.service.in mrenv.service)
configure_file(mrzcpd.service.in mrzcpd.service)
configure_file(mrtunnat.service.in mrtunnat.service)
-configure_file(mrmonit.service.in mrmonit.service)
+configure_file(mrapm_device.service.in mrapm_device.service)
+configure_file(mrapm_stream.service.in mrapm_stream.service)
install(FILES ${CMAKE_BINARY_DIR}/tools/systemd/mrenv.service
DESTINATION ${MR_INSTALL_SYSUNITDIR} COMPONENT Program)
@@ -12,7 +13,10 @@ install(FILES ${CMAKE_BINARY_DIR}/tools/systemd/mrzcpd.service
install(FILES ${CMAKE_BINARY_DIR}/tools/systemd/mrtunnat.service
DESTINATION ${MR_INSTALL_SYSUNITDIR} COMPONENT Program)
-install(FILES ${CMAKE_BINARY_DIR}/tools/systemd/mrmonit.service
+install(FILES ${CMAKE_BINARY_DIR}/tools/systemd/mrapm_device.service
+ DESTINATION ${MR_INSTALL_SYSUNITDIR} COMPONENT Program)
+
+install(FILES ${CMAKE_BINARY_DIR}/tools/systemd/mrapm_stream.service
DESTINATION ${MR_INSTALL_SYSUNITDIR} COMPONENT Program)
install(PROGRAMS mrenv-script DESTINATION bin COMPONENT Program) \ No newline at end of file
diff --git a/tools/systemd/mrapm_device.service.in b/tools/systemd/mrapm_device.service.in
new file mode 100644
index 0000000..ab24e07
--- /dev/null
+++ b/tools/systemd/mrapm_device.service.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=Marsio APM logwritter(monit_device)
+After=network.target
+
+[Service]
+Type=simple
+ExecStartPre=/usr/bin/systemctl is-active mrzcpd
+ExecStart=@MR_INSTALL_BINDIR@/monit_device -l --sendlog-apm
+RestartSec=10s
+Restart=always
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file
diff --git a/tools/systemd/mrapm_stream.service.in b/tools/systemd/mrapm_stream.service.in
new file mode 100644
index 0000000..98e31fb
--- /dev/null
+++ b/tools/systemd/mrapm_stream.service.in
@@ -0,0 +1,12 @@
+[Unit]
+Description=Marsio APM logwritter(monit_stream)
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=@MR_INSTALL_BINDIR@/monit_stream -l --sendlog-apm -m rx tx ftx
+RestartSec=10s
+Restart=always
+
+[Install]
+WantedBy=multi-user.target \ No newline at end of file