Skip to content

Instantly share code, notes, and snippets.

@dhiren051
Created July 16, 2019 17:46
Show Gist options
  • Save dhiren051/96ee813da5649938e93626e3bf42a210 to your computer and use it in GitHub Desktop.
Save dhiren051/96ee813da5649938e93626e3bf42a210 to your computer and use it in GitHub Desktop.
To compare values of linux node and prometheus node exporter
#!/bin/bash
set -e -o pipefail
date
free -b
curl -s 'http://localhost:9100/metrics?collect\[\]=meminfo' |
egrep '^node_memory_Mem(Total|Free|Available)_bytes'
egrep 'Mem(Total|Free|Available):' /proc/meminfo |
awk '{print $1 $2 * 1024}'
free -b
date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment