Category: Unix-Linux Administration

Feb 12 2011

Server Performance Data Collection – Collectl

Server Performance Data Collection

1. Disk

2. CPU

3. Network … Etc

There are a number of times in which you find yourself needing performance data. These can include benchmarking, monitoring a system’s general heath or trying to determine what your system was doing at some time in the past. Sometimes you just want to know what the system is doing right now. Depending on what you’re doing, you often end up using different tools, each designed to for that specific situation.

Unlike most monitoring tools that either focus on a small set of statistics, format their output in only one way, run either interatively or as a daemon but not both, collectl tries to do it all. You can choose to monitor any of a broad set of subsystems which currently include buddyinfo, cpu, disk, inodes, infiniband, lustre, memory, network, nfs, processes, quadrics, slabs, sockets and tcp.

By default it shows cpu, network and disk stats in brief format. The key point of this format is all output appears on a single line making it much easier to spot spikes or other anomalies in the output:

[oracle@Mudhalvan] collectl

while writing to an NFS mounted filesystem, collectl displays interrupts, memory usage and nfs activity with timestamps. Keep in mind that you can mix and match any data and in the case of brief format you simply need to have a window wide enough to accommodate your output.
[oracle@Mudhalvan] collectl -sjmf -oT

You can also display the same information in verbose format, in which case you get a single line for each type of data at the expense of more screen real estate, as can be seen in this example of network data during NFS writes. Note how you can actually see the network traffic stall while waiting for the server to physically write the data.
[oracle@Mudhalvan] collectl -sn –verbose -oT
[oracle@Mudhalvan] collectl -sJ -oTm

Output can also be saved in a rolling set of logs for later playback or displayed interactively in a variety of formats. If all that isn’t enough there are additional mechanisms for supplying data to external tools by generating output as s-expressions, a format of choice for some tools such as supermon or in another format called list-expressions. This output can be written to a file or sent over a socket. You can even create files in space-separated format for plotting with external packages like gnuplot or colplot, part of the collectl utilities project, which provides a web-based interface to gnuplot.

Collectl runs on all linux distros (it’s included as part of Fedora) and only requires perl. If the perl Time::Hires module is installed, you will be able to use fractional intervals and display timestamps in msecs. If the Compress::Zlib module is installed the recorded data will be compressed and therefore use on average 90% less storage when recording to a file. Also note that the above links are not for RPMs. If you’d rather work with RPMs there are far too many versions out there to link to and so I’m sorry to say you’re on your own.

Did you know there was an inconsistency in the way Linux reported disk metrics that wasn’t even noticed/fixed until the 2.6-14 kernel was released? Collectl did. Or how about the fact that network stats may not accurately reported by most network monitoring tools at one second intervals? See this page for a description of the problem and how you can get more accurate stats by simply running collectl at a sub-second interval.

You can have the updated version here

Feb 02 2011

How to know Linux machine is 32 or 64 bit?

How to know Linux machine is 32 or 64 bit?

# uname -m

i386 or i686 then it is 32 bit
x86_64 is 64bit

Feb 02 2011

HP-Unix machine is 32 or 64 bit?

HP-Unix machine is 32 or 64 bit?

Method 1:
# getconf KERNEL_BITS

Method 2:
# ps -ef |grep RT

Method 3:

# file /stand/vmunix

If 64 bit it will show something like: ELF-64 executable object file

Feb 02 2011

How to know Sun Solaris machine is 32 or 64 bit?

How to know Sun Solaris machine is 32 or 64 bit?

# isainfo -v

Sep 07 2010

Command to find files created a day before

This command will help you to find the files created one day before in the specified folder.

find . -type f -mtime 1 -exec ls -lth ‘{}’ \;

Jun 17 2010

How to Detect and Mount the CD-ROM in Linux

How to Detect and Mount the CD-ROM in Linux

1. Detecting CD-ROM/DVD-ROM drive
# wodim –devices

[lokesh@Mudhalvan ~]$ wodim –devices
wodim: Overview of accessible drives (1 found) :
————————————————————————-
0 dev=’/dev/scd0′ rwrw– : ‘HL-DT-ST’ ‘RW/DVD GCC-4243N’
————————————————————————-
[lokesh@Mudhalvan ~]$

