更新 scripts/node-exporter.sh

This commit is contained in:
joy 2025-07-28 17:00:56 +08:00
parent 59170b15c6
commit bae2ac116b
1 changed files with 3 additions and 1 deletions

View File

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