show environment
Displays the environmental status of the device, including temperature, voltage, and fan status, to monitor hardware health and detect potential failures.
Definition: show environment is a Cisco IOS privileged exec command. Displays the environmental status of the device, including temperature, voltage, and fan status, to monitor hardware health and detect potential failures.
Overview
The 'show environment' command is a critical diagnostic tool in Cisco IOS that provides a real-time snapshot of the physical health of a networking device. It reports key environmental parameters such as internal temperature, system voltage levels, and the operational status of cooling fans. This command is essential for proactive hardware monitoring, as environmental anomalies—like overheating, power supply fluctuations, or fan failures—are leading causes of device crashes, interface flapping, and premature hardware degradation. By regularly inspecting environmental readings, network engineers can detect early warning signs of impending failure and schedule maintenance before an outage occurs.
The networking concept behind environmental monitoring is rooted in hardware reliability and fault management. Cisco devices are designed to operate within specific thermal and electrical thresholds; exceeding these can cause erratic behavior or permanent damage. The 'show environment' command exposes sensor data that the device's onboard management subsystem collects from temperature sensors, voltage regulators, and fan tachometers. This data is not stored in the running configuration—it is volatile and reflects current conditions. The command requires privileged EXEC mode (enable), and its output is typically buffered, meaning it may be truncated if the terminal length is set; using 'terminal length 0' beforehand ensures the full output is displayed.
When would you reach for this command versus alternatives? If you suspect a hardware issue—such as unexpected reboots, interface errors that correlate with high CPU temperature, or audible fan noise—'show environment' is your first stop. For a broader hardware inventory, use 'show inventory' or 'show diag'. For power supply specifics, 'show power' is more detailed. For logging of past environmental events, check 'show logging' or 'show environment status' (on some platforms). The command fits into a troubleshooting workflow after initial symptom identification: after checking basic connectivity and interface status, if the problem seems hardware-related, run 'show environment' to rule out thermal or power issues. It is also part of routine health checks during maintenance windows.
Important IOS behavior: The output format varies by platform and IOS version. On older IOS (12.x), the output is simple text; on IOS-XE (16.x), it may be more structured. The command has no parameters on most platforms, but some high-end routers (like ASR1000) support 'show environment all' for extended details. The command does not affect the running configuration and has no side effects. Privilege level 15 is required. On some switches, 'show env' is an alias. Always verify the exact syntax for your platform using '?'.
show environmentWhen to Use This Command
- Checking system temperature after a cooling fan failure alert
- Verifying power supply voltage during a site power audit
- Monitoring fan speed before scheduled maintenance to ensure proper cooling
- Troubleshooting unexpected shutdowns by reviewing environmental history
Command Examples
Basic show environment output
show environmentEnvironmental Status -- System Temperature -- Temperature: 45 Celsius Temperature Threshold: 65 Celsius -- Power Supply -- Power Supply 1: Normal Power Supply 2: Normal -- Fan Status -- Fan 1: Normal Fan 2: Normal Fan 3: Normal -- Voltage -- +5V: 5.00 V +12V: 12.10 V -12V: -12.00 V
Line 1: Header. Line 2-4: System temperature is 45°C, below the threshold of 65°C (safe). Line 6-8: Both power supplies are operating normally. Line 10-13: All three fans are normal. Line 15-18: Voltages are within expected ranges (5V, 12V, -12V).
show environment all (detailed)
show environment allEnvironmental Status -- System Temperature -- Temperature: 50 Celsius Temperature Threshold: 65 Celsius -- Power Supply -- Power Supply 1: Normal Power Supply 2: Failed -- Fan Status -- Fan 1: Normal Fan 2: Normal Fan 3: Failed -- Voltage -- +5V: 4.95 V +12V: 11.80 V -12V: -11.90 V -- History -- Last Power Supply Failure: 10:30:00 UTC Mon Mar 15 2023 Last Fan Failure: 10:25:00 UTC Mon Mar 15 2023
Shows more detail including history. Temperature is 50°C (still safe). Power Supply 2 has failed (critical). Fan 3 has failed (critical). Voltages are slightly low but within tolerance. History shows recent failures at specific times.
Understanding the Output
The 'show environment' command provides a snapshot of the device's physical health. The 'System Temperature' field shows the current internal temperature in Celsius and the threshold at which an alarm triggers. Normal operating temperature is typically below 60°C; values near the threshold indicate cooling issues.
'Power Supply' shows each PSU status: 'Normal' means operational, 'Failed' means no output, and 'Absent' means not installed. 'Fan Status' lists each fan; 'Normal' is good, 'Failed' means the fan is not spinning. 'Voltage' displays key rails; acceptable ranges are usually ±5% of nominal (e.g., +5V should be 4.75-5.25V).
If any value is out of range, immediate investigation is needed. The 'all' variant adds a history section showing timestamps of recent failures, useful for trend analysis.
Configuration Scenarios
Routine Health Check on a Cisco 2960 Switch
A network administrator wants to perform a weekly health check on a stack of Cisco 2960 switches to ensure environmental conditions are within acceptable limits before a planned firmware upgrade.
Topology
Switch1 (Stack Member 1) --- StackWise --- Switch2 (Stack Member 2)Steps
- 1.Step 1: Connect to the switch via SSH or console and enter privileged EXEC mode: Switch> enable
- 2.Step 2: Disable terminal paging to see full output: Switch# terminal length 0
- 3.Step 3: Execute the show environment command: Switch# show environment
- 4.Step 4: Review the output for temperature, voltage, and fan status. For a stack, output includes each member.
- 5.Step 5: If any parameter is out of range (e.g., temperature > 50°C, voltage < 12V, fan not spinning), investigate further.
! No configuration required; this is a show command. Switch# show environment All temperature measurements are in Celsius System Temperature: 42 System Voltage: 12.1 Fan Status: OK Stack Member 1: Temperature: 42 Voltage: 12.1 Fan: OK Stack Member 2: Temperature: 39 Voltage: 12.0 Fan: OK
Verify: The command output shows temperature, voltage, and fan status for each stack member. Expected healthy values: temperature below 50°C, voltage around 12V, fan status 'OK'.
Watch out: On some 2960 models, the command is 'show env' instead of 'show environment'. Always check with '?' if the command is not recognized.
Troubleshooting an Overheating Cisco 4321 Router
A remote branch router (Cisco 4321) has been logging 'temperature threshold exceeded' messages. The engineer needs to check current environmental readings to determine if the router is overheating and if fans are operational.
Topology
R1 (Gi0/0/0) --- 10.10.10.0/30 --- ISPSteps
- 1.Step 1: Access the router via SSH and enter enable mode: Router> enable
- 2.Step 2: Disable terminal paging: Router# terminal length 0
- 3.Step 3: Run show environment: Router# show environment
- 4.Step 4: Examine the temperature reading. If it is above 60°C, the router is overheating. Check fan status; if 'Fan: Not OK' or 'Fan: Failed', the fan may be faulty.
- 5.Step 5: Also check voltage; low voltage (below 11.5V) could indicate a failing power supply.
- 6.Step 6: If overheating, check for blocked air vents, high ambient temperature, or fan failure. Consider moving the router to a cooler location or replacing the fan.
! No configuration needed. Router# show environment Temperature: 68 C (Threshold: 70 C) Voltage: 11.8 V Fan: OK Power Supply: Present, Status: Normal
Verify: The output shows temperature (68°C) near the threshold (70°C). Voltage is slightly low (11.8V). Fan is OK. This indicates the router is running hot but still within limits; immediate action is needed to prevent shutdown.
Watch out: On ISR 4000 series, the command 'show environment all' provides more detailed sensor data. Also, temperature thresholds vary by model; always refer to the hardware documentation for exact limits.
Troubleshooting with This Command
When using 'show environment' for troubleshooting, the key is to understand what healthy output looks like and what deviations indicate. A healthy device typically shows temperature well below the warning threshold (e.g., 30-45°C for most switches, 40-55°C for routers), voltage within ±5% of nominal (e.g., 12V for a 12V system), and fan status 'OK' or 'Normal'. Problem indicators include: temperature approaching or exceeding the threshold (e.g., >60°C), voltage readings outside the normal range (e.g., <11.5V or >12.5V), and fan status showing 'Failed', 'Not Present', or 'Error'.
Common symptoms that 'show environment' helps diagnose include: unexpected device reboots (often due to thermal shutdown), interface errors that increase with temperature, system slowdowns, and power supply failures. For example, if a router reboots randomly during peak hours, checking the temperature history via 'show environment' may reveal that the device reached critical temperature just before the reboot. Similarly, if a switch stack member shows 'Fan: Failed', that member may overheat and cause port flapping.
A step-by-step diagnostic flow: 1) Identify the symptom (e.g., device reboot, high CPU, interface errors). 2) Run 'show environment' to check current conditions. 3) If temperature is high, check ambient temperature, air flow, and fan operation. Use 'show environment temperature' (if available) for historical data. 4) If voltage is low, check the power supply with 'show power' and inspect the power cable. 5) If fan is failed, plan for replacement. 6) Correlate with other commands: 'show logging' for environmental alerts, 'show interfaces' for errors that may be heat-related, 'show processes cpu' to see if high CPU correlates with temperature spikes. For example, high CPU from routing protocol convergence can increase temperature; if the fan is marginal, the temperature may spike. By correlating 'show environment' with 'show processes cpu' timestamps, you can identify such patterns.
In summary, 'show environment' is a first-line diagnostic for hardware health. Always run it when you suspect physical issues, and compare readings over time to spot trends. Remember that environmental readings are instantaneous; for persistent issues, set up SNMP monitoring to track trends.
CCNA Exam Tips
CCNA exam may ask which command to use to check if a fan has failed — answer: 'show environment'
Be aware that 'show environment' is a Privileged EXEC command, not available in User EXEC mode
The exam might present an output with a failed power supply and ask what action to take — replace the PSU
Know that temperature thresholds vary by platform; always compare to the specific device's threshold
Common Mistakes
Mistake 1: Using 'show environment' in User EXEC mode — it will not work; must be in Privileged EXEC
Mistake 2: Ignoring a 'Failed' fan status because the device still runs — can lead to overheating and shutdown
Mistake 3: Confusing 'show environment' with 'show env' (which is not a valid Cisco IOS command)
show environment vs show version
Both 'show environment' and 'show version' are commonly used in privileged EXEC mode for system diagnostics, but they serve distinct purposes. While 'show environment' focuses on hardware health via sensor data, 'show version' provides software and hardware identity details. They are often confused because both output system-level information, but their scopes are complementary.
| Aspect | show environment | show version |
|---|---|---|
| Scope | Hardware environmental status | System software and hardware identity |
| Information Provided | Temperature, voltage, fan speed | IOS version, uptime, memory, interfaces, config register |
| Output Emphasis | Sensor readings and thresholds | Software version, hardware model, boot variables |
| Typical Use Case | Monitoring for overheating or power issues | Verifying image compatibility or device identity |
| Real-time vs Static | Reflects instantaneous sensor values | Static data (except uptime) |
| Impact of Hardware Changes | Updates immediately (sensor readings) | Requires reload for version changes; hardware changes reflected after discovery |
Use show environment when you need to check if the device is operating within safe temperature, voltage, and fan ranges, especially after hardware installation or during troubleshooting of hardware failures.
Use show version when you need to verify the exact IOS version, device model, uptime, or configuration register settings for compatibility checks or maintenance planning.
Platform Notes
In IOS-XE (e.g., on Catalyst 9000 switches or ISR 4000 routers), the 'show environment' command output is more structured and may include additional sensors like 'Temperature: 42 C (Threshold: 70 C)'. The syntax is the same, but the output format differs. On some IOS-XE platforms, 'show environment all' provides a comprehensive list of all sensors.
On NX-OS (e.g., Nexus switches), the equivalent command is 'show environment' as well, but the output is different: it shows 'Temperature', 'Fan', 'Power Supply' sections. The NX-OS command 'show environment temperature' gives detailed thermal data. On ASA firewalls, the command is 'show environment' but it may only show temperature and fan status; voltage is not always displayed.
For ASA, use 'show temperature' for thermal details. In IOS-XR (e.g., ASR 9000), the command is 'show environment' but the output is very detailed, including 'Temperature', 'Voltage', 'Current', 'Fan', and 'Power Supply' sections. The syntax is the same.
Between IOS versions, the output has evolved: 12.x shows simple text, 15.x adds more detail, and 16.x (IOS-XE) uses a table-like format. Always check the specific platform documentation, as some older switches (like 2950) may not support 'show environment' and instead use 'show env' or 'show system'.
Related Commands
show inventory
Displays hardware inventory including chassis, modules, power supplies, and fan trays with their product IDs (PIDs), version IDs (VIDs), and serial numbers.
show logging
Displays the state of system logging (syslog) on the device, including buffer contents, logging configuration, and statistics, used for troubleshooting and monitoring system events.
show version
Displays system hardware and software information, including IOS version, uptime, memory, interfaces, and configuration register, used to verify device identity and software compatibility.
Practice for the CCNA 200-301
Test your knowledge with practice questions covering all CCNA 200-301 exam domains.
Practice CCNA 200-301 Questions