Skip to content

Commit

Permalink
Fix grep command
Browse files Browse the repository at this point in the history
  • Loading branch information
rfrail3 committed Sep 19, 2012
1 parent 4771fd2 commit d189784
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions plugins/apache/apache_memmory
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
2 changes: 1 addition & 1 deletion plugins/apache/apache_servers
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions plugins/apache/apache_threads
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d189784

Please sign in to comment.