Skip to content

Commit

Permalink
Merge pull request sonic-net#8 from rajendra-dendukuri/kdump_ocyang_u…
Browse files Browse the repository at this point in the history
…pdates

OC YANG compliant datamodel for Kdump
  • Loading branch information
rajendra-dendukuri authored Aug 18, 2020
2 parents 99ce377 + 7adc864 commit bb1ac6f
Showing 1 changed file with 35 additions and 15 deletions.
50 changes: 35 additions & 15 deletions system/SONiC-kdump.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand All @@ -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 "<REST-SERVER:PORT>/restconf/data/openconfig-system:system/openconfig-system-ext:kdump/config" -d "{ \"openconfig-system-ext:config\": {\"enable\": true}}"
PATCH "<REST-SERVER:PORT>/restconf/data/openconfig-system:system/openconfig-system-ext:kdump/config" -d "{ \"openconfig-system-ext:config\": {\"enable\": false}}"
PATCH "<REST-SERVER:PORT>/restconf/data/openconfig-system:system/openconfig-system-ext:kdump/config" -d "{ \"openconfig-system-ext:config\": {\"memory\": "512M"}}"
PATCH "<REST-SERVER:PORT>/restconf/data/openconfig-system:system/openconfig-system-ext:kdump/config" -d "{ \"openconfig-system-ext:config\": {\"max-dumps\": 5}}"
GET "<REST-SERVER:PORT>/restconf/data/openconfig-system:system/openconfig-system-ext:kdump/kdump-records"
GET "<REST-SERVER:PORT>/restconf/data/openconfig-system:system/openconfig-system-ext:kdump/config"
GET "<REST-SERVER:PORT>/restconf/data/openconfig-system:system/openconfig-system-ext:kdump/state"
```

##### Debug Commands

N/A
Expand Down

0 comments on commit bb1ac6f

Please sign in to comment.