diff --git a/plugins/apache/apache_memmory b/plugins/apache/apache_memmory index 30dd62bd..9e288b91 100755 --- a/plugins/apache/apache_memmory +++ b/plugins/apache/apache_memmory @@ -59,9 +59,9 @@ if [ "$1" = "config" ]; then exit 0 fi -VAL1=`ps auxf | grep ${PROCS} | grep ${USR} | grep -v grep | wc -l` +VAL1=`ps auxf | grep ${PROCS} | grep ^${USR} | grep -v grep | wc -l` -VAL2=`ps auxf | grep ${PROCS} | grep ${USR} | grep -v grep | awk '{s+=$6} END {print s}'` +VAL2=`ps auxf | grep ${PROCS} | grep ^${USR} | grep -v grep | awk '{s+=$6} END {print s}'` VAL3=`expr $VAL2 / $VAL1` diff --git a/plugins/apache/apache_servers b/plugins/apache/apache_servers index afedcfa8..4af4b08f 100755 --- a/plugins/apache/apache_servers +++ b/plugins/apache/apache_servers @@ -58,7 +58,7 @@ if [ "$1" = "config" ]; then exit 0 fi -VAL1=`ps auxf | grep ${PROCS} | grep ${USR} | grep -v grep | wc -l` +VAL1=`ps auxf | grep ${PROCS} | grep ^${USR} | grep -v grep | wc -l` echo "servers.value $VAL1" diff --git a/plugins/apache/apache_threads b/plugins/apache/apache_threads index 5c0f0b02..d1c9f0f7 100755 --- a/plugins/apache/apache_threads +++ b/plugins/apache/apache_threads @@ -62,10 +62,10 @@ PROCS=$binname # Catch proccess pid -VAL1=`ps auxf | grep ${PROCS} | grep ${USR} | grep -v grep | awk '{print $2}' ` +VAL1=`ps auxf | grep ${PROCS} | grep ^${USR} | grep -v grep | awk '{print $2}' ` # Count pids -COUNT=`ps auxf | grep ${PROCS} | grep ${USR} | grep -v grep | wc -l` +COUNT=`ps auxf | grep ${PROCS} | grep ^${USR} | grep -v grep | wc -l` # Read threads per pid for i in $VAL1; do