Wednesday, 22 June 2011

Intalling nagios with simple steps

Adduser with name of nagios 

useradd -m nagios

Create nagcmd group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user

groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache

Create Directory to store Nagios installation files

mkdir /opt/Nagios

Download Nagios and Plugins
Save file to directory /opt/Nagios
http://www.nagios.org/download/download.php
As of this writing Nagios 3.0.6 (Stable) and Nagios Plugins 1.4.13 (Stable)
Extract Files:

cd /opt/Nagios

tar xzf nagios-3.0.6.tar.gz

cd nagios-3.0.6

Compile and Configure Nagios

./configure --with-command-group=nagcmd

Compile Nagios:

make all

Compile binaries, init script, sample config files:

make install

make install-init

make install-config

make install-commandmode

** Do Not Start Nagios **
Nagios has now been installed to the directory /usr/local/nagios/
Install Nagios Web Interface:

make install-webconf

Nagios Web Interface installed to /usr/local/nagios/share ( http conf file added to /etc/httpd/conf.d/nagios.conf )
Create Web Interface Login User:
** This is not the most secure method **
We will create user “nagiosadmin” ( remember the password you assign !)

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Restart Apache:

service httpd restart

Install Nagios Plugins
Extract Files:

cd /opt/Nagios

tar xzf nagios-plugins-1.4.13.tar.gz

cd nagios-plugins1.4.13

Compile and Configure Nagios Plugins

./configure --with-nagios-user=nagios --with-nagios-group=nagios

make

make install

Configure nagiosadmin email address for alerts

vi /usr/local/nagios/etc/objects/contacts.cfg

email     nagios@localhost   ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******

Verify the sample Nagios configuration files

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Total Warnings: 0
Total Errors: 0

Start Nagios
Enable Nagios to start at system startup / boot

chkconfig --add nagios

chkconfig nagios on

chkconfig httpd on

Start Nagios

service nagios start

Log into Web Interface

http://ip-address/nagios/

Monday, 16 May 2011

What is Ext4

Ext4

  • Ext4 stands for fourth extended file system.
  • It was introduced in 2008.
  • Starting from Linux Kernel 2.6.19 ext4 was available.
  • Supports huge individual file size and overall file system size.
  • Maximum individual file size can be from 16 GB to 16 TB
  • Overall maximum ext3 file system size is 1 EB (exabyte). 1 EB = 1024 PB (petabyte). 1 PB = 1024 TB (terabyte).
  • Directory can contain a maximum of 64,000 subdirectories (as opposed to 32,000 in ext3)
  • You can also mount an existing ext3 fs as ext4 fs (without having to upgrade it).
  • Several other new features are introduced in ext4: multiblock allocation, delayed allocation, journal checksum. fast fsck, etc. All you need to know is that these new features have improved the performance and reliability of the filesystem when compared to ext3.
  • In ext4, you also have the option of turning the journaling feature “off”.


Converting ext3 to ext4

umount /dev/sda2

tune2fs -O extents,uninit_bg,dir_index /dev/sda2

e2fsck -pf /dev/sda2

mount /dev/sda2 /home
 
Please try it on test machine. 

 

Friday, 18 March 2011

NFS & NIS (authentic linux client with linux sever)

                                                      NFS & NIS


NFS

NFS -            Network File System
Port no.         2049
Conf. file       /etc/exports
init script      /etc/ini.t/nfs

suppose i want to share /home directory of server in clients

1) open a file /etc/exports
/home(rw,sync) *.shreesailug.com
this means share can use only in my domain suppose i want to share to all domains then just put * dont put any domain name .
we are here doing nis also so i have given permission rw so that user can write to there home directory
no_root_squash