Last active
February 27, 2026 06:54
-
-
Save YukariChiba/b8772e81267f701e25dc52668813c2fb to your computer and use it in GitHub Desktop.
Install VMAgent and prometheus, submit data to deepin-ports collector
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wget http://ftp.cn.debian.org/debian/pool/main/v/victoriametrics/victoria-metrics_1.112.0+ds1-2_riscv64.deb -O /tmp/vmagent.deb | |
| apt install /tmp/vmagent.deb prometheus-node-exporter | |
| cat <<EOF > /etc/systemd/system/vmagent.service | |
| [Unit] | |
| Description=vmagent - VictoriaMetrics Agent | |
| Documentation=https://docs.victoriametrics.com/vmagent/ | |
| After=network-online.target | |
| Wants=network-online.target | |
| After=prometheus-node-exporter | |
| [Service] | |
| User=prometheus | |
| Group=prometheus | |
| Type=simple | |
| ExecStart=/usr/bin/vmagent \ | |
| -promscrape.config=/etc/vmagent.yml \ | |
| -remoteWrite.url=http://deepin-ports-prometheus.cicd.getdeepin.org/api/v1/write \ | |
| -remoteWrite.tmpDataPath=/tmp/vmagent-buffer | |
| Restart=always | |
| RestartSec=5s | |
| ProtectSystem=full | |
| ProtectHome=true | |
| NoNewPrivileges=true | |
| LimitNOFILE=65536 | |
| [Install] | |
| WantedBy=multi-user.target | |
| EOF | |
| cat <<EOF > /etc/vmagent.yml | |
| global: | |
| scrape_interval: 15s | |
| scrape_configs: | |
| - job_name: 'dynamic-node' | |
| static_configs: | |
| - targets: ['localhost:9100'] | |
| labels: | |
| instance_id: '$(hostname)' | |
| EOF | |
| cat <<EOF > /etc/default/prometheus-node-exporter | |
| ARGS="--collector.netdev.address-info" | |
| EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment