Smartctl exporter

Hello,
I’m stuck on a problem.
How to use the smartctl exporter? When I include it in “node” it crashes the service.

If I add it in its own exporter, it has no access to the disks
Are there any special rights to be granted?

thank you for your help!

  services.prometheus.exporters.smartctl = {
    enable = true;
  };

  services.udev.extraRules = ''
    SUBSYSTEM=="nvme", KERNEL=="nvme[0-9]*", GROUP="disk"
  '';

The udev rule is to allow access to the raw nvme device to the disks group, should you have any, which is what the exporter automatically discovers.

1 Like

interesting, unfortunately I don’t have the access authorization.

mai 15 20:53:38 cobblepot systemd[1]: Started prometheus-smartctl-exporter.service.
mai 15 20:53:38 cobblepot smartctl_exporter[3862540]: [Warning] S.M.A.R.T. output reading error: exit status 2
mai 15 20:53:38 cobblepot smartctl_exporter[3862540]: [Warning] The device error log contains records of errors.
mai 15 20:53:38 cobblepot smartctl_exporter[3862540]: [Error] Smartctl open device: /dev/nvme0n1 failed: Operation not permitted
mai 15 20:53:38 cobblepot smartctl_exporter[3862540]: [Error] smartctl returned bad data for device /dev/nvme0n1
mai 15 20:53:38 cobblepot smartctl_exporter[3862540]: [Info] Starting on 0.0.0.0:9633/metrics

Do I have to create special rights?
My disks sda,sdb etc… and my disk nvme are in right root:disk

I tried to change the rights of the disks or the smartctl exporter unfortunately nothing helps

“Operation not permitted”

Hosted by Flying Circus.