#1059437 mrtg does not aquire data from /usr/sbin/smartctl after upgrade

Package:
mrtg
Source:
mrtg
Description:
Multi Router Traffic Grapher
Submitter:
DM
Date:
2023-12-25 12:24:03 UTC
Severity:
normal
#1059437#5
Date:
2023-12-25 12:20:25 UTC
From:
To:
Dear Maintainer, after upgrade from Deabian 10 till Debian 12 through Debian 11
mrtg.conf was moved to another location. I made apropriate adjustments
in new tocation of config file. All graphics was working except data about hdd disk temperature.
Previously worked Targets does not work.
It's get data from smartctl:
Target[hdd_temp_sda]: `/usr/sbin/smartctl -a -s on /dev/disk/by-id/ata-sda | grep Temp | awk -F " " '{print $10}'`
After upgrade all such targets get no data and graphics are not built.
Directly runned command are okay. Data are being getted.
As I think, such problem appears because smartctl takes some time. And when mrtg were launched through crontab it were normal.
And now it terminate early than it gets result.
I tried to make temp location for data, but it didn't fix problem.
Try fix with this:
crontab -l
  */5 * * * * /usr/local/sbin/mrtg_smartctl_scan.sh 2>&1 >/dev/null
cat /usr/local/sbin/mrtg_smartctl_scan.sh
  #!/usr/bin/env bash
  /usr/sbin/smartctl -a -s on /dev/disk/by-id/ata-sd1 | grep Temp | awk -F " " '{print $10}'> /tmp/ata_1
in mrtg.conf
  Target[hdd_temp_sdb]: `/usr/bin/cat /tmp/ata_1`
But it doesn't work.
I tried to check getting data with such setup:
  Target[hdd_temp_sda]: `/usr/bin/cat /tmp/ata_1; echo 1; echo 2; echo 3;`
And it showed that first data a missed.
So how can it be fixed? Or I should reinstall Debian 10?