From fb43b03b2c2e455d4941f6d74be031ee2c76169d Mon Sep 17 00:00:00 2001 From: 710leo <710leo@gmail.com> Date: Tue, 24 Mar 2020 20:41:21 +0800 Subject: [PATCH] refactor: change collect config path --- etc/port/20_2058 | 1 + etc/port/20_22 | 1 - etc/port/20_5800 | 1 + etc/port/20_5810 | 1 + etc/port/20_5820 | 1 + etc/port/20_5830 | 1 + etc/port/20_5840 | 1 + src/modules/collector/config/config.go | 8 ++++---- 8 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 etc/port/20_2058 delete mode 100644 etc/port/20_22 create mode 100644 etc/port/20_5800 create mode 100644 etc/port/20_5810 create mode 100644 etc/port/20_5820 create mode 100644 etc/port/20_5830 create mode 100644 etc/port/20_5840 diff --git a/etc/port/20_2058 b/etc/port/20_2058 new file mode 100644 index 00000000..a8f83c1c --- /dev/null +++ b/etc/port/20_2058 @@ -0,0 +1 @@ +n9e-collector diff --git a/etc/port/20_22 b/etc/port/20_22 deleted file mode 100644 index 09920bc7..00000000 --- a/etc/port/20_22 +++ /dev/null @@ -1 +0,0 @@ -sshd \ No newline at end of file diff --git a/etc/port/20_5800 b/etc/port/20_5800 new file mode 100644 index 00000000..34878d81 --- /dev/null +++ b/etc/port/20_5800 @@ -0,0 +1 @@ +n9e-monapi diff --git a/etc/port/20_5810 b/etc/port/20_5810 new file mode 100644 index 00000000..87fd6ec8 --- /dev/null +++ b/etc/port/20_5810 @@ -0,0 +1 @@ +n9e-transfer \ No newline at end of file diff --git a/etc/port/20_5820 b/etc/port/20_5820 new file mode 100644 index 00000000..76765ebb --- /dev/null +++ b/etc/port/20_5820 @@ -0,0 +1 @@ +n9e-tsdb diff --git a/etc/port/20_5830 b/etc/port/20_5830 new file mode 100644 index 00000000..2fa1392b --- /dev/null +++ b/etc/port/20_5830 @@ -0,0 +1 @@ +n9e-index diff --git a/etc/port/20_5840 b/etc/port/20_5840 new file mode 100644 index 00000000..bd723305 --- /dev/null +++ b/etc/port/20_5840 @@ -0,0 +1 @@ +n9e-judge \ No newline at end of file diff --git a/src/modules/collector/config/config.go b/src/modules/collector/config/config.go index 427d0464..6b64419c 100644 --- a/src/modules/collector/config/config.go +++ b/src/modules/collector/config/config.go @@ -62,16 +62,16 @@ func Parse(conf string) error { "enable": true, "timeout": 1000, "interval": 10, //采集策略更新时间 - "portPath": "/home/n9e/etc/port", - "procPath": "/home/n9e/etc/proc", - "logPath": "/home/n9e/etc/log", + "portPath": "./etc/port", + "procPath": "./etc/proc", + "logPath": "./etc/log", "api": "/api/portal/collects/", }) viper.SetDefault("sys", map[string]interface{}{ "timeout": 1000, //请求超时时间 "interval": 10, //基础指标上报周期 - "plugin": "/home/n9e/plugin", + "plugin": "./plugin", }) err = viper.Unmarshal(&Config) -- GitLab