Remove PMM agent from node

Hello Percona Community,

I want to uninstall percona pmm-agent as i do not want to monitor this node using PMM.

i have remove using below command.

apt-get remove pmm2-client

but still it shows pmm-agent is running on this node.

ps -ef | grep pmm

root 2582 2386 0 11:38 ? 00:00:00 /usr/sbin/pmm-agent --config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml
root 3094 2386 0 11:39 ? 00:00:08 /usr/sbin/pmm-managed --victoriametrics-config=/etc/victoriametrics-promscrape.yml --victoriametrics-url=http://127.0.0.1:9090/prometheus --postgres-name=pmm-managed --postgres-username=pmm-managed --postgres-password=pmm-managed --supervisord-config-dir=/etc/supervisord.d
26 3101 2571 0 11:39 ? 00:00:00 postgres: pmm-managed pmm-managed 127.0.0.1(41854) idle
26 3121 2571 0 11:39 ? 00:00:00 postgres: pmm-managed pmm-managed 127.0.0.1(41882) idle
26 3123 2571 0 11:39 ? 00:00:00 postgres: pmm-managed pmm-managed 127.0.0.1(41940) idle
26 3171 2571 0 11:39 ? 00:00:00 postgres: pmm-managed postgres 127.0.0.1(41980) idle
root 7841 2582 1 12:13 ? 00:00:15 /usr/local/percona/pmm2/exporters/postgres_exporter --auto-discover-databases --collect.custom_query.hr --collect.custom_query.hr.directory=/usr/local/percona/pmm2/collectors/custom-queries/postgresql/high-resolution --collect.custom_query.lr --collect.custom_query.lr.directory=/usr/local/percona/pmm2/collectors/custom-queries/postgresql/low-resolution --collect.custom_query.mr --collect.custom_query.mr.directory=/usr/local/percona/pmm2/collectors/custom-queries/postgresql/medium-resolution --exclude-databases=template0,template1,postgres,cloudsqladmin,pmm-managed-dev,azure_maintenance --web.listen-address=:42001
root 7877 2582 0 12:13 ? 00:00:08 /usr/local/percona/pmm2/exporters/node_exporter --collector.bonding --collector.buddyinfo --collector.cpu --collector.diskstats --collector.entropy --collector.filefd --collector.filesystem --collector.hwmon --collector.loadavg --collector.meminfo --collector.meminfo_numa --collector.netdev --collector.netstat --collector.netstat.fields=^(.(InErrors|InErrs|InCsumErrors)|Tcp(ActiveOpens|PassiveOpens|RetransSegs|CurrEstab|AttemptFails|OutSegs|InSegs|EstabResets|OutRsts|OutSegs)|Tcp_Rto(Algorithm|Min|Max)|Udp_(RcvbufErrors|SndbufErrors)|Udp(6?|Lite6?)(InDatagrams|OutDatagrams|RcvbufErrors|SndbufErrors|NoPorts)|Icmp6?(OutEchoReps|OutEchos|InEchos|InEchoReps|InAddrMaskReps|InAddrMasks|OutAddrMaskReps|OutAddrMasks|InTimestampReps|InTimestamps|OutTimestampReps|OutTimestamps|OutErrors|InDestUnreachs|OutDestUnreachs|InTimeExcds|InRedirects|OutRedirects|InMsgs|OutMsgs)|IcmpMsg_(InType3|OutType3)|Ip(6|Ext)(InOctets|OutOctets)|Ip_Forwarding|TcpExt(Listen.|Syncookies.|TCPTimeouts))$ --collector.processes --collector.standard.go --collector.standard.process --collector.stat --collector.textfile.directory.hr=/usr/local/percona/pmm2/collectors/textfile-collector/high-resolution --collector.textfile.directory.lr=/usr/local/percona/pmm2/collectors/textfile-collector/low-resolution --collector.textfile.directory.mr=/usr/local/percona/pmm2/collectors/textfile-collector/medium-resolution --collector.textfile.hr --collector.textfile.lr --collector.textfile.mr --collector.time --collector.uname --collector.vmstat --collector.vmstat.fields=^(pg(steal_(kswapd|direct)|refill|alloc)(movable|normal|dma3?2?)|nr(dirty.|slab.|vmscan.|isolated.|free.|shmem.|i?n?active.|anon_transparent_.|writeback.|unstable|unevictable|mlock|mapped|bounce|page_table_pages|kernel_stack)|drop_slab|slabs_scanned|pgd?e?activate|pgpg(in|out)|pswp(in|out)|pgm?a?j?fault)$ --no-collector.arp --no-collector.bcache --no-collector.conntrack --no-collector.drbd --no-collector.edac --no-collector.infiniband --no-collector.interrupts --no-collector.ipvs --no-collector.ksmd --no-collector.logind --no-collector.mdadm --no-collector.mountstats --no-collector.netclass --no-collector.nfs --no-collector.nfsd --no-collector.ntp --no-collector.qdisc --no-collector.runit --no-collector.sockstat --no-collector.supervisord --no-collector.systemd --no-collector.tcpstat --no-collector.timex --no-collector.wifi --no-collector.xfs --no-collector.zfs --web.disable-exporter-metrics --web.listen-address=:42000
root 26454 14218 0 12:31 pts/2 00:00:00 grep --color=auto pmm

