SysAdmin Blog, TechTips and Reviews

An (ex) System Administrator's Blog

Archives Posts

Demystifying VMSTAT

September 22nd, 2007 by elizar

Vmstat, or virtual memory statistics, is one of the useful UNIX command an administrator can (always) use to check the performance of a server. This is specially useful to determine how a particular UNIX box is doing during it’s peak usage time. It shows information about various system resources and their related performance problems.

An example output of this command is shown below:

% vmstat 1 8   	Write a report every second for 5 seconds.  procs  memory           page             faults        cpu   	  

-- --- -------- ---- ----   	  

r  b avm   fre re  pi  po  fr   sr  cy  in  sy  cs us sy id wa   	  

1  0  4680 365  0   0   0   1    3   0 123 102  75  0  2 97  1   	  

1  0  4680 364  0   0   0   0    0   0 121  86  67  0  3 76 21   	  

1  0  4680 364  0   0   0   0    0   0 114  70  28  1  0 99  0   	  

1  0  4680 364  0   0   0   0    0   0 123  70  32  2  0 98  0   	  

1  0  4680 364  0   0   0   0    0   0 114  74  28  1  0 99  0   	  

1  0  4680 364  0   0   0   0    0   0 113  84  67  0 21 69 10   	  

1  0  4680 364  0   0   0   0    0   0 127  78  56  8  9 82  1   	  

1  0  4680 364  0   0   0   0    0   0 119  91  71  0  3 86 11   	  

That is a lot of numbers. What does the out of VMSTAT means anyway?

In a Nutshell

The command produces information (for the least) about virtual memory (swap), CPU usage, and disk usage. In my case, most of the stats that I frequently checked when users complain are CPU and memory usage.

The Details

There are five main column in a vmstat output – proc, memory, paging, faults, CPU.

The first two columns under procs (or kernel thread on some UNIX) show the number of processes on the system.

  • Column r shows “runable” or active processes – the value of this should be less than or equal to the number of processor.
  • Column b shows “blocked” processes awaiting a resource such as input/output.

(more stuff here….)

The Syntax

The command vmstat takes two arguments, one for how long to wait between reports and the second for how many reports to write out before quitting.


# vmstat 1 8

produces 8 output (lines) in every one second interval. Omitting the second argument, vmstat will not stop displaying output on the screen until a break is sent (usually CNTRL+D or Z or C)

Final Words

Read some more.

You should check out vmstat’s man page (man vmstat command) to get the details for your system. Since usage and output may vary from one operating system to another.

Filed under Commands having No Comments »

Archives Posts

OpenLDAP Installation Using Packages (pkgadd)

September 20th, 2007 by elizar

I would like to post an update on our previous OpenLDAP source installation, but I encountered an error so, enough with the source thing and let’s install one from packages which is available on Sunfreeware.

OpenLDAP is an open source implementation of the Lightweight Directory Access Protocol. These build packages installs in /usr/local/

Requirements and Dependencies

Here’s what packages you’ll need:

Dependencies are:

This implementation of OpenLDAP was build on a sparc machine Sun Blade 100 workstation running Solaris 8.

Installing Packages

You can go ahead and refer to this post in using the pkgadd .

Once all the packages are installed above, the binary can be found in /usr/local/bin , /usr/local/sbin and config files are in /usr/local/etc.

There are some more setup and configuration to setup (like setting of variables) but as far as installation is concern, we’re done.

See you on the next post about configuration for OpenLDAP

Archives Posts

Set Up Environment Variable on Bourne, Bash, Korn and C-Shells

September 19th, 2007 by elizar

There are many shells available for the UNIX operating system. Among them are sh (bourne), csh (C), tsch (korn) and bash (bourne again) Shells.

With all these shells, sometimes we can mix all the syntax when assigning values to a variables. Here’s is another review so you wont forget:

C Shell (csh) or Korn (tcsh):

hostname# setenv LD_LIBRARY_PATH /usr/local/lib
setenv MYVAR /usr/mydir

$PATH before and after:

hostname# echo $PATH
setenv PATH ${PATH}:/usr/local/local/bin
echo $PATH

For Bash (bash), Bourne (sh) or Korn (tcsh):

export EDITOR

Study the syntax and let’s discuss…

Archives Posts

SCO Group (SCO UNIX) Is Bankrupt!

September 18th, 2007 by elizar

Santa Cruz Operation SCO Group, the same group that gave us SCO UNIX has filed bankruptcy last Friday. That is bad news not only for the SCO users and community but for the stock holders too!

The bankruptcy that was filed was The Chapter 11 Bankruptcy! Meaning, the court will take over (with the creditor’s committee) to handle the debts of the company.

SCO Group CEO Darl McBride also quote saying that one major reason for the downfall of SCO Group is because of competition on alternative Open Source Operating System, including Linux. Aside from that their sales on UNIX-based product “have been declining over the past several years.”

Filed under Operating System, Unix having 5 Comments »

Archives Posts

Linux Desktops

September 11th, 2007 by elizar

linux desktops

Filed under Linux having 1 Comment »

Archives Posts

The getent Command

September 10th, 2007 by elizar

For the UNIX side of things, we’ll try to feature one command a week that is commonly used in system/user administration on a UNIX box. If anyone wants to contribute more, then we may do one command every two days or ‘Unix Command for the day’. Something like that.

For today, it’s all about getent.

getent is short for Get Entries. The command suppose to get entries from an administrative database. This database can be passwd, group, hosts, ipnodes, services, protocols, ethers, network or netmasks.

For each of these  databases, getent uses the appropriate library routines described in getpwnam, getgrnam, gethostbyaddr, gethostbyname,   getipnodebyaddr, getipnodebyname, getservbyname,  getprotobyname, ethers(3SOCKET), and getnetbyname(3SOCKET), respectively.

getent prints out the database entries that match each of the supplied keys, one per line, int the format of the matching administrive file: Examples, passwd, group, hosts, etc….

Example: To check if a user dpusp or information about the TIT group:

# getent
usage: getent database [ key … ]
# getent passwd dpusp
# getent group TIT


Archives Posts

configure: error: BDB/HDB: BerkeleyDB not available

September 2nd, 2007 by elizar

After installing the required prerequisite for OpenLDAP installation, I ran into my first error in running the configure script:

checking db.h usability… no
checking db.h presence… no
checking for db.h… no
configure: error: BDB/HDB: BerkeleyDB not available

At first, I thought this was just a case of $PATH not set up properly (since /usr/local) in not in the path by default). After setting up the path:

# echo $PATH

I still have the error.

I then added the path for the include files in the env

env CPPFLAGS=-I/usr/local/Berkeley/include

Did the configure and…

checking for db.h… yes

That fixed…

Next error… 😀

I was here...