Commit d63a793f authored by jingbo.wang's avatar jingbo.wang

达到内存占用门限后,重启influxdb

parent 5ca08eb1
#! /bin/bash
# 监控主机的内存,当达到门限后重启influxdb服务
while :
do
influxdb_pid=$(ps aux | grep ^influxdb | awk '{print $2;}')
influxdb_mem=$(grep VmRSS /proc/${influxdb_pid}/status | awk '{print $2}')
echo $(date):${influxdb_mem}
if [ $influxdb_mem -gt "10485760" ]; then
echo "influxdb restart"
service influxdb restart
fi
sleep 2
done
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment