From bae2ac116bed5833c938f555b070b613adfd1d0b Mon Sep 17 00:00:00 2001 From: joy Date: Mon, 28 Jul 2025 17:00:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20scripts/node-exporter.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/node-exporter.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/node-exporter.sh b/scripts/node-exporter.sh index a3bd4d7..8b20488 100644 --- a/scripts/node-exporter.sh +++ b/scripts/node-exporter.sh @@ -219,7 +219,7 @@ After=network.target [Service] User=$APP_USER -ExecStart=$BINARY_DIR/${APP_NAME} --web.listen-address=$WEB_LISTEN_ADDRESS +ExecStart=$BINARY_DIR/${APP_NAME} --collector.textfile.directory=/var/lib/node_exporter/textfile_collector --web.listen-address=$WEB_LISTEN_ADDRESS Restart=always [Install] @@ -227,6 +227,8 @@ WantedBy=multi-user.target EOF # 启动服务 + run_cmd "mkdir -p /var/lib/node_exporter/textfile_collector" "开启textfile扩展" + run_cmd "chmod -R 755 /var/lib/node_exporter/textfile_collector" run_cmd "systemctl daemon-reload" "重新加载systemd配置" run_cmd "systemctl enable ${APP_NAME}.service" "启用服务" run_cmd "systemctl restart ${APP_NAME}.service" "启动服务"