LP #1348679: pt-stalk handles mysql user password in awkward way

Description

**Reported in Launchpad by Przemek last update 26-09-2014 10:37:33

You can pass the mysql user password to pt-stalk in various ways: using --pasword option, placing password in .my.cnf, in /etc/percona-toolkit/pt-stalk.conf, etc. But each this method requires to enter the password in clear text form.
There is also the " – -p " option that works for other tools in Percona Toolkit, but for pt-stalk, the effect is that it asks the pass in a loop making this one unusable:

[root@localhost ~]# pt-stalk --version
[root@localhost ~]# pt-stalk 2.2.9

[root@localhost ~]# pt-stalk --dest=out/ – -p
Enter password:
2014_07_25_16_46_25 Starting /usr/bin/pt-stalk --function=status --variable=Threads_running --threshold=25 --match= --cycles=1 --interval=2 --iterations= --run-time=30 --sleep=20 --dest=dupa/ --prefix= --notify-by-email= --log=/var/log/pt-stalk.log --pid=/var/run/pt-stalk.pid --plugin=
Enter password:
Enter password:
Enter password:
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
2014_07_25_16_46_44 Detected value is empty; something failed? Trigger exit status: 0
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
2014_07_25_16_46_47 Detected value is empty; something failed? Trigger exit status: 0
^C2014_07_25_16_46_48 Caught signal, exiting
2014_07_25_16_46_48 All subprocesses have finished
2014_07_25_16_46_48 Exiting because OKTORUN is false
2014_07_25_16_46_48 /usr/bin/pt-stalk exit status 1

Plase allow the pt-stalk with --password option to read the password securely, once, from the terminal.

Environment

None

Smart Checklist

Activity

Show:

lpjirasync January 24, 2018 at 4:28 PM

**Comment from Launchpad by: Frank Cizmich on: 10-09-2014 16:05:03

Fixed adding --ask-pass option. This overrides --password

note:
using "-- p" makes pt-stalk ask for password in a loop because the options after "-" are passed to mysql each time pt-stalk connects to retrieve info.

Done

Details

Assignee

Reporter

Priority

Smart Checklist

Created January 24, 2018 at 4:27 PM
Updated December 20, 2023 at 3:38 AM
Resolved January 24, 2018 at 4:28 PM