diff --git a/CLI/actioner/sonic-cli-pfm.py b/CLI/actioner/sonic-cli-pfm.py index 0d917f3c88..701034866d 100755 --- a/CLI/actioner/sonic-cli-pfm.py +++ b/CLI/actioner/sonic-cli-pfm.py @@ -90,10 +90,12 @@ def format_env_data(content): else: fan = {} fan['Speed'] = sensor['speed'] - if sensor['status'] == True: - fan['State'] = 'Normal' - else: - fan['State'] = 'Abnormal' + fan['Presence'] = sensor['presence'] + if sensor['presence'] == True: + if sensor['status'] == True: + fan['State'] = 'Normal' + else: + fan['State'] = 'Abnormal' if sensor['direction'] == 'exhaust': fan['Airflow'] = 'Exhaust' else: diff --git a/CLI/renderer/templates/platform_env_show.j2 b/CLI/renderer/templates/platform_env_show.j2 index cd81630990..f125afffae 100755 --- a/CLI/renderer/templates/platform_env_show.j2 +++ b/CLI/renderer/templates/platform_env_show.j2 @@ -7,10 +7,14 @@ Fan Trays : {% for name, fantray in json_output['Fan Trays'].items() %} {{ name }} : {% for id, fan in fantray.items() %} - {{id}} Speed : {{ fan['Speed'] }} RPM - {{id}} State : {{ fan['State'] }} - {{id}} Airflow : {{fan['Airflow'] }} - {% endfor %} + {% if fan['Presence'] != True %} + {{id}} : NOT PRESENT + {% else %} + {{id}} Speed : {{ fan['Speed'] }} RPM + {{id}} State : {{ fan['State'] }} + {{id}} Airflow : {{fan['Airflow']}} + {% endif %} + {% endfor %} {% endfor %} PSUs :