-
Notifications
You must be signed in to change notification settings - Fork 14
Configurable timeout for dmesg scan #518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sfc-gh-iyashchyshyn
merged 4 commits into
main
from
iyashchyshyn/configurable-dmesg-time
Dec 19, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
3cddb94
Configurable timeout for dmesg
sfc-gh-iyashchyshyn be473ae
dmesg impl concurrency adjustement, review fixes
sfc-gh-iyashchyshyn 52778cf
concurrency fix
sfc-gh-iyashchyshyn b3a7c48
Fixed server logic to error on invalid dmesg-read-timeout
sfc-gh-iyashchyshyn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# System Info | ||
Service to retrieve system information from target system, such as kernel messages, uptime and journaling entries. | ||
|
||
# Usage | ||
|
||
### sanssh sysinfo uptime | ||
Print the uptime of the system in below format: System_idx (ip:port) up for X days, X hours, X minutes, X seconds | total X seconds (X is a placeholder that will be replaced) | ||
|
||
```bash | ||
sanssh <sanssh-args> sysinfo uptime | ||
``` | ||
Where: | ||
- `<sanssh-args>` common sanssh arguments | ||
|
||
Examples: | ||
```bash | ||
# Get data from a yml file | ||
sanssh --targets=localhost sysinfo uptime | ||
``` | ||
|
||
### sanssh sysinfo dmesg | ||
Print the messages from kernel ring buffer. | ||
|
||
```bash | ||
sanssh <sanssh-args> sysinfo dmesg [--tail==<tail-n-lines>] [--grep=<grep-pattern>] [-i] [-v] [--dmesg-read-timeout=<timeout>] | ||
``` | ||
|
||
Where: | ||
- `<sanssh-args>` common sanssh arguments | ||
- `<tail-n-lines>` specify number of lines to `tail` | ||
- `<grep-pattern>` grep regex pattern to filter out messages with | ||
- `-i` - ignore grep case | ||
- `-v` - inverted match grep | ||
- `<dmesg-read-timeout>` timeout collection of kernel messages after this duration, default is 2 seconds, must be specified in time.ParseDuration compatible format | ||
|
||
Examples: | ||
```bash | ||
### Default | ||
sanssh --targets localhost sysinfo dmesg | ||
### Get messages matching NVMe SSD pattern | ||
sanssh --targets localhost sysinfo dmesg --grep "nvme1n1.*ssd.*" | ||
### Get messages not related to BTRFS (ignoring case) | ||
sanssh --targets localhost sysinfo dmesg -grep "btrfs" -i -v | ||
### Collect messages for 10 seconds | ||
sanssh --targets localhost sysinfo dmesg -grep "btrfs" -i -v --dmesg-read-timeout=10s | ||
``` | ||
|
||
### sanssh sysinfo journalctl | ||
Get the log entries stored in journald by systemd-journald.service | ||
|
||
```bash | ||
sanssh <sanssh-args> sysinfo djournalctl [--since|--S=<since>] [--until|-U=<until>] [-tail=<tail>] [-u|-unit=<unit>] [--json] | ||
``` | ||
|
||
Where: | ||
- `<sanssh-args>` common sanssh arguments | ||
- `<since>` Sets the date (YYYY-MM-DD HH:MM:SS) we want to filter from | ||
- `<until>` Sets the date (YYYY-MM-DD HH:MM:SS) we want to filter until | ||
- `<tail>` - If positive, the latest n records to fetch. By default, fetch latest 100 records. The upper limit is 10000 for now | ||
- `<unit>` - Sets systemd unit to filter messages | ||
- `--json` - Print the journal entries in JSON format(can work with jq for better visualization) | ||
|
||
Examples: | ||
```bash | ||
### Get 5 journalctl entries in json format between 18th and 19th of December 2024 | ||
sanssh --targets localhost sysinfo journalctl --json --tail 5 --since "2024-12-18 00:00:00" --until "2024-12-19 00:00:00" | ||
### Read entries from default.target unit | ||
sanssh --targets localhost sysinfo journalctl --unit default.target | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.