Add 'Home'

George Rawlinson 2021-09-07 07:08:41 +00:00
commit ab9c295648
1 changed files with 52 additions and 0 deletions

52
Home.md Normal file

@ -0,0 +1,52 @@
# SMBMC Exporter
## systemd integration
For simple systemd integration, view the following `man` pages regarding the additional files required:
- [`systemd.unit`](https://www.freedesktop.org/software/systemd/man/systemd.unit.html)
- [`sysusers.conf`](https://www.freedesktop.org/software/systemd/man/systemd-sysusers.service.html)
- [`sysusers.d`](https://www.freedesktop.org/software/systemd/man/sysusers.d.html)
### 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"
```