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

[PSU]: Return number of PSU as zero for Chassis Linecard #323

Closed
wants to merge 1 commit into from

Conversation

SuvarnaMeenakshi
Copy link
Contributor

- What I did
If SNMP query is sent to get the PSU details, implementation catches Exception on Chassis Linecard.
This Exception log message is seen for every SNMP query made and can cause many syslogs if continuous polling is done.

docker exec -it snmp snmpwalk -v2c -c <comm> 127.0.0.1 1.3.6.1.4.1.9.9.117.1.1.2.1
ERR snmp#snmp-subagent [sonic_ax_impl] ERROR: PowerStatusHandler._get_psu_index() caught an unexpected exception during _get_num_psus()#012Traceback (most recent call last):#012  File "/usr/local/lib/python3.9/dist-packages/sonic_ax_impl/mibs/vendor/cisco/ciscoEntityFruControlMIB.py", line 101, in _get_psu_index#012    num_psus = self._get_num_psus()#012  File "/usr/local/lib/python3.9/dist-packages/sonic_ax_impl/mibs/vendor/cisco/ciscoEntityFruControlMIB.py", line 66, in _get_num_psus#012    return int(num_psus[0])#012ValueError: invalid literal for int() with base 10: ''

This error is seen because SNMP implementation expects num_psus to be present in CHASSIS_INFO table.
But on linecard num_psus is not present.

 sonic-db-cli STATE_DB hgetall  "CHASSIS_INFO|chassis 1"
{'serial': '...', 'model': '..', 'revision': '..'}

- How I did it
If SNMP query is made on Chassis Linecard, then return num_psus as 0.
No change on single asic device.
- How to verify it
Verified that no Exception is logged on Chassis Linecard, also added unit-tests.
- Description for the changelog

Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
@qiluo-msft
Copy link
Contributor

You mentioned "on linecard num_psus is not present". From design point of view, is it by design or a bug? If it is a bug, should we fix the database content instead of snmpagent?

@SuvarnaMeenakshi
Copy link
Contributor Author

closing this PR, raised a issue to fix this on Nokia platform sonic-net/sonic-buildimage#19535

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