Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A little convenient script to calculate the percentage of vnodes used' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A little convenient script to calculate the percentage of vnodes used
Authored by: tegbains on Jul 20, '03 07:19:04PM

There is a mistake on the second to last line:

It was: set result=`expr $vnodesused * 100 / $vnodesmax`

But should be: set result=`expr $vnodesused \* 100 / $vnodesmax`

Corrected code is below:
__

#!/bin/tcsh
# returns the percentage of vnodes used

set vnodesused=`pstat -T | grep vnodes | sed 's/vnodes//' `
set vnodesmax=`sysctl kern.maxvnodes | sed 's/kern.maxvnodes = //'`

set result=`expr $vnodesused \* 100 / $vnodesmax`
echo "${result}% used"

___

---
___
Teg Bains



[ Reply to This | # ]