diff --git a/smartctl.go b/smartctl.go index 17a5276..9173e3f 100644 --- a/smartctl.go +++ b/smartctl.go @@ -23,7 +23,7 @@ type SMARTctl struct { device SMARTDevice } -// NewSMARTctl is NFTables constructor +// NewSMARTctl is smartctl constructor func NewSMARTctl(json gjson.Result, ch chan<- prometheus.Metric) SMARTctl { smart := SMARTctl{} smart.ch = ch diff --git a/systemd/smartctl_exporter.service b/systemd/smartctl_exporter.service new file mode 100644 index 0000000..4fbde98 --- /dev/null +++ b/systemd/smartctl_exporter.service @@ -0,0 +1,19 @@ +[Unit] +Description=smartctl exporter service +After=network-online.target + +[Service] +Type=simple +PIDFile=/run/smartctl_exporter.pid +ExecStart=/usr/bin/smartctl_exporter +User=root +Group=root +SyslogIdentifier=smartctl_exporter +Restart=on-failure +RemainAfterExit=no +RestartSec=100ms +StandardOutput=journal +StandardError=journal + +[Install] +WantedBy=multi-user.target