Skip to content

Commit 2aa9c2f

Browse files
committed
update OS provider documentation for setting up cron job to start node exporter on vm restart
1 parent 0578dbd commit 2aa9c2f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

articles/sap/monitor/provider-linux.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,22 @@ When the provider settings validation operation fails with the code ‘Prometheu
7474
1. Try to restart the node exporter agent:
7575
1. Go to the folder where you installed the node exporter (the file name resembles `node_exporter-*.*-amd64`).
7676
1. Run `./node_exporter`.
77+
1. Adding nohup and & to aboe command decouples the node_exporter from linux machine commandline. If not included node_exporter would stop when the commandline is closed.
7778
1. Verify that the Prometheus endpoint is reachable from the subnet that you provided while creating the Azure Monitor for SAP solutions resource.
7879

80+
## Suggestions
81+
82+
### Enabling Node Exporter
83+
84+
1. Run `nohup ./node_exporter &` command to enable node_exporter.
85+
1. Adding nohup and & to aboe command decouples the node_exporter from linux machine commandline. If not included node_exporter would stop when the commandline is closed.
86+
87+
### Setting up cron job to start Node exporter on VM restart
88+
89+
1. If the target virual machine is restarted/stopped, node exporter is also stopped, and needs to be manually started again to continue monitoring.
90+
1. Run `sudo crontab -e` command to open cron file.
91+
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.
92+
7993
## Next steps
8094

8195
> [!div class="nextstepaction"]

0 commit comments

Comments
 (0)