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" "启动服务"