Monday, 23 April 2012

server monitoring using dstat

DSTAT an excellent tool which combines the overall stats of vmstat, iostat, netstat and ifstat. Dstat allows us to view all of the system resources in the real-time including the network bandwidth, network I/O , IRQ etc which helps the administrator to get an clear picture of what is going on in their server. It also reduces the headache of opening a separate shell/terminal to view the stats during bench tests.

# yum install dstat

# dstat

fping for network admins to monitor

 Network administrators may need a command or tool that will display all the live hosts in their network/subnet to keep track of all the activities and for that you can try using fping tool which works based on the ICMP echo request.

# yum insall fping

# fping -g 192.168.1.0/24 | grep “alive”


atop for server monitoring

The program atop is an interactive monitor to view the load on a Linux system.  It shows the occupation of the most critical hardware resources (from a performance point of view) on system level, i.e. cpu, memory, disk and network.

It also shows which processes are responsible for the indicated load with respect to cpu- and memory load on process level. Disk load is shown if per  process  “storage accounting” is active in the kernel or if the kernel patch âcntâ has been installed.

Network load is only shown per process if the kernel patch âcntâ has been installed. Every interval (default: 10 seconds) information is shown about the resource occupation on system level (cpu, memory, disks  and  network  lay-ers),  followed  by a list of processes which have been active during the last interval (note that all processes that were unchanged during the last interval are not shown, unless the key âaâ has been pressed).

If the list of active processes does not entirely fit on the  screen,  only the top of the list is shown (sorted in order of activity). The intervals are repeated till the number of samples (specified as command argument) is reached, or till the key âqâ is pressed in interactive mode.

# yum insall atop

# atop



phpMyTop for server monitoring

Download and untar the source file inside the web directory which you like to access (ie.. for example /var/www/html )

# wget http://www.gnutoolbox.com/download/linux/dbserver/mysql/phpMyTop_1.0.1.tgz

# tar zxvf phpMyTop_1.0.1.tgz

# cd phpMyTop/

# mysql [-uyouruser] [-pyourpass] < install.sql
(you need to create a username and password on the mysql to dump the database)

Edit the config.php and modify the following lines with your username and password.

    $GLOBALS['mytop_dbuser'] = ‘root’;
    $GLOBALS['mytop_dbpass'] = ”;
    $GLOBALS['mytop_dbhost'] = ‘localhost’;
    $GLOBALS['mytop_db'] = ‘phpmytop’;

Tuesday, 17 April 2012

How to access windows process from linux

You can check the services running in windows from linux by doing the following

# net rpc service list -I 192.168.1.199 -U administrator%redhat
                                                                     username%password

# net rpc service start VBoxService -I 192.168.1.160 -U  administrator%redhat

Virtualbox is only the name of the service(can control also),we can start,stop or restart too.

Monday, 16 April 2012

How to run Linux in a Web Browser

This is an emulator that lets you use Linux inside your web browser. You may write shells scripts using Sed and Awk, master regular expressions, play around with popular text editors like Vi and Emacs, look up man pages of various Linux command and much more – all inside your browser.

check out the very-impressive JSLinux project.

or  jslinux
In the above link you can work as a root user.




How to create a core dump on Linux for VirtualBox

A core dump is very helpful for helping us tracking down crashes of VirtualBox. To create a core dump, start VirtualBox from a command line.

$ ulimit -c unlimited
$ sudo su
# echo -n 1 > /proc/sys/kernel/core_uses_pid
# echo -n 1 > /proc/sys/fs/suid_dumpable
# exit
$ VirtualBox
or better start the VM directly: 
$ ulimit -c unlimited
$ sudo su
# echo -n 1 > /proc/sys/kernel/core_uses_pid
# echo -n 1 > /proc/sys/fs/suid_dumpable
# exit
$ /usr/lib/virtualbox/VirtualBox -startvm VM_NAME
 
Ensure that no startup script (~/.bashrc, ~/.bash_profile, ~/.profile)
contains an instruction like ulimit -c 0 as the limicannot be increased once 
it was set to zero. The VirtualBox processes are started suid root, that is, with 
permissions to do things  that "normal" applications cannot. This is the reason for the 
$ sudo su 
$ echo -n 1 > /proc/sys/fs/suid_dumpable
$ exit

before starting the VM/GUI (note that sudo echo will not do what we want here).
When VirtualBox or one of its processes crashes, a file core.<pid>
 is created in the current directory. Be aware that core dumps can be 
very huge. Please compress the file before submitting it to a bug 
report.
you can check which core dump process created them using the command
$ file core.<pid>