Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sonic-platform-daemons] Add more physical entity information to DB for physical entity mib #102

Merged
merged 12 commits into from
Nov 16, 2020

Conversation

Junchao-Mellanox
Copy link
Collaborator

Why I did this?

SONiC physical entity mib extension is going to save all physical entity information to mib for snmp query. We already have transceiver and transceiver DOM sensor information in mib. This PR is going to add more physical entity information to db, for example: fan drawer, fan, fan tachometers, PSU, PSU sensor, chassis sensors.

What I did?

  1. Add new fields model, serial, current, power, is_replaceable to PSU_INFO table
  2. Add new table FAN_DRAWER_INFO with fields presence, model, serial, status, is_replaceable, led_status
  3. Add field is_replaceable to FAN_INFO and TRANSCEIVER_INFO table
  4. Add new table PHYSICAL_ENTITY_INFO with fields position_in_parent and parent_name

@lgtm-com
Copy link

lgtm-com bot commented Oct 16, 2020

This pull request introduces 1 alert when merging a11bf5c into 8507085 - view on LGTM.com

new alerts:

  • 1 for Unused import

@sujinmkang
Copy link
Collaborator

can you also resolve the conflicts?

@sujinmkang
Copy link
Collaborator

@Junchao-Mellanox is SNMP Query for the physical entity information also available? If so, can you share the snmp query result too?

@Junchao-Mellanox
Copy link
Collaborator Author

Hi @sujinmkang, yes, we have snmp query available now. It is a very long ouput, here is some snippet:

root@d90d87061561:~/root # snmpwalk -v 1 -c public 10.210.25.3 .1.3.6.1.2.1.47.1.1.1.1.2
iso.3.6.1.2.1.47.1.1.1.1.2.1 = STRING: "chassis 1"
iso.3.6.1.2.1.47.1.1.1.1.2.200000000 = STRING: "MGMT"
iso.3.6.1.2.1.47.1.1.1.1.2.200990110 = STRING: "CPU Core 0 Temp"
iso.3.6.1.2.1.47.1.1.1.1.2.200990210 = STRING: "CPU Core 1 Temp"
iso.3.6.1.2.1.47.1.1.1.1.2.200990310 = STRING: "CPU Pack Temp"
iso.3.6.1.2.1.47.1.1.1.1.2.200990410 = STRING: "xSFP module 1 Temp"
iso.3.6.1.2.1.47.1.1.1.1.2.200990510 = STRING: "xSFP module 2 Temp"
iso.3.6.1.2.1.47.1.1.1.1.2.200990610 = STRING: "xSFP module 3 Temp"
iso.3.6.1.2.1.47.1.1.1.1.2.200990710 = STRING: "xSFP module 4 Temp"
iso.3.6.1.2.1.47.1.1.1.1.2.200993610 = STRING: "PSU-1 Temp"
iso.3.6.1.2.1.47.1.1.1.1.2.200993710 = STRING: "PSU-2 Temp"
iso.3.6.1.2.1.47.1.1.1.1.2.200993810 = STRING: "ASIC"
iso.3.6.1.2.1.47.1.1.1.1.2.200993910 = STRING: "Ambient COMEX Temp"
iso.3.6.1.2.1.47.1.1.1.1.2.200994010 = STRING: "Ambient Port Side Temp"
iso.3.6.1.2.1.47.1.1.1.1.2.200994110 = STRING: "Ambient Fan Side Temp"
iso.3.6.1.2.1.47.1.1.1.1.2.500000000 = STRING: "drawer1"
iso.3.6.1.2.1.47.1.1.1.1.2.500020100 = STRING: "fan1"
iso.3.6.1.2.1.47.1.1.1.1.2.500020120 = STRING: "Tachometers for fan1"
iso.3.6.1.2.1.47.1.1.1.1.2.500020200 = STRING: "fan2"
iso.3.6.1.2.1.47.1.1.1.1.2.500020220 = STRING: "Tachometers for fan2"

