FS Monitoring

::::::::::::: Script to Monitor File system :::::::::::::::

No need to configure any mail server just send a mail/messages using sendEmail..

Download sendEmail Program from below link



SendEmail is a perl script/program, and only needs to be copied to a directory
in your path to make it accessible.  Most likely the following steps will
be sufficient:

1) Extract the package
    tar -zxvf sendEmail-v1.XX.tar.gz

2) Copy the sendEmail script to /usr/local/bin
    cp -a sendEmail-v1.XX/sendEmail /usr/local/bin

3) Make sure its executable
    chmod +x /usr/local/bin/sendEmail

4) Run it

  * Running sendEmail without any arguments will produce a usage summary.
  * SendEmail is written in Perl, so no compilation is needed.
  * On a Unix/Linux OS if your perl binary is not installed at /usr/bin/perl
    you may need to edit the first line of the script accordingly.

# Script Starts................
# Purpose: Disk Space Monitoring
# Author: Ravi Kumar
# Script Start
# Variables #
PERCENTAGE=`df -hP | egrep '^/dev/' | awk '{ print $6 "_:_" $5 }' | awk -F"_:_" '{ print $2 }' | cut -d'%' -f1 | head -n 1`
PERCENTAGE1=`df -hP | egrep '^/dev/' | awk '{ print $6 "_:_" $5 }' | awk -F"_:_" '{ print $2 }' | cut -d'%' -f1 | tail -1`
BODY=`df -hP | egrep '^/dev/'`

        sendEmail -f alert@gmail.com -t $MAILLIST -u "$HOSTNAME - File System is CRITICAL $PERCENTAGE%" -m $BODY -s MAIL-EXCHANGE.com
elif [ $PERCENTAGE1 -ge $CRITICAL ];
        sendEmail -f alert@gmail.com -t $MAILLIST -u "$HOSTNAME - File System is CRITICAL $PERCENTAGE1%" -m $BODY -s MAIL-EXCHANGE.com
        echo ""

Redhat Linux Installation

After booting from RHEL bootable CD/DVD, We will get above screen
           Ø  If you want to install OS using GUI then hit ENTER key
           Ø  If you want to install OS using TEXT mode (CLI) then type linux test hit ENTER key
Currently we are installing Operating system using GUI mode.

If you want to verify you installation media (OS CD/DVD) press OK (It will take long time to verify). Press SKIP to jump next screen.

Click NEXT

Select the Language then click NEXT

Select Keyboard Language then click NEXT

Click OK

It will give you a WARNNING since you don’t have a key click on SKIP

 Click on YES to continue

Remove all partitions on selected drives and create default layout this options will delete all the drive partitions and install OS
Remove all Linux Partitions this option will only remove Linux partitions and creates default layout, install OS
Use free space this option will install on free space of the drive creates default layout
Create Custom layout this option will not create any layout you have to create as per your requirement
This option will give more customization you to create your own layout (Selected Customize Layout)

Now you can able to see HDD space to create partitions follow click on NEW

After clicking on NEW you will see above popup
First create /boot because it needs normal partition to store MBR (master boot record). 100MB is enough for /boot partition.
Mount point /boot
File system Type: ext3 OR ext4

Select fixed size Click OK

See above screen /boot partition is created.
Note:  Always remember to create LVM partitions OR RAID partitions is recommended, because later on if you want extend the ROOT file system is possible and easy.
To create LVM partition click on NEW you can able to see popup as below

For creating a LVM partition we have to create Physical Volume select file system type as physical volume (LVM)
Select Fill to maximum allowable size then click on OK

See above screen LVM PV is created now select PV and click on LVM popup will open as below screen

Change the Volume group name as required. Example: VG01

Click on ADD

As above screen select Mount point as “/” slash, provide Logical volume name “ROOT” for easy identification, provide the size as per your requirement (Minimum 10GB). Click on OK
Again click on ADD

Select File system type as SWAP, provide logical volume name as “SWAP” for easy identification. Provide the swap size is always (RAM SIZE * 2) in my case 2GB RAM. Click on OK

As you created above all the partitions are created. Click NEXT
Minimum Recommended Partitions
Slash “/”

Select label and click NEXT (if you want to change label you can change it using edit option)

Here provide your system name (Example: ARK-IT-Solutions.localdomain)
Click on EDIT

If you are using DHCP in your network select Use dynamic IP configuration
If not using DHCP enable IP4 and provide IP address and Netmask Click on OK

Provide the gateway IP and DNS IP and Click on NEXT

Select the time zone and click on NEXT

Provide your password and confirmation password then click on NEXT

Select to install the required software’s while installing the operating system, select software development and web server and select Customize now.
Then click on NEXT

Select the required packages from all the fields click on optional packages and check all (as showed in below screen)

Selected all the optional packages as well click on CLOSE

then click on NEXT

After next dependencies will be resolved and ready for installation
 Click NEXT to install Operating system
 Installation is in process (it will take few minutes depends on selected packages)

After completion creating partitions and installing packages it will ask you to reboot the server. Click on Reboot

After reboot it will ask you to complete next options click on FORWARD

Select Yes I agree to the license agreement and click FORWARD

Firewall enabled and disabled
If you enable the firewall you have to allow the services and ports as you required
If you want to enable security click on Enable or else disable and click FORWARD

Disable the SELinux if you don’t know the usage. Click on FORWARD

 Click YES
 click Forward
 Select Date & Time Click forward
 Select Yes Click Forward
 Click on No Thanks

Provide additional username to create and provide password click on FORWARD

Test your sound then click on FORWARD

Click on Finish

It will ask you to reboot click OK
Your server installation is successfully completed now you can use it.

Welcome Banner Linux in Server

::::: Welcome Banner in Linux Server :::::

To write user Login banner message you have to edit /etc/motd and /etc/issue file to enter the message.

[ravi@ARK-IT-Solutions ~]$ vi /etc/issue
Red Hat Enterprise Linux Server release 5 (Tikanga)
Kernel \r on an \m \n

WARNNING!! If your not authorized person to login logoff immediatly.

:wq (Save & Exit)

Then Edit

[root@ARK-IT-Solutions ~]# vi /etc/motd
Welcome to ARK IT Solutions

Server Name: Thungabhadra
IP Address :

WARNNING..!! If your not authorized person logoff immediatly.

:wq (Save & Exit)

Now Login to your server

your Done.