From 7adc8648158fd67bef5bbeb9da6830a5ab74668b Mon Sep 17 00:00:00 2001 From: Rajendra Dendukuri Date: Mon, 8 Jun 2020 09:37:24 -0700 Subject: [PATCH] OC YANG compliant datamodel for Kdump --- system/SONiC-kdump.md | 50 ++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/system/SONiC-kdump.md b/system/SONiC-kdump.md index 94315814c6a7..b6d1031c93b6 100644 --- a/system/SONiC-kdump.md +++ b/system/SONiC-kdump.md @@ -31,6 +31,7 @@ - [Data Models](#data-models) - [Configuration commands:](#configuration-commands) - [Show Commands](#show-commands) + - [REST API Support](#rest-api-support) - [How to use the kernel core dump files](#how-to-use-the-kernel-core-dump-files) - [Introduction](#introduction) - [Use the kernel core dump file on the switch](#use-the-kernel-core-dump-file-on-the-switch) @@ -203,21 +204,24 @@ kdump configuration and status parameters are defined in the openconfig-kump yan ``` +--rw oc-sys-ext:kdump - +--rw oc-sys-ext:config - | +--rw oc-sys-ext:enable? boolean - | +--rw oc-sys-ext:memory? string - | +--rw oc-sys-ext:max-dumps? uint8 - +--ro oc-sys-ext:state - +--ro oc-sys-ext:enable? boolean - +--ro oc-sys-ext:memory? string - +--ro oc-sys-ext:max-dumps? uint8 - +--ro oc-sys-ext:current-state? kdump-current-state - +--ro oc-sys-ext:allocated-memory? uint64 - +--ro oc-sys-ext:kdump-record* [id] - +--ro oc-sys-ext:id string - +--ro oc-sys-ext:vmcore-diagnostic-message? string - +--ro oc-sys-ext:vmcore-diagnostic-message-file? string - +--ro oc-sys-ext:vmcore? string + | +--rw oc-sys-ext:config + | | +--rw oc-sys-ext:enable? boolean + | | +--rw oc-sys-ext:memory? string + | | +--rw oc-sys-ext:max-dumps? uint8 + | +--ro oc-sys-ext:state + | | +--ro oc-sys-ext:enable? boolean + | | +--ro oc-sys-ext:memory? string + | | +--ro oc-sys-ext:max-dumps? uint8 + | | +--ro oc-sys-ext:current-state? kdump-current-state + | | +--ro oc-sys-ext:allocated-memory? uint64 + | +--ro oc-sys-ext:kdump-records + | +--ro oc-sys-ext:kdump-record* [id] + | +--ro oc-sys-ext:id -> ../state/id + | +--ro oc-sys-ext:state + | +--ro oc-sys-ext:id? string + | +--ro oc-sys-ext:vmcore-diagnostic-message? string + | +--ro oc-sys-ext:vmcore-diagnostic-message-file? string + | +--ro oc-sys-ext:vmcore? string ``` #### CLI @@ -317,6 +321,7 @@ Record Key Filename ``` + **show kdump log [X]** This command is used to display the last *X* lines of the kernel log ring buffer. If *X* is not provided, the default value *100* is being used. The kernel log buffer typically contains the kernel back-trace. The crash dump can be specified by using either the Record number or the the Key name. The Filenames are displayed for reference. @@ -340,6 +345,21 @@ File: /var/crash/202005111225/dmesg.202005111225 [ 160.863629] CR2: 0000000000000000 ``` +##### REST API Support + +The following REST URIs are supported to manage kdump configuration and view kernel core files information. + +``` +PATCH "/restconf/data/openconfig-system:system/openconfig-system-ext:kdump/config" -d "{ \"openconfig-system-ext:config\": {\"enable\": true}}" +PATCH "/restconf/data/openconfig-system:system/openconfig-system-ext:kdump/config" -d "{ \"openconfig-system-ext:config\": {\"enable\": false}}" +PATCH "/restconf/data/openconfig-system:system/openconfig-system-ext:kdump/config" -d "{ \"openconfig-system-ext:config\": {\"memory\": "512M"}}" +PATCH "/restconf/data/openconfig-system:system/openconfig-system-ext:kdump/config" -d "{ \"openconfig-system-ext:config\": {\"max-dumps\": 5}}" + +GET "/restconf/data/openconfig-system:system/openconfig-system-ext:kdump/kdump-records" +GET "/restconf/data/openconfig-system:system/openconfig-system-ext:kdump/config" +GET "/restconf/data/openconfig-system:system/openconfig-system-ext:kdump/state" +``` + ##### Debug Commands N/A