Skip to content

The PSU CLI and SNMP support

AndriiS edited this page Oct 25, 2017 · 14 revisions

The PSU CLI and SNMP support

High Level Design Document

Rev 0.1

Table of Contents

List of Tables

Revision
Rev Date Author Change Description
0.1 Andrii Savka Initial version

About this Manual

This document provides general information about the PSU CLI and SNMP support feature.

Scope

This document describes the high level design of the PSU CLI and SNMP support feature.

Definitions/Abbreviation

Table 2: Abbreviations
Definitions/Abbreviation Description
SNMP Simple Network Management Protocol
PSU Power supply unit
API Application Programmable Interface
CLI Command-line utility

1 Overview

1.1 PSU Chart

Following diagram describes a top level overview of the SONiC PSU architecture:

1.2 Modules description

1.2.1 SNMP agent

The agent handles the SNMP requests and takes the PSU status from PSU API.

1.2.2 SONiC-utilities

The command-line utilities for SONiC

2 Requirements

2.1 Platform PSU API

Microsoft will develop a simple plugin-style API in the vein of sfputil.py and led_control.py. Initial functionality will consist of a function that takes a zero-based integer parameter which specifies the ID of the PSU and returns a boolean value indicating the status of the PSU:

  • true if the PSU is functioning correctly
  • false if not.

In this function, any platform-specific appropriate voltage/amperage/temperature calculations should be carried out to determine whether the PSU is operating properly or not.

Each vendor needs to implement the PSU module for API which should provide the status whether specified PSU has correct functioning.

2.2 Command-line utility for querying PSU status

Mellanox will implement a simple Python command-line utility which implements the plugin and can output the status of each PSU/all PSUs. The CLI will use PSU API to get PSU status. The CLI should has following behavior:

Input parameters CLI expected result
No Input parameters Provide the status of all PSUs which are available in the platform
PSU ID Provide the status for specific PSU

2.3 SNMP agent support

Mellanox will add the PSU support to SNMP agent for retrieving PSU statuses. Querying below OID should return the status of PSU/PSUs in the platform. The response has following integer values:

  • “1” for proper operational status
  • “0” for faulty

The following OID should be supported:

OID Description of the SNMP instance
1.3.6.1.4.1.9.9.117.1.1.2 cefcFRUPowerStatusTable
1.3.6.1.4.1.9.9.117.1.1.2.1 cefcFRUPowerStatusEntry
1.3.6.1.4.1.9.9.117.1.1.2.1.2 return the statuses of all PSUs which are available in the platform
1.3.6.1.4.1.9.9.117.1.1.2.1.2.psu_index return the status of PSU specified by psu_index

3 Modules Design

3.1 Modules that need to be updated

3.1.1 SNMP agent

The support for the new PSU OID should be added.

3.1.2 SONiC-utilities

The following components should be implemented:

  • The PSU plugin-style API for SONiC that takes a zero-based PSU ID and returns a boolean value indicating the status of the PSU.
  • The Python command-line utility that provides the PSU(s) status.
  • Each vendor needs to implement the PSU module for API which should provide the status whether specified PSU has correct functioning.

4 Flows

4.1 Get the PSU status by CLI

4.2 Get the PSU status by SNMP

5 Open Questions

  1. Where should the vendor API plugin be placed ? I would like to suggest following place: "sonic-buildimage/device/[vendor]/[platform]/plugins/"
  2. Should we add the PSU cli to "show" command as it's done for eeprom? For example, "show platform psustatus" command displays the status of each PSU.
  3. Can we extend the "sensor" test to cover the psuutil and rename the test to be more general, for example "platform" test ?
Clone this wiki locally