#!/usr/bin/bash

#Tate:2022.4.24
#Author:Yingjian
#function: 定时检测rsyslog服务内存使用
#env
local_time=`date`
mem_size=`ps -aux |grep -v grep |grep rsyslog |awk '{print $6}'`

if [ $mem_size -gt "500000" ];then
	echo "$local_time 当前内存使用$mem_size" >> /data/scripts/check_rsyslog.log
	systemctl restart rsyslog
else
	echo "$local_time 当前内存使用$mem_size" >> /data/scripts/check_rsyslog.log
fi 
