micha37-martins / S.M.A.R.T-disk-monitoring-for-Prometheus

Prometheus node_exporter text_collector for S.M.A.R.T disk values
Apache License 2.0
92 stars 26 forks source link

Not Working with two nvme SSDs #4

Closed ChristianDresel closed 1 month ago

ChristianDresel commented 3 years ago

Hello on my device i have 2 nvme SSDs:

/usr/sbin/smartctl --scan-open | awk '/^\/dev/{print $1 "|" $3}' /dev/nvme0|nvme /dev/nvme1|nvme

but the output from smartmon.sh is broken:

smart.txt

one device is not insert and the line 21 "smartmon_disk type is not sat, scsi or megaraid but nvme" is complety broken, prometheus node exporter say:

Mar 08 09:59:25 vserver2 prometheus-node-exporter[27170]: time="2021-03-08T09:59:25+01:00" level=error msg="Error parsing \"/var/lib/prometheus/node-exporter/smart_metrics.prom\": text format parsing error in line 20: unknown metric type \ M

It's a proxmox System with

smartctl -v smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.78-1-pve] (local build)

megapegabot commented 2 years ago

...... smartmon.sh ........

device_list="$(/usr/sbin/smartctl --scan-open | awk '/^\/dev/{print $1 "|" $3}')"

for device in ${device_list}; do
  disk="$(echo ${device} | cut -f1 -d'|')"
  type="$(echo ${device} | cut -f2 -d'|')"
  if [[ $type == *"nvme"* ]]; then
          continue
  fi
  active=1

........

micha37-martins commented 1 month ago

This should work now after the rewrite.