Low watermark metrics from /proc/zoneinfo

Greetings,

I need to collect certain metrics from telegraf, i.e. the low watermarks per memory zone as displayed by cat /proc/zoneinfo. Could the mem plugin return these metrics? If not, is there another one that can do the work?

Thank you!

Answering my own question :slightly_smiling_face:
I found out the inputs.exec plugin can do the trick:

  1. Created a bash script that sums the low watermarks and prints the result (cat /proc/zoneinfo | grep low | awk ‘{SUM += $2} END {print SUM*4}’)
  2. Changed script permissions so user telegraf can execute it (required for step 3)
  3. Used the script as the command of exec plugin: command = ["./my_bash_script"]

@Mannequin
Sweet! Thanks for sharing your answer with the community :slight_smile:

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.