Tuesday, February 26, 2008

procfs and loadavg

I think that one of the biggest problems somebody with a Linux background faces with FreeBSD is having gotten used to procfs.

Sure nobody is going to stop you from adding
proc /proc procfs rw 0 0
to /etc/fstab and then mount it:
mount proc
But all those useful things in /proc are now elsewhere to be found.

Many of my scripts need loadavg. Now I need to remember to get the 3 loadavg values like this:
load01m=`sysctl vm.loadavg | awk -F{ '{print $2}' | awk '{print $1}'`
load05m=`sysctl vm.loadavg | awk -F{ '{print $2}' | awk '{print $2}'`
load15m=`sysctl vm.loadavg | awk -F{ '{print $2}' | awk '{print $3}'`


Post a Comment