LinuxCommandLibrary

gcpdiag

Diagnose Google Cloud Platform configuration issues

TLDR

Run gcpdiag on your project, returning all rules

$ gcpdiag lint --project=[gcp_project_id]
copy

Hide rules that are ok
$ gcpdiag lint --project=[gcp_project_id] --hide-ok
copy

Authenticate using a service account private key file
$ gcpdiag lint --project=[gcp_project_id] --auth-key [path/to/private_key]
copy

Search logs and metrics from a number of days back (default: 3 days)
$ gcpdiag lint --project=[gcp_project_id] --within-days [number]
copy

Display help
$ gcpdiag lint --help
copy

SYNOPSIS

gcpdiag [options]

PARAMETERS

--project
    Specifies the GCP project ID to analyze.

--account
    Specifies the service account to use for authentication.

--format
    Specifies the output format (e.g., text, json, html).

--output
    Specifies the output file to save the results.

--include
    Specifies the checks to include in the analysis (comma-separated).

--exclude
    Specifies the checks to exclude from the analysis (comma-separated).

--verbosity
    Sets the verbosity level (e.g., INFO, DEBUG).

--version
    Displays the version of gcpdiag.

--help
    Displays help information.

DESCRIPTION

gcpdiag is a command-line tool for diagnosing common issues in Google Cloud Platform (GCP) environments. It automates the process of collecting relevant information from GCP services and provides insights into potential problems, misconfigurations, and best practice violations.
It analyzes various GCP resources like Compute Engine instances, Cloud Storage buckets, Cloud SQL databases, networking components, and more, based on a set of pre-defined checks and rules. These checks cover aspects such as security, performance, cost optimization, and operational efficiency. gcpdiag aims to simplify troubleshooting and improve the overall management of GCP infrastructure. The tool output includes detailed reports with recommendations on how to resolve identified issues, making it a valuable resource for administrators and developers working with GCP.

CAVEATS

gcpdiag requires appropriate permissions to access the specified GCP resources.
The analysis results are based on the current state of the environment and may not reflect past issues.

AUTHENTICATION

gcpdiag uses Google Cloud SDK authentication by default.
You must authenticate to GCP before running gcpdiag using gcloud auth login.
You can also specify a service account using the --account parameter.

CONFIGURATION

The tool uses YAML configuration files located in its directory.
These files can be used to adjust the configuration of different checks.

HISTORY

gcpdiag is a relatively new tool developed by Google to streamline GCP diagnostics. It aims to address the complexity of managing and troubleshooting GCP environments by providing a unified and automated approach to identifying potential issues.
Its development is ongoing, with frequent updates to add new checks and improve existing functionality.
It is becoming increasingly popular among GCP users due to its ease of use and the valuable insights it provides.

SEE ALSO

gcloud(1), gsutil(1)

Copied to clipboard