Skip to content

op-mode: T6498: add machine-readable tech support report script #3746

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

Conversation

dmbaturin
Copy link
Member

Change Summary

This PR adds two new commands:

show tech-support report machine-readable
show tech-support report machine-readable save <FILE PATH>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Component(s) name

Op mode.

Proposed changes

The scrips outputs its data in JSON for now: first to integrate with the normal machine-readable op mode system; second, because existing Python TOML writers aren't that great and don't produce multi-line strings, etc. — we can reconsider that if we make a writer or find a good one.

But we'll likely need to also add a format option to vyos.opmode because right now it assumes that all output must be JSON.

Things that are truly machine-readable:

  • Last logs (through journald)
  • Package list
  • Kernel module info
  • Routing and neighbor tables
  • Link and address info
  • System image info
  • Version data
  • Storage data
  • CPU info
  • Uptime and load average

Things that are embedded as strings:

  • Configs (we need them as is to see if there are any syntax issues or other anomalies)
  • nftables config (intentionally raw)
  • Process info (could be parsed)
  • Hardware info
  • Interrupt info

Configs are anonymized using the code from the ill-fated PR to improve the strip-private filter. Even though that code turned out to be insufficient for the filter because the filter isn't aware of the config path, for this purpose they are fine because the tech support report only includes complete configs.

P.S.

To my dismay, I found that a bunch of Linux utils, including ip, parted, and several FRR commands produce invalid JSON that cannot be parsed. I'll follow up with patches to upstream projects to fix that.

How to test

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Copy link

github-actions bot commented Jul 1, 2024

👍
No issues in PR Title / Commit Title

Copy link

github-actions bot commented Jul 1, 2024

👍 VyOS CLI smoketests finished successfully!

@dmbaturin dmbaturin force-pushed the T6498-machine-readable-tech-support-report branch from eda759e to 7958c97 Compare July 3, 2024 12:00
Copy link

github-actions bot commented Jul 3, 2024

CI integration 👍 passed!

Details

CI logs

  • 👍 passed CLI Smoketests returned:
  • 👍 passed Config tests returned:
  • 👍 passed RAID1 tests returned:

@dmbaturin dmbaturin merged commit d0bc944 into vyos:current Jul 3, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

4 participants