mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Fix grep command
This commit is contained in:
parent
4771fd2b53
commit
d189784ce2
3 changed files with 5 additions and 5 deletions
|
@ -59,9 +59,9 @@ if [ "$1" = "config" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
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`
|
VAL3=`expr $VAL2 / $VAL1`
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ if [ "$1" = "config" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
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"
|
echo "servers.value $VAL1"
|
||||||
|
|
||||||
|
|
|
@ -62,10 +62,10 @@ PROCS=$binname
|
||||||
|
|
||||||
|
|
||||||
# Catch proccess pid
|
# 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 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
|
# Read threads per pid
|
||||||
for i in $VAL1; do
|
for i in $VAL1; do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue