We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03727c9 commit c39f021Copy full SHA for c39f021
bin/v-list-sys-services
@@ -16,6 +16,8 @@ format=${1-shell}
16
source $VESTA/func/main.sh
17
source $VESTA/conf/vesta.conf
18
19
+export PATH=$PATH:/sbin
20
+
21
get_srv_state() {
22
srv=$1
23
proc_name=${2-$1}
@@ -30,7 +32,7 @@ get_srv_state() {
30
32
mem=0
31
33
for pid in $(pidof $proc_name); do
34
pid_mem=$(pmap -x $pid | tail -n1 | awk '{print $3}')
- pid_cpu=$(grep "^$pid " $tmp_file | cut -f 2 -d ' ')
35
+ pid_cpu=$(grep "^$pid " $tmp_file | cut -f 2 -d ' '|sed "s/^0//")
36
cpu=$((cpu + pid_cpu))
37
mem=$((mem + pid_mem))
38
done
0 commit comments