From b8041288f98b27dfcafecb9cae66e89f32b3a867 Mon Sep 17 00:00:00 2001 From: ByteIDance <100207562+ByteIDance@users.noreply.github.com> Date: Fri, 10 Mar 2023 17:47:28 +0800 Subject: [PATCH] [script] modified the linux memory metrics specified script code (#719) [docs]feature:change alert define trigger times from max 10 to max 999] [doc]feature The memory of the monitoring server cannot be monitored in the case of Chinese,Then replace script [doc]feature:The memory of the monitoring server cannot be monitored in the case of Chinese --------- Co-authored-by: panghu --- manager/src/main/resources/define/app-centos.yml | 4 ++-- manager/src/main/resources/define/app-linux.yml | 4 ++-- manager/src/main/resources/define/app-ubuntu.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/manager/src/main/resources/define/app-centos.yml b/manager/src/main/resources/define/app-centos.yml index a9b14953cce..aeb5c9704cb 100644 --- a/manager/src/main/resources/define/app-centos.yml +++ b/manager/src/main/resources/define/app-centos.yml @@ -189,7 +189,7 @@ metrics: username: ^_^username^_^ password: ^_^password^_^ timeout: ^_^timeout^_^ - script: free -m | grep Mem | awk 'BEGIN{print "total used free buff_cache available"} {print $2,$3,$4,$6,$7}' + script: free -m | awk 'BEGIN{print "total used free buff_cache available"} NR==2{print $2,$3,$4,$6,$7}' parseType: multiRow - name: disk @@ -340,4 +340,4 @@ metrics: password: ^_^password^_^ timeout: ^_^timeout^_^ script: ps -aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n 10 - parseType: multiRow + parseType: multiRow \ No newline at end of file diff --git a/manager/src/main/resources/define/app-linux.yml b/manager/src/main/resources/define/app-linux.yml index 8e5b1ae298f..2da903ee946 100644 --- a/manager/src/main/resources/define/app-linux.yml +++ b/manager/src/main/resources/define/app-linux.yml @@ -187,7 +187,7 @@ metrics: username: ^_^username^_^ password: ^_^password^_^ timeout: ^_^timeout^_^ - script: free -m | grep Mem | awk 'BEGIN{print "total used free buff_cache available"} {print $2,$3,$4,$6,$7}' + script: free -m | awk 'BEGIN{print "total used free buff_cache available"} NR==2{print $2,$3,$4,$6,$7}' parseType: multiRow - name: disk @@ -338,4 +338,4 @@ metrics: password: ^_^password^_^ timeout: ^_^timeout^_^ script: ps -aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n 10 - parseType: multiRow + parseType: multiRow \ No newline at end of file diff --git a/manager/src/main/resources/define/app-ubuntu.yml b/manager/src/main/resources/define/app-ubuntu.yml index 57de65e1fa3..aa29beaa91a 100644 --- a/manager/src/main/resources/define/app-ubuntu.yml +++ b/manager/src/main/resources/define/app-ubuntu.yml @@ -187,7 +187,7 @@ metrics: username: ^_^username^_^ password: ^_^password^_^ timeout: ^_^timeout^_^ - script: free -m | grep Mem | awk 'BEGIN{print "total used free buff_cache available"} {print $2,$3,$4,$6,$7}' + script: free -m | awk 'BEGIN{print "total used free buff_cache available"} NR==2{print $2,$3,$4,$6,$7}' parseType: multiRow - name: disk @@ -338,4 +338,4 @@ metrics: password: ^_^password^_^ timeout: ^_^timeout^_^ script: ps -aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n 10 - parseType: multiRow + parseType: multiRow \ No newline at end of file