1 Home
George Rawlinson edited this page 2021-09-07 07:08:41 +00:00

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"