tollgate doctor
Thedoctor command runs diagnostic checks to verify your Tollgate configuration and environment before running servers. It helps identify configuration issues, missing environment variables, and system problems.
Usage
Options
| Option | Description |
|---|---|
-c, --config <path> | Path to tollgate.yaml (default: ./tollgate.yaml) |
-s, --server <name> | Check only a specific server |
--json | Output results as JSON |
Diagnostic Checks
The doctor command performs the following checks:1. Configuration File
Verifies that the configuration file exists and is readable.2. Configuration Valid
Parses the configuration and checks for syntax errors, invalid values, and schema violations.3. Servers Configured
Ensures at least one server is configured with a valid command.4. Server Commands
Validates that each server has a command specified.5. Environment Variables
Checks that all environment variables referenced in the config are set. Shows masked values for security.6. Data Directory
Verifies the Tollgate data directory is writable for audit logs and session storage.7. Audit Database
Checks that the audit database location is accessible.8. Smart Analyzers
Validates that configured analyzers (sql, filesystem, shell, http) are recognized.Examples
Basic Usage
Example Output
JSON Output
For scripting and CI/CD integration:Exit Codes
| Code | Meaning |
|---|---|
0 | All checks passed (possibly with warnings) |
1 | One or more checks failed |
Best Practices
- Run before production: Always run
tollgate doctorbefore deploying to production - CI/CD integration: Add
tollgate doctor --jsonto your CI pipeline to catch issues early - Environment variables: Use the output to identify missing environment variables
- Per-server debugging: Use
--serverto focus on a specific server’s configuration