1 Home
George Rawlinson edited this page 1 year ago

SMBMC Exporter

systemd integration

For simple systemd integration, view the following man pages regarding the additional files required:

service file

/usr/lib/systemd/system/prometheus-smbmc-exporter.service

[Unit]
Description=Prometheus exporter for smbmc metrics
Requires=network-online.target
After=network-online.target

[Service]
ExecStart=/usr/bin/smbmc-exporter
ExecReload=/bin/kill -HUP $MAINPID
User=smbmc-exporter
Group=smbmc-exporter
Restart=on-failure
NoNewPrivileges=true
ProtectSystem=true

[Install]
WantedBy=multi-user.target

service drop-in file

/etc/systemd/system/prometheus-smbmc-exporter.service.d/environment.conf

Note: Ensure this file is not world-readable, since it stores credentials.

[Service]
Environment=SMBMC_HOSTNAME="127.0.0.1"
Environment=SMBMC_USERNAME="admin"
Environment=SMBMC_PASSWORD="hunter2"
Environment=LISTEN_PORT=8000
Environment=LISTEN_ADDR=0.0.0.0

sysusers file

/usr/lib/sysusers.d/prometheus-smbmc-exporter.conf

u smbmc-exporter - "Prometheus smbmc exporter user"