Don't know if someone noticed but, if using
Code:drives=`sysctl -n kern.disks | awk '{for (i=NF; i!=0 ; i--) print $i }'`
You get also cdrom and usb drives. Is there a way to only select hardrives?
#!/bin/sh PossibleHDDs=`sysctl -n kern.disks | awk '{for (i=NF; i!=0 ; i--) print $i }'` drives="" for SingleHDD in $PossibleHDDs do SearchString="0 DISK "${SingleHDD} ### echo "SingleHDD "$SingleHDD HDDsize=`sysctl -a | grep "${SearchString}" | cut -d' ' -f 4` ### the size code can return the HDD itself and not the size ### need 5th value in this case if [ $HDDsize = ${SingleHDD} ] ; then HDDsize=`sysctl -a | grep "${SearchString}" | cut -d' ' -f 5` fi ### echo ${SingleHDD}" is size "${HDDsize} ### the following is 4Tb ... 4000000000000 ### the following is 25Gb ... 25000000000 if [ $HDDsize -gt 25000000000 ] ; then drives=${drives}" "${SingleHDD} fi done echo $drives
This brings back memories for certain. Years ago I was trying to get MB temps for my system and I eventually did but over time it was not worth keeping up with it because I had to load a module that wasn't normally loaded in the FreeNAS distribution and there were a lot of frequent updates and those changes were not persistent. Also all the temps were fine. Some components are very hot on a MB and that is the design. I think keeping track of the HD temps is enough but that is already built into FreeNAS these days for a maximum threshold. The CPU temps would be worth monitoring for a new build but once that is done, there is no need to monitor it further unless you need to know if the CPU fan has failed. That would be a nice feature to add into FreeNAS, a CPU temp threshold, not a fan failure alarm because that would be too difficult based on the way FreeNAS is built. Linux is much easier with this but we are not using Linux.I asked a question about motherboard temps and was provided with a hint to search in the output from 'sysctl -a'.
### MB Temperature MBTemp=`ipmitool sensor list all | grep "MB Temperature" | cut -d' ' -f 6` echo "MB temperature "$MBTemp" C" >> ${logfile}
Could you state the MB this works with?I found a solution that seems to report the MB temp. At least the temp agrees with what my ipmi is reporting.
Code:### MB Temperature MBTemp=`ipmitool sensor list all | grep "MB Temperature" | cut -d' ' -f 6` echo "MB temperature "$MBTemp" C" >> ${logfile}
I've included this snippet into my CPU / HDD script that then turns around and emails the logfile to my google account.
ASRock C2550D4ICould you state the MB this works with?
########## SMART status report summary for all drives ########## +------+---------------+----+-----+-----+-----+-------+-------+--------+------+----------+------+-------+ |Device|Serial |Temp|Power|Start|Spin |ReAlloc|Current|Offline |Seek |Total |High |Command| | | | |On |Stop |Retry|Sectors|Pending|Uncorrec|Errors|Seeks |Fly |Timeout| | | | |Hours|Count|Count| |Sectors|Sectors | | |Writes|Count | +------+---------------+----+-----+-----+-----+-------+-------+--------+------+----------+------+-------+ |da1 | | | | | | | | | N/A| N/A| N/A| N/A| |da2 | | | | | | | | | N/A| N/A| N/A| N/A| |da3 | | | | | | | | | N/A| N/A| N/A| N/A| |da4 | | | | | | | | | N/A| N/A| N/A| N/A| +------+---------------+----+-----+-----+-----+-------+-------+--------+------+----------+------+-------+ ########## SMART status report for da1 drive (: ) ########## /dev/xpt0 control device couldn't opened: Permission denied Unable to get CAM device list /dev/da1: Unable to detect device type Please specify device type with the -d option. Use smartctl -h to get a usage summary
Can you please post the output of camcontrol devlist ?
[root@freenas] ~# camcontrol devlist <KINGSTON SV300S37A120G 603ABBF0> at scbus1 target 0 lun 0 (pass0,ada0) <WDC WD60EFRX-68MYMN1 82.00A82> at scbus2 target 0 lun 0 (pass1,ada1) <WDC WD60EFRX-68MYMN1 82.00A82> at scbus3 target 0 lun 0 (pass2,ada2) <WDC WD60EFRX-68MYMN1 82.00A82> at scbus4 target 0 lun 0 (pass3,ada3) <WDC WD60EFRX-68MYMN1 82.00A82> at scbus5 target 0 lun 0 (pass4,ada4) <SanDisk Cruzer Blade 1.27> at scbus8 target 0 lun 0 (pass5,da0)
Ok, so just to be sure, you need to put ada0 to ada4 in the drives list. Now, as far as I can understand your problem was just that you didn't execute it as root, so now it's fixed, right?
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: not set
battery.mfr.date: 2015/03/27
battery.runtime: 2108
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 13.6
battery.voltage.nominal: 12.0
device.mfr: APC
device.model: Back-UPS ES 650G1
device.serial: 4B1513P37600
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ugen0.7
driver.version: 2.7.2
driver.version.data: APC HID 0.95
driver.version.internal: 0.38
input.sensitivity: high
input.transfer.high: 139
input.transfer.low: 92
input.transfer.reason: input voltage out of range
input.voltage: 114.0
input.voltage.nominal: 120
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: 906.W1 .D
ups.firmware.aux: W1
ups.load: 20
ups.mfr: APC
ups.mfr.date: 2015/03/27
ups.model: Back-UPS ES 650G1
ups.productid: 0002
ups.serial: 4B1513P37600
ups.status: OL
ups.timer.reboot: 0
ups.timer.shutdown: -1
ups.vendorid: 051d