The dashboard console is a command line client for querying the PNX Dashboard API.
Install using composer:
composer install
Alternatively, you can download the build phar command from the releases page on Github https://github.com/previousnext/dashboard-console/releases/
Once downloaded, you will need to make it executable. If you want it to be globally available, copy it to somewhere in your $PATH (e.g. /usr/local/bin).
For example:
chmod +x dashboard-console.phar
mv dashboard-console.phar /usr/local/bin/dashboard-console
You can then run the command from anywhere using:
dashboard-console snapshots
See details below on storing passwords in environment variables.
The client has two commands, one for viewing a list of all snapshots, and the other for viewing the detail of an individual site.
--base-url
The base url for the Dashboard API.--username
The username used to connect to the dashboard.--password
The password used to connect to the dashboard.
To view all snapshots, run the command:
dashboard-console snapshots --password <SECRET PASSWORD>
To filter to show only snapshots which have error alerts. Add the flag:
--alert-level=error
To view the details of a snapshot, run the command:
./dashboard.php snapshot --site-id=<SITE ID> --password <SECRET PASSWORD>
Where <SITE ID>
is the unique site ID. This is displayed in the snapshots
output.
To avoid having to type in the same credentials over and over, you can store them in environment variables.
For example, you can add the following to ~/.bashrc
:
export DASHBOARD_USERNAME=<SECRET USERNAME>
export DASHBOARD_PASSWORD=<SECRET PASSWORD>
The command becomes simply:
./dashboard.php snapshots
Or if you followed the steps above for downloading the phar file:
dashboard-console snapshots