Not able to add query analytics using pmm-admin tool

Hello,
I installed pmm server and client on two different machines, following the instructions given here >> https://www.percona.com/doc/percona-monitoring-and-management/install.html
Both pmm-server and client got installed properly but I was not able to see the Queries in the Query Analytics window. The pmm server GUI gave errors (PFA).

Also on the client side on giving the command “sudo pmm-admin add queries --user abc --password xyz” gave the following error:

“Error adding queries: “service” failed: exit status 1, Starting pmm-queries-exporter-42001
Unable to start, see /var/log/pmm-queries-exporter-42001.log”

The content of the file pmm-queries-exporter-42001.log:

flag needs an argument: -pid-file
Usage of /usr/local/percona/qan-agent/bin/percona-qan-agent:
-basedir string
Agent basedir (default “/usr/local/percona/qan-agent”)
-listen string
Agent interface address (default “127.0.0.1:9000”)
-pid-file string
PID file (default “percona-agent.pid”)
-ping
Ping API
-version
Print version

Also, on one other client I got the following error:

[MySQL] 2016/08/02 00:25:59 packets.go:118: write unix @->/var/run/mysqld/mysqld.sock: write: broken pipe
Cannot connect to MySQL: Error 1045: Access denied for user ‘root’@‘localhost’ (using password: NO)

Please tell what I am doing wrong. Any help will be highly appreciated.

Thanks.

Screen Shot 2016-08-02 at 6.51.03 pm.png

Just to update on this, i was able to add queries using the pmm-admin tool, the issue was that the MySQL user which I was using did not have the super privilege after giving the privilege the command “sudo pmm-admin add queries --user abc --password xy” gave the success message:

“OK, now monitoring MySQL queries from slowlog using DSN root:***@unix(/var/lib/mysql/mysql.sock)”

After this, I could see my server getting listed in the QAN GUI, but when I select it, I get the same previous error which I am getting for all the other servers:

"QAN API error: “MySQL Query Analytics configuration not found”

check the /var/log/qan-api.log file in docker container for more information

I have already pasted the content of the “qan-api.log” file in my previous post. Please help on what I need to do to solve this issue.

There is a bug in 1.0.2 for “queries” when using unix-systemv service manager.

To fix: