Not the answer you need?
Register and ask your own question!

Server summary:mysql summary - Exit Status 1

I get "Exit Status 1" error in mysql summary

and query error log like this:
[[email protected] log]# cat pmm-mysql-queries-0.log
# Version: percona-qan-agent 1.0.7
# Basedir: /usr/local/percona/qan-agent
# PID: 11372
# API: 192.168.1.2/qan-api
# 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
https://www.percona.com/forums/questions-discussions/percona-monitoring-and-management/46424-server-summary-mysql-summary-exit-status-1

I install percona-toolkit and create conf file like this:
[[email protected] mysql]# cat /etc/percona-toolkit/pt-mysql-summary.conf
p=abcd1234
socket=/tmp/mysql1.sock

I can run pt-mysql-summary like this:
[[email protected] 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?

Comments

  • MykolaMykola Percona Percona Staff Role
    Hi,

    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.
  • liuqianliuqian Contributor Current User Role Beginner
    The machine has tow MySQL instance has this problem
  • busy882376busy882376 Entrant Inactive User Role Beginner
    Your method I tried many times, but still ineffective. But I am install in a local virtual environment, no problem?
  • MykolaMykola Percona Percona Staff Role
    hm, quite strange, can you give me output of the following command:
    env -i /usr/bin/pt-mysql-summary >/dev/null; echo EC: $?
    
  • busy882376busy882376 Entrant Inactive User Role Beginner
    output like this:
    [[email protected] 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
    [[email protected] ~]# 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 (c) 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
    owners.

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

    mysql>
  • MykolaMykola Percona Percona Staff Role
    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?
  • busy882376busy882376 Entrant Inactive User Role Beginner
    I tried your method, but it did not work

    i run pt-mysql-summary get this error:
    [[email protected] 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
  • MykolaMykola Percona Percona Staff Role
    can you locate path to mktemp and date manually and add it to PATH variable?
    which mktemp
    which date
    
  • busy882376busy882376 Entrant Inactive User Role Beginner
    i run comd like this:
    [[email protected] ~]# which mktemp
    /bin/mktemp
    [[email protected] ~]# which date
    /bin/date

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

    run in shell is ok
    [[email protected] ~]# 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
    [[email protected] ~]#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?
  • MykolaMykola Percona Percona Staff Role
    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
  • busy882376busy882376 Entrant Inactive User Role Beginner
    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.
This discussion has been closed.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.