Posts

Showing posts from April, 2013

InnoDB vs MyISAM

InnoDB and MyISAM: InnoDB is newer while MyISAM is older. InnoDB is more complex while MyISAM is simpler. InnoDB is more strict in data integrity while MyISAM is loose. InnoDB implements row-level lock for inserting and updating while MyISAM implements table-level lock. InnoDB has transactions while MyISAM does not. InnoDB has foreign keys and relationship contraints while MyISAM does not. InnoDB has better crash recovery while MyISAM is poor at recovering data integrity at system crashes. MyISAM has full-text search index while InnoDB has not. In light of these differences, InnoDB and MyISAM have their unique advantages and disadvantages against each other. They each are more suitable in some scenarios than the other. Advantages of InnoDB:     InnoDB should be used where data integrity comes a priority because it inherently takes care of them by the help of relationship constraints and transactions.     Faster in write-intensive (inserts, updat

Comment specific lines in VI editor

To Comment specific lines in VI Editor: syntax: :x,y s/^/#/g x,y -> starting and ending line numbers. ^ -> points to line's begning # -> usual way to comment in vim Example: :450,500 s/^/#/g (or) :.,+10 s/^/#/g . is current line +10 is ten lines from the current.

Difference Between VIRUS, TROJAN and ROOT-KIT

VIRUS: A virus is normally runs in "stealth mode", hiding itself by infecting executalbes and system files., It still typically runs as an application which is why anti-virus software can detect and remove it. TROJAN: A trojan, which is an advanced virus, is meant to hide in a more soophisticated fashion. ROOT-KIT: A root-kit, on the other hand, subverts part of the operating system to hide it self and gain the maximum control possible. Due to this, it is capable of monitoring as well as performing all activities on a system. It can act as a vehicle for other root-kits and virues as well. Root-Kits turn a computer into a remotely controllable victim, often also making it a spam-bot to send out unsolicited commercial email.

Monitor Remote Linux Host using Nagios:

Configuration steps on the Nagios monitoring server to monitor remote host: Download NRPE Add-on: Download nrpe-2.12.tar.gz from Nagios.org and move to /home/downloads: Install check_nrpe on the nagios monitoring server: # tar xvfz nrpe-2.12.tar.gz # cd nrpe-2.1.2 # ./configure # make all # make install-plugin ./configure will give a configuration summary as shown below: *** Configuration summary for nrpe date ***: General Options: ———————— NRPE port: 5666 NRPE user: nagios NRPE group: nagios Nagios user: nagios Nagios group: nagios Note: I got the “checking for SSL headers… configure: error: Cannot find ssl headers” error message while performing ./configure. Install openssl-devel as shown below and run the ./configure again to fix the problem. # rpm -ivh openssl-devel-0.9.7a-43.16.i386.rpm krb5-devel-1.3.4-47.i386.rpm zlib-devel-1.2.1.2-1.2.i386.rpm e2fsprogs-devel-1.35-12.5. Verify whether nagios monitoring server can talk to the remotehost. #/usr/local/nagios/libexec/check_nrpe -

chkrootkit installation.

chkrootkit installation steps: # cd /usr/local/src/ – Down load the chkrootkit. # wget  http://www.spenneberg.org/ chkrootkit-mirror/files/ chkrootkit.tar.gz - Unpack the chkrootkit you just downloaded. # tar -xvzf chkrootkit.tar.gz - Change to new directory # cd chkrootkit-* (select the version ) - Compile chkrootkit # make sense - Run chkrootkit # ./chkrootkit How to setup a daily scan report? - Load crontab # crontab -e - Add this line to the top: ============================== ============================== ============== 0 1 * * * (cd /usr/local/src/chkrootkit*; ./chkrootkit 2>&1 | mail -s “chkrootkit output”  email@domain.com ) ============================== ============================== ==============

Nagios: CRITICAL - Socket timeout after 10 seconds

Socket timeout after 10 seconds: As any other monitoring system Nagios can produce false alarms. Usually it happens when Nagios fails to get the reply from the host being monitored during some pre-defined timeout. In order to mark service as down Nagios does three checks and if all of them are failed then the service is marked down and administrator will got an alert about its critical status. At the same time even if one of those checks fails Nagios will report administrator about it depending on configuration. If you face some false alarms occasionally but the service is actually online then it makes sense to increase timeout value from default 10 seconds to, let’s say, 20 seconds. FIX: Open one of nagios’ configs where check commands are defined (usually it’s /etc/nagios/commands.cfg file) and find there a block named check_nrpe, add “-t 20″ to the end of its command_line so it will look like below: define command {     command_name    check_nrpe     command_line    $USER1$/chec

NagiOS Server Monitoring Tool- LINUX

Image
Quick installation steps: Nagios is an enterprise-class open source computer/network monitoring software with on-going enhancements from its vibrant community made up of worldwide supporters. User account and group ID: [root@ranjith ~]# useradd -m nagios [root@ranjith ~]# passwd nagios [root@ranjith ~]# groupadd nagcmd [root@ranjith ~]# usermod -a -G nagcmd nagios [root@ranjith ~]# usermod -a -G nagcmd apache Download the latest Nagios Core and Nagios Plugins source files or just use just uses wget to download as below, Nagios Core: [root@ranjith ~]# wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.3.tar.gz compile and install the Nagios core: [root@ranjith ~]# tar -zxvf nagios-3.2.3.tar.gz [root@ranjith ~]# cd nagios-3.2.3 FYI : From next execution onwards, you may use tee command to duplicate output to a file for examination, which could be useful to trace errors that triggered when compiling source code. [root@ranjith ~]# ./configure -