Select Page

Month: January 2018

Step By Step method for installing Nagios in Amazon Linux

Nagios is very lightweight monitoring tool. We are using this tool for past 1-2 years but somehow one day it get crash and to setup/restore Nagios it took more than 4hours(on premises). so rather than running it on a machine that itself was constantly crashing I decided to move it onto Amazon Web Services EC2 platform using the Free Tier Entitlement you get when you first sign up. Therefore total cost to me to move it from home to the cloud was $0, at least for the first 12 months and not taking into account time. Below steps to install Nagios Core and get it running on an Amazon IaaS was known as an EC2 instance using the Amazon Linux AMI as a base OS. To Start Nagios Core Installation you must have your EC2 instance up and run and have already configured SSH access to the instance. These instructions will work equally well with Linux on a bare metal server running any Red Hat variety of Linux such as CentOS. Step 1: Install Prerequisite Software Nagios requires the following packages are installed on your server prior to installing Nagios: * Apache * PHP * GCC compiler * GD development libraries You can use yum to install these packages by running the following commands (as ec2-user): # sudo yum install httpd php # sudo yum install gcc glibc glibc-common...

Read More

Basic Linux Storage Scenario #4

Resize the file system /opt from its current size of 300MB to 200MB. Do not lose any Data while performing the resizing If /opt as allocated storage as standard partition then it is not able to allocate /resize the storage If /opt as allocated as lvm then it can be resized. Commands: df –h lvreduce resize2fs umount fsck Related files: /etc/fstab Check any data on /opt umount fsck /dev/vg/lv-opt //to fix any corrupted block (vg may be different) $ resize2fs /dev/vg/lv-opt 200M e2fsck –F /dev/vg/lv-opt      //To clean corrupted block, If fsck command not work, use this command Use step (4) lvreduce 0L 200M /dev/vg/lv-opt It may destroy data Anyhow we have resized the data in step (4) – all data will be resized within 200M mount –a df –f  or lvdisplay      // to check LV as reduce to 200MB check whether we have lost data ls /opt/ Note: Logical Volume:- can be extended or reduced at any...

Read More

Basic Linux Storage Scenario #3

A New Project has been started in your organization. The developer of this project needs additional disk space for the source code programs related to this project to be stored in their respective home directories. Increase the size of /home to 650MB. If for some reason you are unable to resize it to 650MB, any size between 630MB and 660MB will suffice. Note: While performing the above operation there should not be any data loss of existing data in the /home directory. Commands: df –h //STD Partition lvextend resize2fs $df –h              //Check what kind of storage is allocated to /home $vgdisplay $lvextend –L 650M /dev/vg/lv-home             // you will get the allocated lv to...

Read More

Basic Linux Storage Scenario #2

Is LVM implemented for any of the partitions, If yes, find out the following information Physical Volume –[PV] Name of all physical volumes Sizes of all physical volumes Cmd: $ pvdisplay or $pvs Volume Groups (VG) Name of all volume groups Sizes of all volume groups Size of the physical extent of each volume group How many physicals extends are present in each volume group How many of free space is left in each volume group How many extents are free in each volume group Cmd: $ vgdisplay or $vgs Logical volume – (LV) Name of all LVs and the VG that they belong to Size of all logical volumes Mount points for each logical volume, if mounted. Cmd: $ lvdisplay or $ lvs or  $ df...

Read More

Basic Linux Storage and Scenario #1

Basic hint for remembering:  Primary + extended = max 4 partition can be created In Linux we can have only 4 primary partitions on the disk, after that you cannot able to create a primary partition, if you required then you can add extended partition, not possible after 4-primary partition even you have disk free space. Extended partition will be the container for the remaining partition, It can be created as many you want (up to 10) extended the partition. MBR – Maintaining the record of all existing partition Storage Scenario You have been given a task by your manager to plan for the future disk space requirement of your server. As a first step towards this task, you are required to find out the following information about your server. Please run appropriate commands to gather the information. Names of the disks attached to your server What are their sizes? How much of free space is left on each disk? For all above queries find below answer with commands: $ fdisk –l              //Display all disk which is attached to sever $ parted -l           //Print free -> checks how much free space left $ df –h                  // Display file system disk space usage. That is, it displays the total size, the used and available space for each of your mounted partitions. The h stands for “human-readable”. $ lsblk                    // list...

Read More