This page looks best with JavaScript enabled

PMM2 Client

 ·  🎃 kr0m

It is useless to have a PMM server if we do not add any client to the monitoring. In this article, I explain how to install it with basic metrics on both Ubuntu and Gentoo.

We install the client as follows:

Ubuntu:

wget https://repo.percona.com/apt/percona-release_latest.generic_all.deb
apt install gpg
dpkg -i percona-release_latest.generic_all.deb
apt-get update
apt-get install pmm2-client
pmm-admin config –server-insecure-tls –server-url=https://admin:PASSWORD@PMM_SERVER:443

Gentoo:

wget https://www.percona.com/downloads/pmm2/2.4.0/binary/tarball/pmm2-client-2.4.0.tar.gz
tar xvzf pmm2-client-2.4.0.tar.gz
cd pmm2-client-2.4.0
./install_tarball

We add the installed binaries to the path:

PATH=$PATH:/usr/local/percona/pmm2/bin

We make the permanent change:

vi .bashrc

PATH=$PATH:/usr/local/percona/pmm2/bin
vi .bash_profile
export BASH_ENV=~/.bashrc
if [ -f ~/.bashrc ]; then source ~/.bashrc; fi

To make the exporters work, we must first configure/start the agent:

pmm-agent setup –config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml –server-insecure-tls –server-address=PMM_SERVER:443 –server-username=admin –server-password=“PASSWORD”

If we set it up incorrectly, the second time we run it, it will tell us:

Failed to register pmm-agent on PMM Server: Node with name “kr0mtest” already exists..

We will have to add the option: –force to the command.

We manually start the pmm-agent to check that it does not give any problems:

pmm-agent –config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml

In another console, we can see the exporters:

pmm-admin list

Service type  Service name         Address and port  Service ID

Agent type                  Status     Agent ID                                        Service ID
pmm_agent                   Connected  /agent_id/aba88792-1544-420a-a091-cbffe93f9232 
node_exporter               Running    /agent_id/d35f58b3-a4e8-4367-8659-d726adf3641a

We demonize the agent:

vi /etc/local.d/pmm.start

nohup pmm-agent --config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml &
chmod 700 /etc/local.d/pmm.start

In the Grafana interface, we can already see data:

To know if we are correctly collecting a metric, we can consult it in the Prometheus interface, Status -> Targets, but it will ask for authentication, the user is always pmm and the password is the id of the exporter we are consulting.

We consult the exporters on the server:

pmm-admin list

Service type  Service name         Address and port  Service ID

Agent type                  Status     Agent ID                                        Service ID
pmm_agent                   Connected  /agent_id/d94f4797-68df-4832-835f-e2b742f3a189  
node_exporter               Running    /agent_id/7e985a11-eb50-4c7a-9569-834666c3a934

In this case, there is only one whose password is: /agent_id/7e985a11-eb50-4c7a-9569-834666c3a934

It can also be consulted in the Prometheus web interface in the agent_id tag:

If you liked the article, you can treat me to a RedBull here