Linux command
gcpdiag 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run lint checks
gcpdiag lint --project [project_id]
Run with specific rule
gcpdiag lint --project [project_id] --include [gke/ERR/2021_001]
Run excluding rules
gcpdiag lint --project [project_id] --exclude [gke/*]
Output as JSON
gcpdiag lint --project [project_id] --output json
Enable verbose output
gcpdiag lint --project [project_id] --verbose
说明
gcpdiag is a command-line diagnostics tool for Google Cloud Platform that runs automated checks against projects to identify common issues. It analyzes infrastructure for misconfigurations, quota problems, permission errors, and best practice violations. The tool executes a curated set of rules organized by service (GKE, Compute Engine, Cloud SQL, etc.). Each rule checks for specific known issues based on Google's internal troubleshooting knowledge. Results indicate whether checks passed, failed, or were skipped, with detailed explanations and remediation guidance. gcpdiag reduces troubleshooting time by proactively identifying issues before they cause outages. It's particularly useful for validating new deployments and investigating production problems.
参数
- --project _id_
- Google Cloud project ID.
- --include _pattern_
- Include rules matching pattern.
- --exclude _pattern_
- Exclude rules matching pattern.
- --output _format_
- Output format (text, json).
- --verbose
- Verbose output.
- --auth-adc
- Use Application Default Credentials.
FAQ
What is the gcpdiag command used for?
gcpdiag is a command-line diagnostics tool for Google Cloud Platform that runs automated checks against projects to identify common issues. It analyzes infrastructure for misconfigurations, quota problems, permission errors, and best practice violations. The tool executes a curated set of rules organized by service (GKE, Compute Engine, Cloud SQL, etc.). Each rule checks for specific known issues based on Google's internal troubleshooting knowledge. Results indicate whether checks passed, failed, or were skipped, with detailed explanations and remediation guidance. gcpdiag reduces troubleshooting time by proactively identifying issues before they cause outages. It's particularly useful for validating new deployments and investigating production problems.
How do I run a basic gcpdiag example?
Run `gcpdiag lint --project [project_id]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --project _id_ do in gcpdiag?
Google Cloud project ID.