Use two thermostats.

Rack ambient tempatures also vary from level to level. The top of the rack is usually warmer than the bottom. Heat rises.