# How to run metricbeat as background process

**URL:** <https://discuss.elastic.co/t/how-to-run-metricbeat-as-background-process/243865>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [August 5, 2020, 12:30pm UTC](https://discuss.elastic.co/t/how-to-run-metricbeat-as-background-process/243865 "2020-08-05T12:30:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahebub\_Sayyed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahebub_sayyed/32/68237_2.png) [@Mahebub\_Sayyed](https://discuss.elastic.co/u/Mahebub_Sayyed)\
**Post date:** [August 5, 2020, 12:30pm UTC](https://discuss.elastic.co/t/how-to-run-metricbeat-as-background-process/243865/1 "2020-08-05T12:30:56Z")

</div>

I want to install metricbeat to monitor server metrics. I dont have internet connection on server so I have manually downloaded "metricbeat-oss-7.3.2-linux-x86\_64.tar.gz" and running it through "./metricbeat -e" when I am closing ssh console metricbeat it stopped. Also I have tried "nohup ./metricbeat -e&" but same problem is happening.  
How to start metricbeat as background process while working on "metricbeat-oss-7.3.2-linux-x86\_64.tar.gz" this file.  
Please help me out.

---

<div class="post-metadata">

**Author:** ![d.silwon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/d.silwon/32/65853_2.png) [@d.silwon](https://discuss.elastic.co/u/d.silwon)\
**Post date:** [August 5, 2020, 12:35pm UTC](https://discuss.elastic.co/t/how-to-run-metricbeat-as-background-process/243865/2 "2020-08-05T12:35:48Z")

</div>

Do you haven't service for metricbeat after installation in /etc/systemd/system/ or /usr/lib/systemd/system/?

---

<div class="post-metadata">

**Author:** ![Mahebub\_Sayyed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahebub_sayyed/32/68237_2.png) [@Mahebub\_Sayyed](https://discuss.elastic.co/u/Mahebub_Sayyed)\
**Post date:** [August 5, 2020, 12:42pm UTC](https://discuss.elastic.co/t/how-to-run-metricbeat-as-background-process/243865/3 "2020-08-05T12:42:20Z")

</div>

I have followed install guide for metricbeat. it does not showing anything regarding service.  
Could you please help me, how to create service for metricbeat.

---

<div class="post-metadata">

**Author:** ![d.silwon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/d.silwon/32/65853_2.png) [@d.silwon](https://discuss.elastic.co/u/d.silwon)\
**Post date:** [August 5, 2020, 12:45pm UTC](https://discuss.elastic.co/t/how-to-run-metricbeat-as-background-process/243865/4 "2020-08-05T12:45:22Z")

</div>

Please check both directories maybe the service already exists.

My service for metricbeat looks like this:  
cat /usr/lib/systemd/system/metricbeat.service

```auto
[Unit]
Description=Metricbeat is a lightweight shipper for metrics.
Documentation=https://www.elastic.co/products/beats/metricbeat
Wants=network-online.target
After=network-online.target

[Service]

Environment="BEAT_LOG_OPTS=-e"
Environment="BEAT_CONFIG_OPTS=-c /etc/metricbeat/metricbeat.yml"
Environment="BEAT_PATH_OPTS=-path.home /usr/share/metricbeat -path.config /etc/metricbeat -path.data /var/lib/metricbeat -path.logs /var/log/metricbeat"
ExecStart=/usr/share/metricbeat/bin/metricbeat $BEAT_LOG_OPTS $BEAT_CONFIG_OPTS $BEAT_PATH_OPTS
Restart=always

[Install]
WantedBy=multi-user.target

```

---

<div class="post-metadata">

**Author:** ![Mahebub\_Sayyed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahebub_sayyed/32/68237_2.png) [@Mahebub\_Sayyed](https://discuss.elastic.co/u/Mahebub_Sayyed)\
**Post date:** [August 5, 2020, 12:53pm UTC](https://discuss.elastic.co/t/how-to-run-metricbeat-as-background-process/243865/5 "2020-08-05T12:53:44Z")

</div>

> --Download  
> curl -L -O [https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-7.3.2-darwin-x86\_64.tar.gz](https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-7.3.2-darwin-x86_64.tar.gz)  
> tar xzvf metricbeat-7.3.2-darwin-x86\_64.tar.gz  
> cd metricbeat-7.3.2-darwin-x86\_64/

> --Modify metricbeat.yml to set the connection information

> --Enable system module  
> ./metricbeat modules enable system

> --Start  
> ./metricbeat setup  
> ./metricbeat -e

I have followed this steps. After this steps there is no metricbeat.service in /usr/lib/systemd/system or /etc/systemd/system

---

<div class="post-metadata">

**Author:** ![d.silwon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/d.silwon/32/65853_2.png) [@d.silwon](https://discuss.elastic.co/u/d.silwon)\
**Post date:** [August 5, 2020, 12:55pm UTC](https://discuss.elastic.co/t/how-to-run-metricbeat-as-background-process/243865/6 "2020-08-05T12:55:24Z")

</div>

What kind of OS do you have?

---

<div class="post-metadata">

**Author:** ![Mahebub\_Sayyed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahebub_sayyed/32/68237_2.png) [@Mahebub\_Sayyed](https://discuss.elastic.co/u/Mahebub_Sayyed)\
**Post date:** [August 5, 2020, 1:04pm UTC](https://discuss.elastic.co/t/how-to-run-metricbeat-as-background-process/243865/7 "2020-08-05T13:04:04Z")

</div>

Red Hat Enterprise Linux Server release 7.7 (Maipo)

---

<div class="post-metadata">

**Author:** ![d.silwon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/d.silwon/32/65853_2.png) [@d.silwon](https://discuss.elastic.co/u/d.silwon)\
**Post date:** [August 5, 2020, 2:26pm UTC](https://discuss.elastic.co/t/how-to-run-metricbeat-as-background-process/243865/8 "2020-08-05T14:26:44Z")

</div>

Are you able install service from rpm? Can you download rpm?

And install like this:  
rpm -ivh service.rpm?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 2, 2020, 4:26pm UTC](https://discuss.elastic.co/t/how-to-run-metricbeat-as-background-process/243865/9 "2020-09-02T16:26:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