Can you please help how to remove pmm-agent service and stop all services running on this node related to pmm and do not want to monitor this node only.

1 Like

can any one help me to remove the pmm client completely from node

1 Like

Hello! Thank you for your report, we created ticket for this issue - [PMM-11280] Can't remove pmm-client from node - Percona JIRA

1 Like

I’m sorry, my wrong. By this command pmm-client should be completely uninstalled. Can you show result of “systemctl status pmm-agent”

1 Like

home/# systemctl status pmm-agent
â—Ź pmm-agent.service
Loaded: masked (/dev/null; bad)
Active: inactive (dead)

1 Like

Do you have docker with running pmm-client at this PC?

2 Likes

thanks @Anton_Bystrov i have checked and it seems it running with the docker.

I have tested using stoping docker on node and it seems pmm is runing with docker client

$ systemctl status docker
â—Ź docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2022-12-21 08:45:20 UTC; 2 days ago
Docs: https://docs.docker.com
Main PID: 1966 (dockerd)
Tasks: 30
CGroup: /system.slice/docker.service
├─1966 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
├─2421 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 443 -container-ip 172.17.0.2 -container-port 443
└─2428 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 443 -container-ip 172.17.0.2 -container-port 443

→ cehck pmm status
$ ps -ef | grep pmm
root 2673 2485 0 Dec21 ? 00:07:25 /usr/sbin/pmm-managed --victoriametrics-config=/etc/victoriametrics-promscrape.yml --victoriametrics-url=http://127.0.0.1:9090/prometheus --postgres-name=pmm-managed --postgres-username=pmm-managed --postgres-password=pmm-managed --supervisord-config-dir=/etc/supervisord.d
root 2674 2485 0 Dec21 ? 00:00:25 /usr/sbin/pmm-agent --config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml
26 3113 2663 0 Dec21 ? 00:00:00 postgres: pmm-managed pmm-managed 127.0.0.1(34826) idle
26 3148 2663 0 Dec21 ? 00:00:00 postgres: pmm-managed pmm-managed 127.0.0.1(34850) idle
26 3149 2663 0 Dec21 ? 00:00:00 postgres: pmm-managed pmm-managed 127.0.0.1(34852) idle
26 3219 2663 0 Dec21 ? 00:00:03 postgres: pmm-managed postgres 127.0.0.1(34958) idle
root 3220 2674 1 Dec21 ? 00:37:33 /usr/local/percona/pmm2/exporters/postgres_exporter --auto-discover-databases --collect.custom_query.hr --collect.custom_query.hr.directory=/usr/local/percona/pmm2/collectors/custom-queries/postgresql/high-resolution --collect.custom_query.lr --collect.custom_query.lr.directory=/usr/local/percona/pmm2/collectors/custom-queries/postgresql/low-resolution --collect.custom_query.mr --collect.custom_query.mr.directory=/usr/local/percona/pmm2/collectors/custom-queries/postgresql/medium-resolution --exclude-databases=template0,template1,postgres,cloudsqladmin,pmm-managed-dev,azure_maintenance --web.listen-address=:42001
root 3221 2674 0 Dec21 ? 00:29:01 /usr/local/percona/pmm2/exporters/node_exporter --collector.bonding --collector.buddyinfo --collector.cpu --collector.diskstats --collector.entropy --collector.filefd --collector.filesystem --collector.hwmon --collector.loadavg --collector.meminfo --collector.meminfo_numa --collector.netdev --collector.netstat --collector.netstat.fields=^(.(InErrors|InErrs|InCsumErrors)|Tcp(ActiveOpens|PassiveOpens|RetransSegs|CurrEstab|AttemptFails|OutSegs|InSegs|EstabResets|OutRsts|OutSegs)|Tcp_Rto(Algorithm|Min|Max)|Udp_(RcvbufErrors|SndbufErrors)|Udp(6?|Lite6?)(InDatagrams|OutDatagrams|RcvbufErrors|SndbufErrors|NoPorts)|Icmp6?(OutEchoReps|OutEchos|InEchos|InEchoReps|InAddrMaskReps|InAddrMasks|OutAddrMaskReps|OutAddrMasks|InTimestampReps|InTimestamps|OutTimestampReps|OutTimestamps|OutErrors|InDestUnreachs|OutDestUnreachs|InTimeExcds|InRedirects|OutRedirects|InMsgs|OutMsgs)|IcmpMsg_(InType3|OutType3)|Ip(6|Ext)(InOctets|OutOctets)|Ip_Forwarding|TcpExt(Listen.|Syncookies.|TCPTimeouts))$ --collector.processes --collector.standard.go --collector.standard.process --collector.stat --collector.textfile.directory.hr=/usr/local/percona/pmm2/collectors/textfile-collector/high-resolution --collector.textfile.directory.lr=/usr/local/percona/pmm2/collectors/textfile-collector/low-resolution --collector.textfile.directory.mr=/usr/local/percona/pmm2/collectors/textfile-collector/medium-resolution --collector.textfile.hr --collector.textfile.lr --collector.textfile.mr --collector.time --collector.uname --collector.vmstat --collector.vmstat.fields=^(pg(steal_(kswapd|direct)|refill|alloc)(movable|normal|dma3?2?)|nr(dirty.|slab.|vmscan.|isolated.|free.|shmem.|i?n?active.|anon_transparent_.|writeback.|unstable|unevictable|mlock|mapped|bounce|page_table_pages|kernel_stack)|drop_slab|slabs_scanned|pgd?e?activate|pgpg(in|out)|pswp(in|out)|pgm?a?j?fault)$ --no-collector.arp --no-collector.bcache --no-collector.conntrack --no-collector.drbd --no-collector.edac --no-collector.infiniband --no-collector.interrupts --no-collector.ipvs --no-collector.ksmd --no-collector.logind --no-collector.mdadm --no-collector.mountstats --no-collector.netclass --no-collector.nfs --no-collector.nfsd --no-collector.ntp --no-collector.qdisc --no-collector.runit --no-collector.sockstat --no-collector.supervisord --no-collector.systemd --no-collector.tcpstat --no-collector.timex --no-collector.wifi --no-collector.xfs --no-collector.zfs --web.disable-exporter-metrics --web.listen-address=:42000

– > Stop docker services.

root# systemctl stop docker
Warning: Stopping docker.service, but it can still be activated by:
docker.socket

→ again check the pmm process and it is not running after stoping docker service.

root# ps -ef | grep pmm
root 12082 11773 0 19:36 pts/3 00:00:00 grep --color=auto pmm

1 Like