Hi Thomas, AFAIK there is no way to query the current temperature but you'd enable SNMP traps to get an alarm as soon as the chassis is getting too hot.
So here my notes from a test I've done last year with a D2 and Netsight ....
- configure the switch to enable trap forwarding to IP 10.12.0.22
set snmp targetparams publicpara user public security-model v1 message processing v1
set snmp targetaddr publictrap 10.12.0.22 param publicpara taglist publictraptag
set snmp notify publictrap tag publictraptag
- enable SNMP for system temperatur traps
set system temperature trap enable
- test = force the trap = set temperatur threshold to 1% = fan will go max
set system temperature overtemp-threshold 1 trap enable
- turn it back to normal
set system temperature overtemp-threshold 100 trap enable
example of the Netsight trap (Netsight version 6.0 early release)