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

Modify decode-syseeprom to get serial number from redis-db #21831

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SuvarnaMeenakshi
Copy link
Contributor

@SuvarnaMeenakshi SuvarnaMeenakshi commented Feb 22, 2025

Why I did it

During runtime, if snmp service is restarted, it can fail to come up while /usr/bin/snmp.sh is waiting to read device serial number at this command: decode-syseeprom -s. This can cause snmp service to fail but snmp dockers to be up.
This can happen because at runtime if the eeprom becomes inaccessible due to HW issue.
To avoid snmp crash pass "-d" option in decode-syseeprom to read data from redis-db

decode-syseeprom -d -s

Work item tracking
  • Microsoft ADO 31454008:

How I did it

To avoid snmp crash pass "-d" option in decode-syseeprom to read data from redis-db

How to verify it

verified on Pizza box device:
After fix, reboot the device, once SNMP docker comes up, DEVICE_METADATA will be updated with serial number.

foo$ sonic-db-cli STATE_DB hgetall 'DEVICE_METADATA|localhost'
{}
foo$ docker ps
CONTAINER ID   IMAGE                             COMMAND                  CREATED        STATUS              PORTS     NAMES
397c38f33729   docker-lldp:latest                "/usr/bin/docker-lld…"   21 hours ago   Up 5 seconds                  lldp
77bb2f85e149   docker-sonic-gnmi:latest          "/usr/local/bin/supe…"   21 hours ago   Up 10 seconds                 gnmi
5536b3cd5416   docker-sonic-restapi:latest       "/usr/local/bin/supe…"   21 hours ago   Up About a minute             restapi
96345021e646   78eda70fec8c                      "/usr/bin/docker_ini…"   21 hours ago   Up About a minute             dhcp_relay
ce06892d670d   docker-router-advertiser:latest   "/usr/bin/docker-ini…"   21 hours ago   Up About a minute             radv
8658e06b7279   docker-fpm-frr:latest             "/usr/bin/docker_ini…"   21 hours ago   Up About a minute             bgp
abafa5b7c4d8   docker-syncd-brcm:latest          "/usr/local/bin/supe…"   21 hours ago   Up About a minute             syncd
6c946de02e3b   docker-teamd:latest               "/usr/local/bin/supe…"   21 hours ago   Up About a minute             teamd
06d1f337ffc9   docker-orchagent:latest           "/usr/bin/docker-ini…"   21 hours ago   Up About a minute             swss
9d36a4e31a1d   docker-acms:latest                "/usr/local/bin/supe…"   21 hours ago   Up About a minute             acms
b4b7b91c7921   docker-database:latest            "/usr/local/bin/dock…"   21 hours ago   Up About a minute             database
foo$ docker ps
CONTAINER ID   IMAGE                             COMMAND                  CREATED        STATUS              PORTS     NAMES
0e07f1e18db0   docker-snmp:latest                "/usr/bin/docker-snm…"   21 hours ago   Up 27 seconds                 snmp
0f407593a6ee   docker-platform-monitor:latest    "/usr/bin/docker_ini…"   21 hours ago   Up 35 seconds                 pmon
397c38f33729   docker-lldp:latest                "/usr/bin/docker-lld…"   21 hours ago   Up 41 seconds                 lldp
77bb2f85e149   docker-sonic-gnmi:latest          "/usr/local/bin/supe…"   21 hours ago   Up 46 seconds                 gnmi
5536b3cd5416   docker-sonic-restapi:latest       "/usr/local/bin/supe…"   21 hours ago   Up 2 minutes                  restapi
96345021e646   78eda70fec8c                      "/usr/bin/docker_ini…"   21 hours ago   Up About a minute             dhcp_relay
ce06892d670d   docker-router-advertiser:latest   "/usr/bin/docker-ini…"   21 hours ago   Up About a minute             radv
8658e06b7279   docker-fpm-frr:latest             "/usr/bin/docker_ini…"   21 hours ago   Up About a minute             bgp
abafa5b7c4d8   docker-syncd-brcm:latest          "/usr/local/bin/supe…"   21 hours ago   Up About a minute             syncd
6c946de02e3b   docker-teamd:latest               "/usr/local/bin/supe…"   21 hours ago   Up About a minute             teamd
06d1f337ffc9   docker-orchagent:latest           "/usr/bin/docker-ini…"   21 hours ago   Up 2 minutes                  swss
9d36a4e31a1d   docker-acms:latest                "/usr/local/bin/supe…"   21 hours ago   Up 2 minutes                  acms
b4b7b91c7921   docker-database:latest            "/usr/local/bin/dock…"   21 hours ago   Up 2 minutes                  database
foo$ sonic-db-cli STATE_DB hgetall 'DEVICE_METADATA|localhost'
{'chassis_serial_number': 'SSJ17111898'}

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

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

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).

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.

3 participants