Cockpit CLI Reference
The Cockpit Command-Line Interface (cockpit-cli) is a system tool used to initialize database schemas, manage administrative user accounts, register hypervisor hosts, and perform diagnostics directly on the Cockpit server.
1. System Setup & Lifecycle Commands
Database Schema Initialization (init)
- Description: Prepares the database schema by creating required tables, relations, and default parameters. It also prompts for the creation of the initial root administrator account.
- Example:bash
cockpit-cli init --config /etc/cockpit/cockpit.conf
Start Cockpit Gateway (run)
- Description: Runs the central Cockpit service process.
- Example:bash
cockpit-cli run --config /etc/cockpit/cockpit.conf
2. User Account Administration
Create User Account (user create)
- Description: Provisions a local user account without utilizing the web console.
- Example:bash
cockpit-cli user create --username "admin" --email "admin@corp.awan.io" --role "super-admin"
Reset Account Password (user reset-password)
- Description: Sets a new password for the specified user and unlocks the account if it was suspended due to authentication failures.
- Example:bash
cockpit-cli user reset-password --username "admin" --password "newsecurepassword"
3. Hypervisor Host Management
List Registered Hosts (host list)
- Description: Queries the shared database and outputs all registered hypervisor hosts and their current operational status.
- Example:bash
cockpit-cli host list
Register Hypervisor Node (host add)
- Description: Adds a new physical Vapor host to the Cockpit inventory database.
- Example:bash
cockpit-cli host add --hostname "vapor-node-01.corp.awan.io" --ip "192.168.122.203" --token "VaporAPITokenString"
4. Diagnostics & Troubleshooting
Query Cluster Status (cluster status)
- Description: Validates database connectivity, checks schema version status, and reports active connection counts.
- Example:bash
cockpit-cli cluster status
Query Advisory Locks (locks list)
- Description: Lists active database advisory locks and indicates which Cockpit instance is managing each hypervisor host.
- Example:bash
cockpit-cli locks list