-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
When using mysql_exporter and mysql_importer, if the DB_NAME variable is not defined (neither in a .env file not as an environment variable), the error messages are incorrect and confusing:
docker run --rm -it \
--volume $PWD/output:/home/mysql/output \
--workdir /home/mysql/output \
docker.io/joseluisq/mysql-client:8 \
mysql_exporter
. . .
/usr/local/bin/___mysqlexport.sh: line 14: DB_NAME: command not found
/usr/local/bin/___mysqlexport.sh: line 14: ERROR: env variable is required.: command not foundI think this is because the lines that check that the required variables are defined are incorrect.
For example:
if [[ -z "$DB_NAME" ]]; then "ERROR: `DB_NAME` env variable is required."; exit 1; fishould have "echo" and probably not use backticks around the variable name:
if [[ -z "$DB_NAME" ]]; then echo "ERROR: DB_NAME env variable is required."; exit 1; fiMetadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working