Open Ethernet Networking (OpEN) API Guide and Reference Manual
3.6.0.3
|
On most platforms, a support file may be generated that contains a "dump" of information regarding the current operating condition of the system. This file is often requested by the product support team (i.e. Level 3 Support) to help triage a system that is not functioning properly, or has reported a crash that necessitated a reboot. While there is a wealth of information contained in the support file, it is usually of little value (or interest) to the end user, and is primarily intended for technical support engineers.
When created, the support file is stored in a non-volatile section of the platform file system with a file name that is determined by ICOS. OpEN APIs are available to determine the maximum length of a file system file name (including its path) and to generate the support file itself.
This document provides a brief description of the Support File OpEN API, which allows processes outside of the ICOS main process (switchdrvr) to generate a support file. It provides the following service:
To ensure future compatibility, do not assume the name of the support file in any code written to interact with these OpEN APIs, since it may vary from one platform to another, and possibly between different firmware images for a given platform. Instead, use the file name provided as output when the file is generated. Once the file name is obtained, normal file I/O operations in the application's native programming language may be used to read its contents, copy the file to another location, etc.
In the main function, the sample application initializes the OpEN API RPC service by calling openapiClientRegister() and waits for the RPC service in switchdrvr to start. A Client Handle is returned by openapiClientRegister() which is used while invoking the OpEN APIs. The application then exercises the associated OpEN APIs and logs informational and/or error messages on the console. The example application runs to completion and exits.
suppfile_example.c is a sample application that demonstrates the use of the support file OpEN API. The suppfile_example is invoked from the command line and accepts a optional parameter (an integer 0 or greater) specifying the number of lines to display from the generated support file. A value of 0 is used to display the entire file. By default, only a handful of lines are displayed.
The suppfile_example main() function is rather simple. It displays the Network OS (i.e. ICOS) software version and the current OpEN API version for reference. It then attempts to create and display the support file contents, up to the number of lines specified (if any), or the default thereof. Since the maximum length of a system file name (including its path) can vary by platform, openapiSystemFileNameMaxLengthGet() must be used to obtain this value at run-time, which is subsequently used to create a string buffer of sufficient size to store the support file name.
Please note that a display containing Feature not supported is shown in the output if appropriate.
# ./suppfile_example 25
ICOS Version 8.2.0.0
OpEN version = 1.6.0.0
Creating Tech Support file (this may take a while)...
Tech support file created successfully.
Displaying first 25 lines of file: /mnt/fastpath/TechSupport
*************** show version ***************
Switch: 2
System Description............................. Broadcom Trident 56846 Development System - 48xTenGig + 4 FortyGig , 8.2.2.0, Linux 3.8.13-rt9-1ae2bca7
Machine Type................................... Broadcom Trident 56846 Development System - 48xTenGig + 4 FortyGig
Machine Model.................................. BCM-56846
Maintenance Level.............................. A
Manufacturer................................... 0xbc00
Burned In MAC Address.......................... 00:10:18:7F:F4:2F
Software Version............................... 8.2.0.0
Operating System............................... Linux 3.8.13-rt9-1ae2bca7
Network Processing Device...................... BCM56846_A0
Additional Packages............................ FASTPATH QOS
FASTPATH IPv6 Management
FASTPATH Stacking
FASTPATH Routing
FASTPATH OpEN API
In addition to the C code example, a Python implementation is also provided for demonstration purposes. This Python suppfile_example.py script essentially duplicates the suppfile_example.c implementation and produces the same output.
In addition to the C code example, a Ruby implementation is also provided for demonstration purposes. This Ruby suppfile_example.rb application essentially duplicates the suppfile_example.c implementation and produces the same output.
The CLI syntax used in the following table is approximate and may vary by platform.
CLI Command | OpEN API Reference |
---|---|
(Routing)# show tech-support file | openapiSystemFileNameMaxLengthGet() openapiSupportFileGenerate() |