I got hddtemp up and running (using check_mk). All works fine, but for my DVD writer, I get the following from hddtemp,
/dev/sr0: TSSTcorp CDDVDW SH-S203N : S.M.A.R.T. not available
So then this device always shows up with a temperature of 0C in LibreNMS. I’d like to remove it (not really valid data) … I don’t care if hddtemp drops it, or if it’s filtered in LibreNMS - either one is fine. Is there a way to do this?
Yep, no alarms then, but the non-existent item still shows up in Health … right?
I don’t mind taking a stab at it, but to make sure we’re on the same page - I’m thinking nothing should be reported (through hddtemp) for devices that don’t support it. Agreed?
OK, seems it’s just a one-liner … or really, just a minor change to 1 line. I don’t have a fork (for a PR) of the repository, are you able to submit this?
Here is the change, in hddtemp. Change,
content=echo "$output" | awk -F": " 'BEGIN{ ORS="" }{ print "|"$1"|"$2"|"$3"|";} ' | sed 's/[° ]C|/|C|/g' | sed 's/[° ]F|/|F|/g' | tr -cd '\12\14\40-\176'
to,
content=echo "$output" | awk '{ if ($0 !~ /not available/) { print $0 } }' | awk -F": " 'BEGIN{ ORS="" }{ print "|"$1"|"$2"|"$3"|";} ' | sed 's/[° ]C|/|C|/g' | sed 's/[° ]F|/|F|/g' | tr -cd '\12\14\40-\176'
So just adding the test for “not available”. Tried it out here, works perfectly. In my log now,
Sensor Deleted: temperature hddtemp 2 /dev/sr0: Optiarc DVD RW AD-7280S