Skip to content

Commit e3c34e0

Browse files
authored
Merge pull request #252681 from M2skills/momakhij/linux
changes to Prometheus OS SAP Provider Documentation.
2 parents ba18df4 + 765dc43 commit e3c34e0

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

articles/sap/monitor/provider-linux.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Configure Linux provider for Azure Monitor for SAP solutions
2+
title: Configure Linux provider for Azure Monitor for SAP solutions
33
description: This article explains how to configure a Linux OS provider for Azure Monitor for SAP solutions.
44
author: MightySuz
55
ms.service: sap-on-azure
@@ -18,49 +18,50 @@ In this how-to guide, you learn how to create a Linux OS provider for Azure Moni
1818
- An Azure subscription.
1919
- An existing Azure Monitor for SAP solutions resource. To create an Azure Monitor for SAP solutions resource, see the [quickstart for the Azure portal](quickstart-portal.md) or the [quickstart for PowerShell](quickstart-powershell.md).
2020
- Install the [node exporter latest version](https://prometheus.io/download/#node_exporter) in each SAP host that you want to monitor, either BareMetal or Azure virtual machine (VM). For more information, see the [node exporter GitHub repository](https://github.com/prometheus/node_exporter).
21+
- Node exporter uses the default port 9100 to expose the metrics. If you want to use a custom port, make sure to open the port in the firewall and use the same port while creating the provider.
22+
- Default port 9100 or custom port that will be configured for node exporter should be open and listening on the Linux host.
2123

2224
To install the node exporter on Linux:
2325

24-
1. Run `wget https://github.com/prometheus/node_exporter/releases/download/v*/node_exporter-*.*-amd64.tar.gz`. Replace `*` with the version number.
26+
Right click on the relevant node exporter version for linux from https://prometheus.io/download/#node_exporter and copy the link address which will be used in the below command.
27+
For example - https://github.com/prometheus/node_exporter/releases/download/v1.6.1/node_exporter-1.6.1.linux-amd64.tar.gz
2528

26-
1. Run `tar xvfz node_exporter-*.*-amd64.tar.gz`.
29+
1. Change to the directory where you want to install the node exporter.
30+
1. Run `wget https://github.com/prometheus/node_exporter/releases/download/v<xxx>/node_exporter-<xxx>.linux-amd64.tar.gz`. Replace `xxx` with the version number.
2731

28-
1. Run `cd node_exporter-*.*-amd64`.
32+
1. Run `tar xvfz node_exporter-<xxx>.linux-amd64.tar.gz`
33+
34+
1. Run `cd node_exporter-<xxx>linux-amd64`
2935

3036
1. Run `./node_exporter`.
3137

38+
1. Run `./node_exporter --web.listen-address=":9100" &`
39+
3240
1. The node exporter now starts collecting data. You can export the data at `http://IP:9100/metrics`.
3341

3442
## Script to set up the node exporter
3543

3644
```shell
3745
# To get the latest node exporter version from: https://prometheus.io/download/#node_exporter
38-
wget https://github.com/prometheus/node_exporter/releases/download/v*/node_exporter-*.*-amd64.tar.gz
39-
tar xvfz node_exporter-*.*-amd64.tar.gz
40-
if [[ "$(grep '^ID=' /etc/*-release)" == *"rhel"* ]]; then
41-
echo "Open firewall port 9100 on the Linux host"
42-
yum install firewalld -y
43-
systemctl start firewalld
44-
firewall-cmd --zone=public --permanent --add-port 9100/tcp
45-
else
46-
sudo ufw allow 9100/tcp
47-
sudo ufw reload
48-
fi
49-
50-
cd node_exporter-*.*-amd64
46+
# Right click on the linux node exporter version and copy the link address which will be used in the below command. For example - https://github.com/prometheus/node_exporter/releases/download/v1.6.1/node_exporter-1.6.1.linux-amd64.tar.gz
47+
# Change to the directory where you want to install the node exporter.
48+
49+
wget https://github.com/prometheus/node_exporter/releases/download/v<xxx>/node_exporter-<xxx>.linux-amd64.tar.gz
50+
tar xvfz node_exporter-<xxx>.linux-amd64.tar.gz
51+
cd node_exporter-<xxx>linux-amd64
5152
nohup ./node_exporter --web.listen-address=":9100" &
5253
```
5354

5455
### Set up a cron job to start node exporter on a VM restart
5556

5657
1. If the target VM is restarted or stopped, node exporter is also stopped. It must be manually started again to continue monitoring.
5758
1. Run the `sudo crontab -e` command to open a cron file.
58-
1. Add the command `@reboot cd /path/to/node/exporter && nohup ./node_exporter &` at the end of the cron file. This starts node exporter on a VM reboot.
59+
1. Add the command `@reboot cd <"add path of node exporter"> && nohup ./node_exporter &` at the end of cron file. This starts node exporter on VM reboot.
5960

6061
```shell
6162
# If you do not have a crontab file already, create one by running the command: sudo crontab -e
6263
sudo crontab -l > crontab_new
63-
echo "@reboot cd /path/to/node/exporter && nohup ./node_exporter &" >> crontab_new
64+
echo "@reboot cd <"add path of node exporter"> && nohup ./node_exporter &" >> crontab_new
6465
sudo crontab crontab_new
6566
sudo rm crontab_new
6667
```
@@ -77,9 +78,9 @@ To [enable TLS 1.2 or higher](enable-tls-azure-monitor-sap-solutions.md), follow
7778
1. Select **Add provider**.
7879
1. Configure the following settings for the new provider:
7980
1. For **Type**, select **OS (Linux)**.
80-
1. For **Name**, enter a name that will be the identifier for the BareMetal instance.
81+
1. For **Name**, enter a unique name of the provider.
8182
1. (Optional) Select **Enable secure communication**, choose a certificate type.
82-
1. For **Node Exporter Endpoint**, enter `http://IP:9100/metrics`.
83+
1. For **Node Exporter Endpoint**, enter `http://IP:9100/metrics` if default port 9100 is used. If a custom port is used, enter `http://IP:PORT/metrics`. Replace `IP` with the IP address of the Linux host and `PORT` with the custom port number.
8384
1. For the IP address, use the private IP address of the Linux host. Make sure the host and Azure Monitor for SAP solutions resource are in the same virtual network.
8485
1. Open firewall port 9100 on the Linux host.
8586
1. If you're using `firewall-cmd`, run `_firewall-cmd_ _--permanent_ _--add-port=9100/tcp_ ` and then run `_firewall-cmd_ _--reload_`.
@@ -98,13 +99,11 @@ Use these steps to resolve common errors.
9899

99100
When the provider settings validation operation fails with the code `PrometheusURLConnectionFailure`:
100101

101-
1. Open firewall port 9100 on the Linux host.
102-
1. If you're using `firewall-cmd`, run `_firewall-cmd_ _--permanent_ _--add-port=9100/tcp_ ` and then run `_firewall-cmd_ _--reload_`.
103-
1. If you're using `ufw`, run `_ufw_ _allow_ _9100/tcp_` and then run `_ufw_ _reload_`.
102+
1. Check the default port 9100 or custom port that is configured for node exporter is open and listening on the Linux host.
104103
1. Try to restart the node exporter agent:
105-
1. Go to the folder where you installed the node exporter. The file name resembles `node_exporter-*.*-amd64`.
104+
1. Go to the folder where you installed the node exporter (the file name resembles `node_exporter-<xxxx>-amd64`).
106105
1. Run `./node_exporter`.
107-
1. Adding `nohup` and `&` to the preceding command decouples `node_exporter` from the Linux machine command line. If they're not included, `node_exporter` stops when the command line is closed.
106+
1. Run `nohup ./node_exporter &` command to enable node_exporter. Adding nohup and & to above command decouples the node_exporter from linux machine commandline. If not included node_exporter would stop when the commandline is closed.
108107
1. Verify that the Prometheus endpoint is reachable from the subnet that you provided when you created the Azure Monitor for SAP solutions resource.
109108

110109
## Suggestion

0 commit comments

Comments
 (0)