root@d90d87061561:~/root # snmpwalk -v 1 -c public 10.210.25.3 .1.3.6.1.2.1.47.1.1.1.1.4
iso.3.6.1.2.1.47.1.1.1.1.4.1 = INTEGER: 0
iso.3.6.1.2.1.47.1.1.1.1.4.200000000 = INTEGER: 1
iso.3.6.1.2.1.47.1.1.1.1.4.200990110 = INTEGER: 200000000
iso.3.6.1.2.1.47.1.1.1.1.4.200990210 = INTEGER: 200000000
iso.3.6.1.2.1.47.1.1.1.1.4.200990310 = INTEGER: 200000000
iso.3.6.1.2.1.47.1.1.1.1.4.200990410 = INTEGER: 200000000
iso.3.6.1.2.1.47.1.1.1.1.4.200990510 = INTEGER: 200000000
iso.3.6.1.2.1.47.1.1.1.1.4.200990610 = INTEGER: 200000000
iso.3.6.1.2.1.47.1.1.1.1.4.200990710 = INTEGER: 200000000
iso.3.6.1.2.1.47.1.1.1.1.4.200993610 = INTEGER: 200000000
iso.3.6.1.2.1.47.1.1.1.1.4.200993710 = INTEGER: 200000000
iso.3.6.1.2.1.47.1.1.1.1.4.200993810 = INTEGER: 200000000
iso.3.6.1.2.1.47.1.1.1.1.4.200993910 = INTEGER: 200000000
iso.3.6.1.2.1.47.1.1.1.1.4.200994010 = INTEGER: 200000000
iso.3.6.1.2.1.47.1.1.1.1.4.200994110 = INTEGER: 200000000
iso.3.6.1.2.1.47.1.1.1.1.4.500000000 = INTEGER: 1
iso.3.6.1.2.1.47.1.1.1.1.4.500020100 = INTEGER: 500000000
iso.3.6.1.2.1.47.1.1.1.1.4.500020120 = INTEGER: 500020100
iso.3.6.1.2.1.47.1.1.1.1.4.500020200 = INTEGER: 500000000
iso.3.6.1.2.1.47.1.1.1.1.4.500020220 = INTEGER: 500020200

Copy link
Collaborator

@sujinmkang sujinmkang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you rebase the PR?

@Junchao-Mellanox
Copy link
Collaborator Author

can you rebase the PR?

Done

@sujinmkang
Copy link
Collaborator

@Junchao-Mellanox can you rebase again? I will approve as soon as you rebase.

Conflicts:
	sonic-psud/scripts/psud
	sonic-thermalctld/scripts/thermalctld
	sonic-thermalctld/tests/mock_platform.py
…-daemons into phy-mibs

Conflicts:
	sonic-psud/scripts/psud
@Junchao-Mellanox
Copy link
Collaborator Author

@sujinmkang done.

@sujinmkang sujinmkang merged commit ef15ff5 into sonic-net:master Nov 16, 2020
jleveque pushed a commit that referenced this pull request Nov 19, 2020
…or physical entity mib (#102)

* Update pmon daemons for SONiC Physical Entity MIB feature
@jleveque
Copy link
Contributor

jleveque commented Nov 19, 2020

@Junchao-Mellanox: If the submodule is updated to include this PR, we are seeing the following unit test error:

=================================== FAILURES ===================================
______________________ test_updater_thermal_check_min_max ______________________
    def test_updater_thermal_check_min_max():
        chassis = MockChassis()
    
        thermal = MockThermal()
        chassis.get_all_thermals().append(thermal)
    
        chassis.set_modular_chassis(True)
        chassis.set_my_slot(1)
        temperature_updater = TemperatureUpdater(SYSLOG_IDENTIFIER, chassis)
    
        temperature_updater.update()
        slot_dict = temperature_updater.chassis_table.get('Thermal 1')
>       assert slot_dict['minimum_temperature'] == str(thermal.get_minimum_recorded())
E       TypeError: 'NoneType' object has no attribute '__getitem__'

Can you please check? I may need to revert this PR.

EDIT: It appears a fix has been submitted. Can you please review? #121

jleveque pushed a commit that referenced this pull request Nov 20, 2020
Fixes the following crash introduced by #102:

```
01:33:00  ______________________ test_updater_thermal_check_min_max ______________________
01:33:00  
01:33:00      def test_updater_thermal_check_min_max():
01:33:00          chassis = MockChassis()
01:33:00      
01:33:00          thermal = MockThermal()
01:33:00          chassis.get_all_thermals().append(thermal)
01:33:00      
01:33:00          chassis.set_modular_chassis(True)
01:33:00          chassis.set_my_slot(1)
01:33:00          temperature_updater = TemperatureUpdater(SYSLOG_IDENTIFIER, chassis)
01:33:00      
01:33:00          temperature_updater.update()
01:33:00          slot_dict = temperature_updater.chassis_table.get('Thermal 1')
01:33:00  >       assert slot_dict['minimum_temperature'] == str(thermal.get_minimum_recorded())
01:33:00  E       TypeError: 'NoneType' object has no attribute '__getitem__'
01:33:00  
01:33:00  tests/test_thermalctld.py:341: TypeError
```

Signed-off-by: Petro Bratash <petrox.bratash@intel.com>

Signed-off-by: Petro Bratash <petrox.bratash@intel.com>
@Junchao-Mellanox Junchao-Mellanox deleted the phy-mibs branch October 29, 2021 01:47
vdahiya12 pushed a commit to vdahiya12/sonic-platform-daemons that referenced this pull request Apr 4, 2022
- What I did
Following SFF-8472 to read diagnostic monitoring type register.
Use that register to check if diagnostic monitoring function implemented or not.

- How I did it
Check the register position from SFF-8472 document.
Read the register value from the EEPROM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants