Monthly Archives: April 2013

Check current network bandwidth usage on Linux System

root@choi:/usr/local/bin# vim netspeed
if [ -z "$1" ]; then
echo usage: $0 network-interface
echo e.g. $0 eth0
while true
R1=`cat /sys/class/net/$1/statistics/rx_bytes`
T1=`cat /sys/class/net/$1/statistics/tx_bytes`
sleep 1
R2=`cat /sys/class/net/$1/statistics/rx_bytes`
T2=`cat /sys/class/net/$1/statistics/tx_bytes`
TBPS=`expr $T2 - $T1`
RBPS=`expr $R2 - $R1`
TKBPS=`expr $TBPS / 1024`
RKBPS=`expr $RBPS / 1024`
echo "tx $1: $TKBPS kb/s rx $1: $RKBPS kb/s"

root@choi:/usr/local/bin# chmod +x netspeed
root@choi:/usr/local/bin# /usr/local/bin/netspeed eth0

Output Below.


Sysstat – CPU Load, Uptime. RAM usage check in Linux System

Automatic Installation

root@choi:~# apt-get install sysstat

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libsensors4 multiarch-support
Suggested packages:
lm-sensors isag
The following NEW packages will be installed:
libsensors4 multiarch-support sysstat
0 upgraded, 3 newly installed, 0 to remove and 282 not upgraded.
Need to get 595 kB of archives.
After this operation, 1,625 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 testing/main multiarch-support amd64 2.13-38 [150 kB]
Get:2 testing/main libsensors4 amd64 1:3.3.2-2 [54.9 kB]
Get:3 testing/main sysstat amd64 10.0.5-1 [391 kB]
Fetched 595 kB in 18s (31.9 kB/s)
Preconfiguring packages …
Selecting previously deselected package multiarch-support.
(Reading database … 39769 files and directories currently installed.)
Unpacking multiarch-support (from …/multiarch-support_2.13-38_amd64.deb) …
Setting up multiarch-support (2.13-38) …
Selecting previously deselected package libsensors4.
(Reading database … 39773 files and directories currently installed.)
Unpacking libsensors4 (from …/libsensors4_1%3a3.3.2-2_amd64.deb) …
Selecting previously deselected package sysstat.
Unpacking sysstat (from …/sysstat_10.0.5-1_amd64.deb) …
Processing triggers for man-db …
Setting up libsensors4 (1:3.3.2-2) …
Setting up sysstat (10.0.5-1) …

Creating config file /etc/default/sysstat with new version
update-alternatives: using /usr/bin/sar.sysstat to provide /usr/bin/sar (sar) in auto mode.
root@choi:~#vi /etc/default/sysstat
change ENABLED=”false” to ENABLED=”true”
save the file

root@choi:~#vi /etc/cron.d/sysstat
5-55/10 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1
*/2 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1
save the file

root@choi:~#service sysstat restart
Starting the system activity data collector: sadc.

See all the statistics type the command below.

root@choi:~#sar -A


root@choi:~#sar -A > $(date +`hostname`-%d-%m-%y-%H%M.log)

You may also find the other options of the command.

root@choi:~#man sysstat
root@choi:~#man sar


Manual Installation

root@choi:~# apt-cache show sysstat
Package: sysstat
Priority: optional
Section: admin
Installed-Size: 872
Maintainer: Robert Luberda <>
Architecture: amd64
Depends: libc6 (>= 2.7), debconf (>= 0.5) | debconf-2.0, ucf (>= 2.003), lsb-base (>= 3.0-6), bzip2
Recommends: cron
Suggests: isag
Conflicts: atsar (<< 1.5-3)
Filename: pool/main/s/sysstat/sysstat_9.0.6.1-2_amd64.deb
Size: 308104
MD5sum: 272651494df300c14c3a19a0401bda91
SHA1: 6c21e5962beb5c5e78a5cc784196a7ea5d7a73ed
SHA256: eef2ae99f7a5028d42a2da2aef51cdc4df21d4344999278136a2d69a57c81dbe
Description: system performance tools for Linux
The sysstat package contains the following system performance tools:
– sar: collects and reports system activity information;
– iostat: reports CPU utilization and disk I/O statistics;
– mpstat: reports global and per-processor statistics;
– pidstat: reports statistics for Linux tasks (processes);
– sadf: displays data collected by sar in various formats.
The statistics reported by sar deal with I/O transfer rates,
paging activity, process-related activities, interrupts,
network activity, memory and swap space utilization, CPU
utilization, kernel activities and TTY statistics, among
others. Both UP and SMP machines are fully supported.
Tag: admin::{accounting,benchmarking,monitoring}, implemented-in::c, interface::commandline, interface::daemon, role::program, use::measuring, use::monitor, works-with::logfile

We can download the install in this URL specified in the Homepage section.








root@choi:~#cd /usr/src/


root@choi:/usr/src/#tar -zxvf sysstat-10.1.5.tar.gz

root@choi:/usr/src/sysstat-10.1.5# ./configure –prefix=/opt/recon/dcm/platforms/CENTOS6 –disable-documentation –disable-stripping –disable-sensors –disable-nls

root@choi:/usr/src/sysstat-10.1.5# make

root@choi:/usr/src/sysstat-10.1.5# make install
mkdir -p /opt/recon/dcm/platforms/CENTOS6/lib/sa
mkdir -p /var/log/sa
mkdir -p /opt/recon/dcm/platforms/CENTOS6/bin
mkdir -p /opt/recon/dcm/platforms/CENTOS6/share/doc/sysstat-10.1.5
mkdir -p /etc/sysconfig
install -m 755 sa1 /opt/recon/dcm/platforms/CENTOS6/lib/sa
install -m 755 sa2 /opt/recon/dcm/platforms/CENTOS6/lib/sa
install -m 755 sadc /opt/recon/dcm/platforms/CENTOS6/lib/sa
install -m 755 sar /opt/recon/dcm/platforms/CENTOS6/bin
install -m 755 sadf /opt/recon/dcm/platforms/CENTOS6/bin
install -m 755 iostat /opt/recon/dcm/platforms/CENTOS6/bin
install -m 755 mpstat /opt/recon/dcm/platforms/CENTOS6/bin
install -m 755 pidstat /opt/recon/dcm/platforms/CENTOS6/bin
install -m 755 nfsiostat /opt/recon/dcm/platforms/CENTOS6/bin
install -m 755 cifsiostat /opt/recon/dcm/platforms/CENTOS6/bin
install -m 644 sysstat.ioconf /etc/sysconfig
install -m 644 sysstat.sysconfig /etc/sysconfig/sysstat


How To Integrate Drivers For Windows XP/Server 2003/Media Center 2005

1. Download “nLite” software.

2. Install nLite to your machine or to your computer.

3. Start/Run the application after the installation.


Click Next
Put your Windows installer disc in the drive and point nLite to where it is located. It will ask where to copy the files to if it is on a CD/DVD and
automatically detect what version of windows you are trying to slipstream. Click Next.


The next screen asks what you want to accomplish. For the intents and purposes of this tutorial, we’re just going to click on ‘Drivers’ and ‘Bootable
ISO’. Click Next.


This screen is going to ask you for the drivers that you want to integrate. Please remember that you should only include drivers that are for your otherwise, it may not install correctly. Click on the Insert button and select multiple because I have extracted all my drivers to a single common
directory. After it processes all your drivers, you will see a list of them in the window:
Click Next


When it asks you to start the process, go ahead and say Yes.


This will take a few minutes to do, but when it is done, click Next.
Set everything up the way I have it displayed, click Burn, and when it’s done you will have a bootable XP/Windows 2003/etc disc!


You may now proceed to the installation.