Skip to content
Advertisement

Get cpu, memory, disk data using Python script from node exporter metrics

Currently I am developing a python flask application. I need to get cpu, memory, disk data of the machine. I suppose to get those data using node-exporter using Python scripts. Currently I am working with dummy data.

Here are the instructions provided:

  1. Select two simple metrics
  2. Send http call to node exporter and save coutput to a file or keep in a variable
  3. Extract the value of the metric
  4. You can have the mapping of metric and node exporter metric in a separate file
  5. Save the value in the table

Does anybody have any idea about how to develop the this kind of Python script?

This is my controller classes without node-exporter queries:

JavaScript

Advertisement

Answer

See this example:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement