# PMM ProxySQL monitoring in docker containers

**URL:** <https://forums.percona.com/t/pmm-proxysql-monitoring-in-docker-containers/5619>\
**Category:** PMM 1.x\
**Created:** [May 18, 2017, 10:20am UTC](https://forums.percona.com/t/pmm-proxysql-monitoring-in-docker-containers/5619 "2017-05-18T10:20:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonjenkins](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@jonjenkins](https://forums.percona.com/u/jonjenkins)\
**Post date:** [May 18, 2017, 10:20am UTC](https://forums.percona.com/t/pmm-proxysql-monitoring-in-docker-containers/5619/1 "2017-05-18T10:20:49Z")

</div>

We would like to be able to run multiple proxysql docker containers for different applications on the same docker host. We’d like to monitor them with PMM by placing a pmm-agent alongside each proxysql container, one per container instance. The out-of-the-box PMM server setup does not seem to allow us to have the pmm-agent listen internally on the default port, but have PMM server connect to it on whatever random port docker assigns. Also, there does not seem to be a way for pmm-agent to listen on an alternate port and therefore we cannot run more than one pmm-agent instance per host.

Is there a way to allow docker to randomly assign an external port that we can then publish to the PMM server for scraping prometheus metrics on the pmm-agent container?

Basically, are there suggestions to have PMM server communicate with multiple pmm-agent docker containers per host?

---

<div class="post-metadata">

**Author:** ![DBennett](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dbennett/32/17_2.png) [@DBennett](https://forums.percona.com/u/DBennett)\
**Post date:** [May 19, 2017, 3:07pm UTC](https://forums.percona.com/t/pmm-proxysql-monitoring-in-docker-containers/5619/2 "2017-05-19T15:07:16Z")

</div>

Hi Jon,

There is no need to run multiple instances of pmm-client in order to monitor multiple servers on a machine or container. You can add additional listening services for the additional instances of mysqld or ProxySQL like so:

mysqld (you use the --host and --port parameters): [INDENT]$ sudo pmm-admin config --server {pmm-server}  
$ sudo pmm-admin add mysql --host 127.0.0.1 --port 3306 --user root --password password local3306  
$ sudo pmm-admin add mysql --host 127.0.0.1 --port 3307 --user root --password password local3307[/INDENT]

ProxySQL (you use the --dsn parameter): [INDENT]$ sudo pmm-admin config --server {pmm-server}  
$ sudo pmm-admin add proxysql:metrics

After configuration you can check that the services are installed with pmm-admin list [INDENT]$ sudo pmm-admin list  
pmm-admin 1.1.3

PMM Server | xx.xx.xx.xx  
Client Name | 260a116c4a3e  
Client Address | xx.xx.xx.xx  
Service Manager | unix-systemv

* * *

SERVICE TYPE NAME LOCAL PORT RUNNING DATA SOURCE OPTIONS

* * *

mysql:queries local3306 - YES root:_**@tcp(127.0.0.1:3306) query\_source=slowlog, query\_examples=true  
mysql:queries local3307 - YES root:**_@tcp(127.0.0.1:3307) query\_source=slowlog, query\_examples=true  
linux:metrics local3306 42000 YES -  
mysql:metrics local3306 42002 YES root:_**@tcp(127.0.0.1:3306)  
mysql:metrics local3307 42003 YES root:**_@tcp(127.0.0.1:3307) [/INDENT]
