Percona Toolkit - DSN Configuration

Hi,

I am new to the Percona Toolkit and it appears that there are multiple ways to pass MySQL credenials to each of these tools.

Some use DSNs directly on the command line, some use a toolkit.config file, etc. Is that right?

I would like to configure the MySQL credentials once for all of the tools to use, but not quite sure how to do it. Help?

Do I configure my own $HOME/.percona-toolkit.config with a DSN? Not sure how to code it?

Any help would be appreciated. Sorry for such a rookie question.

Thank you. :cool:

Hi,

Yes, you are right that you can use DSN directly with command-line or configuration file. As some utilities does not use DSNs but still you can connect to mysql with --host, --user and --password options or configuration file (i.e my.cnf/toolkit.confg). These tools uses these options to create a DSN automatically. You can get more DSN related information here.

http://www.percona.com/doc/percona-toolkit/2.1/dsn_data_sour ce_name_specifications.html

So If you want to configure the MySQL credentials once for all tools, I would suggest, you should add user/pass information in my.cnf under [client] section.

But if i do not want to write the user and password in the my.cnf

I only want to do a nagios check for replication checksum for my server. Is it possble to send the credentials for the replication on the commandline or on the check command.

what means i can use a configfile. how should it looks like

h=192.168.0.5,user=admin,p=xyz
h=192.168.0.6,user=repadmin,p=xyz

And how can i read it in the commandline or in the nagios check?