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

[asic_sensors] Generate the asic_sensors polling configuration based on the platform.json #21229

Closed

Conversation

mlok-nokia
Copy link
Contributor

Why I did it

For any platform which supports the asic_sensors pulling, it requires the configuration files (config_db#.json) contain the following configuration to trigger the system to poll the ASIC sensors temperature. Fixes https://github.com/Nokia-ION/ndk/issues/48

Work item tracking
  • Microsoft ADO (number only):

How I did it

  • Add new module src/sonic-config-engine/asic_sensors_config.py with function get_asic_sensors_config(). This function checks if device data platform.json contains the following configuration, it will generate the asic_sensors pulling configuration.
$ cat platform.json
{
...
...
...
   "asic_sensors": {
        "poll_interval": "10",
        "poll_admin_status": "enable"
    }
}
  • Modify the script sonic-cfggen platform option "-H" to call the function get_asic_sensor_config() to generate the asic_sensors pulling configuration.
  • Added new UT test_asic_sensors_config() to test_cfggen.py to test related the implementation.

Notice: For all platforms which support the asic_sensors polling requires to add the following definition to the device data platform.json file

$ cat platform.json
{
...
...
...
   "asic_sensors": {
        "poll_interval": "10",
        "poll_admin_status": "enable"
    }
}

How to verify it

  1. Running the new image on the platform which supports the ASIC_SENSORS
  2. Execute the CLI command "sonic-cfggen -H --print-data", the following code will be generated
{
   "ASIC_SENSORS": {
        "ASIC_SENSORS_POLLER_INTERVAL": {
            "interval": "10"
        },
        "ASIC_SENSORS_POLLER_STATUS": {
            "admin_status": "enable"
        }
    }
}

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305
  • 202405

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mlok-nokia
Copy link
Contributor Author

closed as duplicated with #20826

@mlok-nokia mlok-nokia closed this Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants