Hello Rich,
At CERN we do have an external script that collects temperature and humidity values from the tape drives and feeds that information into our monitoring. When the thresholds are breached, we are informed.
I would recommend you to have a look at the LTO SCSI Reference:
https://www.ibm.com/support/pages/system/files/inline-files/[APPROVED]%20LTO%20SCSI%20Reference%20GA32-0928-06.pdf
On page 265 there is "Table 239 — LP 0Dh[01h]: Environmental Reporting log parameters". The subsequent sections "6.4.9.2.1 Temperature Report parameter data" and "6.4.9.2.2 Relative Humidity Report parameter data" explain in details the information you are after.
In addition to that, here is a simple example shell and AWK script for humidity:
/usr/bin/sg_logs --page=0x0D,0x01 --paramp=0x0000 --control=1 --hex $1 | awk '/^.?20/ {
printf "Relative humidity\n"
printf "Current: %d\n", strtonum("0x"$3)
printf "Lifetime max: %d\n", strtonum("0x"$4)
printf "Lifetime min: %d\n", strtonum("0x"$5)
printf "Power max: %d\n", strtonum("0x"$6)
printf "Power min: %d\n", strtonum("0x"$7)
printf "Mount max: %d\n", strtonum("0x"$8)
printf "Mount min: %d\n", strtonum("0x"$9)
}'
Hope this helps. Best regards,
------------------------------
Vladimir Bahyl
CERN
------------------------------