Skip to content

Commit af119e7

Browse files
committed
added scripts to start node exporter, and update cron jobs for node expoter
1 parent 2a9d65c commit af119e7

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

articles/sap/monitor/provider-linux.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This content applies to both versions of the service, *Azure Monitor for SAP sol
2121

2222
- An Azure subscription.
2323
- 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).
24-
- Install the [node exporter version 1.3.0](https://prometheus.io/download/#node_exporter) in each SAP host that you want to monitor, either BareMetal or Azure virtual machine (Azure VM). For more information, see [the node exporter GitHub repository](https://github.com/prometheus/node_exporter).
24+
- 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 (Azure VM). For more information, see [the node exporter GitHub repository](https://github.com/prometheus/node_exporter).
2525

2626
To install the node exporter on Linux:
2727

@@ -35,6 +35,26 @@ To install the node exporter on Linux:
3535

3636
1. The node exporter now starts collecting data. You can export the data at `http://IP:9100/metrics`.
3737

38+
## Script to setup Node Exporter
39+
40+
```shell
41+
# To get the latest node exporter version from: https://prometheus.io/download/#node_exporter
42+
wget https://github.com/prometheus/node_exporter/releases/download/v*/node_exporter-*.*-amd64.tar.gz
43+
tar xvfz node_exporter-*.*-amd64.tar.gz
44+
if [[ "$(grep '^ID=' /etc/*-release)" == *"rhel"* ]]; then
45+
echo "Open firewall port 9100 on the Linux host"
46+
sudo apt install firewalld -y
47+
systemctl start firewalld
48+
firewall-cmd --zone=public --permanent --add-port 9100/tcp
49+
else
50+
sudo ufw allow 9100/tcp
51+
sudo ufw reload
52+
fi
53+
54+
cd node_exporter-*.*-amd64
55+
nohup ./node_expoprter --web.listen-address=":9100" &
56+
```
57+
3858
## Prerequisites to enable secure communication
3959

4060
To [enable TLS 1.2 or higher](enable-tls-azure-monitor-sap-solutions.md), follow the steps [mentioned here](https://prometheus.io/docs/guides/tls-encryption/)
@@ -90,6 +110,13 @@ When the provider settings validation operation fails with the code ‘Prometheu
90110
1. Run `sudo crontab -e` command to open cron file.
91111
1. Add the command `@reboot cd /path/to/node/exporter && nohup ./node_exporter &` at the end of cron file. This will start node exporter on VM reboot.
92112

113+
```shell
114+
sudo crontab -l > crontab_new
115+
echo "@reboot cd /path/to/node/exporter && nohup ./node_exporter &" >> crontab_new
116+
sudo crontab crontab_new
117+
sudo rm crontab_new
118+
```
119+
93120
## Next steps
94121

95122
> [!div class="nextstepaction"]

0 commit comments

Comments
 (0)