首页 > 系统相关 >pushgateway shell脚本

pushgateway shell脚本

时间:2022-10-03 00:44:44浏览次数:61  
标签:脚本 shell Mem free pushgateway memory print

vim push_memory.sh

#!/bin/bash 
# desc push memory info 

total_memory=$(free  |awk '/Mem/{print $2}')
used_memory=$(free  |awk '/Mem/{print $3}')

job_name="pushgateway"
instance_name="192.168.6.128"

cat <<EOF | curl --data-binary @- http://192.168.6.130:9091/metrics/job/$job_name/instance/$instance_name
#TYPE custom_memory_total  gauge
custom_memory_total $total_memory
#TYPE custom_memory_used  gauge
custom_memory_used $used_memory
EOF

标签:脚本,shell,Mem,free,pushgateway,memory,print
From: https://www.cnblogs.com/tengfei520/p/16749840.html

相关文章