yboetz / motd

Collection of 'message of the day' scripts
889 stars 105 forks source link

36-diskstatus doesn't do anything #23

Open Kyr4l opened 2 years ago

Kyr4l commented 2 years ago

image i'm not getting anything from it, running the commands by hand does work but the script doesn't display any value

yboetz commented 2 years ago

Did you change the disks in the script to just the ones you have available? Do you have hddtemp installed?

Kyr4l commented 2 years ago

hddtemp is installed and it works, the script has been modified to only display the installed disks however, running the unmodified script outputs the same thing : image

yboetz commented 2 years ago

Make sure hddtemp runs correctly, i.e. run service hddtemp status and it should show something like /usr/sbin/hddtemp -d -l 127.0.0.1 -p 7634 -s | /dev/sda ...

You can then try running the hddtemp command by itself: nc localhost 7634. If that doesn't work maybe you need to change the host/port of the hddtemp service.

If it works try with the timeout: timeout 0.01 nc localhost 7634. If that doesn't work then maybe the timeout is not big enough.

Kyr4l commented 2 years ago

image the service is configured properly, i even reinstalled it to make sure it was clean

running nc doesn't show anything either image

yboetz commented 2 years ago

Do you have the daemon enabled, i.e. is RUN_DAEMON="true" set in the hddtemp config file?

Kyr4l commented 2 years ago

enabling the daemon seems to work, image however i'm not getting any SMART report even tho i have smartmontools installed, smartd is running too

yboetz commented 2 years ago

The smart report greps for smart tests. If you haven't runny any tests recently then it won't show anything. I have my smart configured to run a short test every night, and that is what is displayed there.

shawtux commented 5 months ago

sorry for the late reply.

But as hddtemp is no longer in ubuntu repo, you could always use:

temp=$(smartctl -a /dev/$disk | grep ' Temperature_Celsius' | sed -r 's/.*[-|In_the_past]\s+([0-9]+).*/\1/')

I havent seen anything instead of the "-" or the "In_the_past" in the regular expression.

In this way you dont need hddtemp which was failing regularly for me.