This simple Flask app works like proxy for node exporter. It starts a manager process, which runs node exporter binary on a random port and keeps it alive with healthchecks. When you access a route on this Flask app, it makes a request to the exporter and returns you contents of that request.
I've made this to monitor a website on a shared hosting. All ports, except ones intentionally opened by hosting administrators, were closed so there was no chance to access node exporter on 9100 or any other port. But there was a way to run Flask apps and so I made this little wrapper.
Install packages from requirements.txt with:
pip install -r requirements.txt
Get yourself a node exporter binary from here if you still don't have one,
then write path to your node exporter binary in NODE_EXPORTER_BINARY_PATH
variable inside app.py
.
That's all.