2. Testing for iso9660 compatibility
# cat /proc/filesystems

3. Creating mount point
# mkdir /media/cdrom

4. Mounting CD
# mount -t iso9660 /dev/scd0 /media/cdrom/

5. Altering /etc/fstab
/dev/sdc0 /media/cdrom iso9660 ro,user,noauto 0 0

6. Unmount and eject CD
# unmout /dev/sdc0
# eject

Apr 30 2010

How to see newly added emc lun in HP Unix

1. Login as root and do ioscan before add the Lun to the Unix Machine
# ioscan -fnCdisk

2. Add the lun to Unix machine by EMC Navigator

3. No need to restart the Unix machine do the ioscan again will show you the newly added disk as CLAIMED but devices will not show

#ioscan -fnCdisk

Mar 04 2010

chkconfig – Linux Service Auto Start/Stop

chkconfig – Linux Service Auto Start/Stop

The chkconfig command can be used to activate and deactivate services. If you use the chkconfig –list command, you will see a list of system services and whether they are started (on) or stopped (off) in runlevels 0-6

# chkconfig
chkconfig version 1.3.30.1 – Copyright (C) 1997-2000 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.

usage: chkconfig –list [name]
chkconfig –add
chkconfig –del
chkconfig [--level ]

1. chkconfig –list – will query any service in /etc/rc.d with each runlevel

$ chkconfig –list anacron
anacron 0:off 1:off 2:on 3:on 4:on 5:on 6:off

2. chkconfig –level <0/1/2/3/4/5/6> – Will be used to auto start/stop the service at each run level

chkconfig can be used to set a service to be started (or not) in a specific runlevel.

For example, to turn ntpd off in runlevels 3, 4, and 5, use the command:

chkconfig –level 345 ntpd off

Feb 22 2010

How to know Linux process Priority

We will be able to know many information about each process by doing “ps” command.

Do check the man page for “ps”

#man ps

Here is the simple information about the process

[root@TEST01 ~]# ps -ef -o user,pid,project,class,zone,pset,pri,nlwp,psr,time,args

Warning: bad syntax, perhaps a bogus ‘-’? See /usr/share/doc/procps-3.2.7/FAQ
USER PID PROJECT CLS ZONE PSET PRI NLWP PSR TIME COMMAND
root 30833 – TS – – 24 1 1 00:00:00 -bash USER=root LOGNAME=root HOME=/root PATH=/usr/local/sbin:/usr
root 30891 – TS – – 22 1 1 00:00:00 \_ ps -ef -o user,pid,project,class,zone,pset,pri,nlwp,psr,time,
root 3691 – TS – – 24 1 1 00:00:03 /usr/bin/Xorg :0 -br -audit 0 -auth /var/gdm/:0.Xauth -nolisten t
root 3627 – TS – – 16 1 0 00:00:00 /sbin/mingetty tty6 HOME=/ TERM=linux SELINUX_INIT=YES PATH=/bin:
root 3626 – TS – – 18 1 0 00:00:00 /sbin/mingetty tty5 HOME=/ TERM=linux SELINUX_INIT=YES PATH=/bin:
root 3595 – TS – – 21 1 1 00:00:00 /sbin/mingetty tty4 HOME=/ TERM=linux SELINUX_INIT=YES PATH=/bin:
root 3591 – TS – – 18 1 0 00:00:00 /sbin/mingetty tty3 HOME=/ TERM=linux SELINUX_INIT=YES PATH=/bin:
root 3585 – TS – – 21 1 1 00:00:00 /sbin/mingetty tty2 HOME=/ TERM=linux SELINUX_INIT=YES PATH=/bin:
root 3582 – TS – – 21 1 1 00:00:00 /sbin/mingetty tty1 HOME=/ TERM=linux SELINUX_INIT=YES PATH=/bin:
[root@TEST01 ~]#

Feb 12 2010

Disable/Enable Unix user account

To disable an account put an * in front of the account line in /etc/passwd.

To enable it again remove the * in front of the line.

Alibi3col theme by Themocracy