Added 'config core' and 'show cores' CLI commands #663
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- What I did
Added wrapper CLI commands to see core files information. Also added CLI command to enable/disable
corefile generation.
- How I did it
Added new commands
config core
show cores
- How to verify it
show cores list
config core enable
config core disable
- Previous command output (if the output of a command-line utility has changed)
- New command output (if the output of a command-line utility has changed)
root@sonic:/home/admin# show cores
Usage: show cores [OPTIONS] COMMAND [ARGS]...
Show core dump events encountered
Options:
-?, -h, --help Show this message and exit.
Commands:
config Show coredump configuration
info Show information about one or more coredumps
list List available coredumps
root@sonic:/home/admin# show cores list
TIME PID UID GID SIG COREFILE EXE
Sat 2016-12-31 22:46:22 UTC 4933 0 0 6 present /usr/bin/vlanmgrd
root@sonic:/home/admin# show cores info
PID: 4933 (vlanmgrd)
UID: 0 (root)
GID: 0 (root)
Signal: 6 (ABRT)
Timestamp: Sat 2016-12-31 22:46:22 UTC (6min ago)
Command Line: /usr/bin/vlanmgrd
Executable: /usr/bin/vlanmgrd
Control Group: /docker/38e40a3313bd46ff4e282f897cdc25502a2b15febe9839715f92b035b6f2cffe
Slice: -.slice
Boot ID: 3f776b83fa704d089bd81e0b108c2a09
Machine ID: a0c0523aae8c4c21a8d9fa12e18d85b0
Hostname: sonic
Storage: /var/lib/systemd/coredump/core.vlanmgrd.0.3f776b83fa704d089bd81e0b108c2a09.4933.1483224382000000000000.lz4
Message: Process 4933 (vlanmgrd) of user 0 dumped core.
root@sonic:/home/admin#
-->