Technical FAQs

Ask a Question

Netbotz Central version 2.x MySQL Query for Max & Average Temps for a Given Timeframe

Issue:

Netbotz Central version 2.x MySQL Query for Max & Average Temps for a Given Timeframe

Product Line:

NetBotz Central

Environment:

NetBotz version 2.x

Cause:

The base MySQL query below can be used to determine the Maximum temperature for each appliance during the timeframe of 8/1/05-8/8/05 and also the average temperature during this time. The query also formats the output to have the ""Location"" descriptor of the appliance displayed as well as it formats the temperature information into F rather than C readings.

Resolution:

The MySQL query will produce this output: Sensor Port IP Location Average Max-- Temperature 192.168.19.118 Right 3rd 79.78571429 88.34 Temperature 192.168.19.115 Bot 1 81.28773585 89.96 Temperature 192.168.19.117 Right 2nd 79.87682119 89.42 Query:select sensor.label as Sensor, sensor_port.label as Port, ip_addr as IP, location as Location, (9*avg(value)/5 + 32) as Average, (9*max(value)/5+32) as Max from sensor left join sensor_port on (sensor.port_id=sensor_port.port_id) left join sensor_history_number on (sensor.sensor_id=sensor_history_number.sensor_id) left join net_devices on (sensor.serial=net_devices.serial) left join devices on (devices.serial=sensor.serial) where sensor.classpath like '%nbTempSensor%' and time > unix_timestamp('2005-08-01')*1000 and time < unix_timestamp('2005-08-08')*1000 group by sensor.sensor_id;Y ou can enter this query either on the MySQL command line in the Linux interface of the NBC, or through a MySQL Query tool like the one below:
MySQL.COM Query Tool

Note, StruxureWare Data Center Expert does not support this kind of direct database interaction.
Was this helpful?
What can we do to improve the information ?