# How to change local host IP to server IP

**URL:** <https://forums.percona.com/t/how-to-change-local-host-ip-to-server-ip/32655>\
**Category:** Percona Monitoring and Management (PMM)\
**Tags:** pmm, percona, mongodb\
**Created:** [August 28, 2024, 2:50pm UTC](https://forums.percona.com/t/how-to-change-local-host-ip-to-server-ip/32655 "2024-08-28T14:50:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravi5358](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ravi5358/32/17822_2.png) [@ravi5358](https://forums.percona.com/u/ravi5358)\
**Post date:** [August 28, 2024, 2:50pm UTC](https://forums.percona.com/t/how-to-change-local-host-ip-to-server-ip/32655/1 "2024-08-28T14:50:07Z")

</div>

Hi,  
I setup pmm- monitoring in my Environment under Mysql and MongoDB databases.  
After setup the client like pmm client in servers I seen it is pointing to local host like 127.0.0.1, even node\_exporter and MongoDB exporters also pointing to local host IP, I want change the local host to server IP or bind IP. Can you please help me to change.

netstat -tunlp  
Active Internet connections (only servers)  
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name  
tcp 0 0 127.0.0.1:42000 0.0.0.0:\* LISTEN 2267/mongodb\_export  
tcp 0 0 127.0.0.1:42001 0.0.0.0:\* LISTEN 2308/node\_exporter  
tcp 0 0 127.0.0.1:42002 0.0.0.0:\* LISTEN 2434/vmagent  
tcp 0 0 127.0.0.1:40001 0.0.0.0:\* LISTEN 21557/pmm-agent  
tcp6 0 0 :::7777 :::\* LISTEN 21557/pmm-agent

Even while configuring alert not getting the metrics  
Value: [var=‘A’ labels={agent\_id=/agent\_id/b#############, agent\_type=pmm-agent, disabled=0, instance=pmm-server, job=pmm-managed, node\_id=/node\_id/#########, node\_name=########, version=2.42.0} value=1]  
Please help me on this.

Thank you.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 28, 2024, 6:56pm UTC](https://forums.percona.com/t/how-to-change-local-host-ip-to-server-ip/32655/2 "2024-08-28T18:56:25Z")

</div>

Hi @ravi5358, you can use `pmm-admin remove` to remove the service, then re-add it with the correct IP. You will see both show up in PMM for a week or two until the “127.0.0.1” data is slowly purged.

---

<div class="post-metadata">

**Author:** ![ravi5358](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ravi5358/32/17822_2.png) [@ravi5358](https://forums.percona.com/u/ravi5358)\
**Post date:** [August 29, 2024, 2:30pm UTC](https://forums.percona.com/t/how-to-change-local-host-ip-to-server-ip/32655/3 "2024-08-29T14:30:06Z")

</div>

Hi @matthewb, Thanks for your message.

Can you share me the full command like below  
pmm-admin add mongodb --host IP of the server --username=### --password=##### --enable-all-collectors --environment=## --query-source=“profiler” --log-level=“warn” --debug --service-name=hostname-mongodb

Thank you  
Ravi

---

<div class="post-metadata">

**Author:** ![ravi5358](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ravi5358/32/17822_2.png) [@ravi5358](https://forums.percona.com/u/ravi5358)\
**Post date:** [August 29, 2024, 2:41pm UTC](https://forums.percona.com/t/how-to-change-local-host-ip-to-server-ip/32655/4 "2024-08-29T14:41:45Z")

</div>

Hi @matthewb,

How we can remove the PMM node\_exporter, even I added DB server using pmm-admin add MongoDB --host server\_ip. But it is not showing IP in below command  
netstat -tunlp  
Active Internet connections (only servers)  
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name  
tcp 0 0 127.0.0.1:42000 0.0.0.0:\* LISTEN 22231/vmagent  
tcp 0 0 127.0.0.1:42001 0.0.0.0:\* LISTEN 22237/node\_exporter  
tcp 0 0 127.0.0.1:42002 0.0.0.0:\* LISTEN 22249/mongodb\_exporter

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 29, 2024, 7:49pm UTC](https://forums.percona.com/t/how-to-change-local-host-ip-to-server-ip/32655/5 "2024-08-29T19:49:49Z")

</div>

Those are local listeners for scraping the data. Those are not your client connections to mongo.
