Server summary:mysql summary - Exit Status 1

I get “Exit Status 1” error in mysql summary

and query error log like this:
[root@test log]# cat pmm-mysql-queries-0.log

Version: percona-qan-agent 1.0.7

Basedir: /usr/local/percona/qan-agent

PID: 11372


UUID: e7b416c0e9c0466162728fb8840ab066

2017/02/18 14:46:17.492888 main.go:165: Starting agent…
2017/02/18 14:46:17.493570 main.go:346: Agent is ready
2017/02/18 14:46:17.498969 main.go:207: API is ready
2017/02/18 14:54:50.460563 ERROR agent exit status 1
2017/02/18 14:54:50.460641 WARNING agent Cmd fail: Reply[Cmd:GetMySQLSummary Error:‘exit status 1’ Id:17731696-8329-44ce-6aee-90381f02f738]
2017/02/18 15:39:13.971141 ERROR agent exit status 1
2017/02/18 15:39:13.971279 WARNING agent Cmd fail: Reply[Cmd:GetMySQLSummary Error:‘exit status 1’ Id:d1c1ff6f-a90b-4e82-7bb3-6fa556491672]

and read this

I install percona-toolkit and create conf file like this:
[root@i-zryeyuku mysql]# cat /etc/percona-toolkit/pt-mysql-summary.conf

I can run pt-mysql-summary like this:
[root@test log]# pt-mysql-summary
mysql: [Warning] Using a password on the command line interface can be insecure.

Percona Toolkit MySQL Summary Report

System time | 2017-02-18 07:46:27 UTC (local TZ: CST +0800)

but still get this error,What am I missing?


can you try to remove node and add it again

pmm-admin remove mysql
pmm-admin add mysql
pmm-admin start --all

and check status after that,
during add procedure should check DB access and configure credentials correctly.

The machine has tow MySQL instance has this problem

Your method I tried many times, but still ineffective. But I am install in a local virtual environment, no problem?

hm, quite strange, can you give me output of the following command:

env -i /usr/bin/pt-mysql-summary >/dev/null; echo EC: $?

output like this:
[root@test conf]# env -i /usr/bin/pt-mysql-summary >/dev/null; echo EC: $?
2017_02_22_20_07_31 Cannot execute mysql. Check that it is in PATH.
EC: 1

i try add path like this,but not working
export PATH=/usr/bin:/usr/local/mysql/bin:$PATH

i try to use mysql commad connect mysql server is ok
[root@test ~]# mysql -uroot -p -S /tmp/mysql1.sock
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 114962
Server version: 5.7.17-log MySQL Community Server (GPL)

Copyright © 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.


can you try to add the following string as third line into script?

export PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/local/mysql/bin

and try again?

I tried your method, but it did not work

i run pt-mysql-summary get this error:
[root@test bin]# pt-mysql-summary
/usr/bin/pt-mysql-summary: line 552: mktemp: command not found
/usr/bin/pt-mysql-summary: line 26: date: command not found
Cannot make secure tmpdir

This host is provided by the cloud service,I guess they change something that we do not know,
There is no problem installing on the local virtual machine in the same way

can you locate path to mktemp and date manually and add it to PATH variable?

which mktemp
which date

i run comd like this:
[root@i-gnll91eq ~]# which mktemp
[root@i-gnll91eq ~]# which date

and i add to PATH
export PATH=$PATH:/usr/local/mysql/bin:/bin

run in shell is ok
[root@test ~]# pt-mysql-summary
mysql: [Warning] Using a password on the command line interface can be insecure.

Percona Toolkit MySQL Summary Report

System time | 2017-02-23 13:21:17 UTC (local TZ: CST +0800)

restart all pmm client server
[root@test ~]#pmm-admin restart --all

but still see “exit status 1” in web page.why runing in shell is ok,but can not invoke by server?

in 99% because systemd runs apps without environment variables.

can you try to run the following command one more time

env -i /usr/bin/pt-mysql-summary >/dev/null; echo EC: $?

this command

  1. cut all environment variables (like systemd does), so we should see any errors on STDERR
  2. redirect STDOUT to /dev/null, so we can see STDERR output only
  3. print exist status as “EC: 1” line in the end

you are right,systemd runs apps without environment variables.
I install use source code and saved it to a non-default directory.
I try the way like this:
ln -s /apps/mysql/bin/* /usr/bin/

and the problem is solved.Thank you.