mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
fix for service listing on CentOS5
This commit is contained in:
parent
03727c9b76
commit
c39f021551
1 changed files with 3 additions and 1 deletions
|
@ -16,6 +16,8 @@ format=${1-shell}
|
||||||
source $VESTA/func/main.sh
|
source $VESTA/func/main.sh
|
||||||
source $VESTA/conf/vesta.conf
|
source $VESTA/conf/vesta.conf
|
||||||
|
|
||||||
|
export PATH=$PATH:/sbin
|
||||||
|
|
||||||
get_srv_state() {
|
get_srv_state() {
|
||||||
srv=$1
|
srv=$1
|
||||||
proc_name=${2-$1}
|
proc_name=${2-$1}
|
||||||
|
@ -30,7 +32,7 @@ get_srv_state() {
|
||||||
mem=0
|
mem=0
|
||||||
for pid in $(pidof $proc_name); do
|
for pid in $(pidof $proc_name); do
|
||||||
pid_mem=$(pmap -x $pid | tail -n1 | awk '{print $3}')
|
pid_mem=$(pmap -x $pid | tail -n1 | awk '{print $3}')
|
||||||
pid_cpu=$(grep "^$pid " $tmp_file | cut -f 2 -d ' ')
|
pid_cpu=$(grep "^$pid " $tmp_file | cut -f 2 -d ' '|sed "s/^0//")
|
||||||
cpu=$((cpu + pid_cpu))
|
cpu=$((cpu + pid_cpu))
|
||||||
mem=$((mem + pid_mem))
|
mem=$((mem + pid_mem))
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue