Revisar estat disc NVME i altra informació RAID per software

#!/bin/bash
rm /tmp/estat_raid
touch /tmp/estat_raid

echo>>/tmp/estat_raid "<html><pre>"

echo>>/tmp/estat_raid ""
echo>>/tmp/estat_raid "------------------------"
echo>>/tmp/estat_raid "- smart-log /dev/nvme0 -"
echo>>/tmp/estat_raid "------------------------"
nvme>>/tmp/estat_raid smart-log /dev/nvme0
echo>>/tmp/estat_raid ""
echo>>/tmp/estat_raid "------------------------"
echo>>/tmp/estat_raid "- smart-log /dev/nvme1 -"
echo>>/tmp/estat_raid "------------------------"
nvme>>/tmp/estat_raid smart-log /dev/nvme1

echo>>/tmp/estat_raid ""
echo>>/tmp/estat_raid ""
echo>>/tmp/estat_raid "--------------------"
echo>>/tmp/estat_raid "- cat /proc/mdstat -"
echo>>/tmp/estat_raid "--------------------"
cat>>/tmp/estat_raid /proc/mdstat

echo>>/tmp/estat_raid ""
echo>>/tmp/estat_raid ""
echo>>/tmp/estat_raid "---------------------"
echo>>/tmp/estat_raid "- mdadm -D /dev/md2 -"
echo>>/tmp/estat_raid "---------------------"
mdadm>>/tmp/estat_raid -D /dev/md2
echo>>/tmp/estat_raid ""
echo>>/tmp/estat_raid "---------------------"
echo>>/tmp/estat_raid "- mdadm -D /dev/md2 -"
echo>>/tmp/estat_raid "---------------------"
mdadm>>/tmp/estat_raid -D /dev/md4

echo>>/tmp/estat_raid ""
echo>>/tmp/estat_raid ""
echo>>/tmp/estat_raid "---------------------------------------------"
echo>>/tmp/estat_raid "- lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT -"
echo>>/tmp/estat_raid "---------------------------------------------"
lsblk>>/tmp/estat_raid -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT

echo>>/tmp/estat_raid ""
echo>>/tmp/estat_raid ""
echo>>/tmp/estat_raid ""
echo>>/tmp/estat_raid ""
echo>>/tmp/estat_raid "--------"
echo>>/tmp/estat_raid "https://www.digitalocean.com/community/tutorials/how-to-create-raid-arrays-with-mdadm-on-ubuntu-16-04#conclusion"
echo>>/tmp/estat_raid "https://access.redhat.com/documentation/es-es/red_hat_enterprise_linux/6/html/logical_volume_manager_administration/physvol_display"

echo>>/tmp/estat_raid "</pre></html>"

mailx -a 'Content-Type: text/html' -s "Estat RAID" destinatari@domini.tld < /tmp/estat_raid

rm /tmp/estat_raid
2022-03-22T13:54:26+01:0022 03 2022|raid|