Linux Architecture




Kernel: It is a program. Kernel is a Core component of operating system, interacts directly with hardware and provides low level services to upper layer components.
Shell: An interface to kernel, hiding complexity of kernel’s functions from users. Takes commands from user and executes kernel’s functions.
User Interface: In information technology, the user interface (UI) is everything designed into an information device with which a human being may interact. Two types CLI (Command line interface) and GUI (Graphical User Interface).
System Library - System libraries are special functions or programs using which application programs or system utilities accesses Kernel's features. These libraries implements most of the functionality of the operating system and do not requires kernel module's code access rights.
System Utility - System Utility programs are responsible to do specialized, individual level tasks.

Kernel Mode vs User Mode


        Kernel component code executes in a special privileged mode called kernel mode with full access to all resources of the computer. This code represents a single process, executes in single address space and do not require any context switch and hence is very efficient and fast. Kernel runs each processes and provides system services to processes, provides protected access to hardwares to processes.

        Support code which is not required to run in kernel mode is in System Library. User programs and other system programs works in User Mode which has no access to system hardwares and kernel code. User programs/ utilities use System libraries to access Kernel functions to get system's low level tasks.
Basic Features

Following are some of the important features of Linux Operating System.

    Portable - Portability means softwares can works on different types of hardwares in same way.Linux kernel and application programs supports their installation on any kind of hardware platform.

    Open Source - Linux source code is freely available and it is community based development project. Multiple teams works in collaboration to enhance the capability of Linux operating system and it is continuously evolving.

    Multi-User - Linux is a multiuser system means multiple users can access system resources like memory/ ram/ application programs at same time.

    Multiprogramming - Linux is a multiprogramming system means multiple applications can run at same time.

    Hierarchical File System - Linux provides a standard file structure in which system files/ user files are arranged.

    Shell - Linux provides a special interpreter program which can be used to execute commands of the operating system. It can be used to do various types of operations, call application programs etc.

    Security - Linux provides user security using authentication features like password protection/ controlled access to specific files/ encryption of data.


 

Linux System Architecture is consists of following layers

    Hardware layer - Hardware consists of all peripheral devices (RAM/ HDD/ CPU etc).

    Kernel - Core component of Operating System, interacts directly with hardware, provides low level services to upper layer components.

    Shell - An interface to kernel, hiding complexity of kernel's functions from users. Takes commands from user and executes kernel's functions.

    Utilities - Utility programs giving user most of the functionalities of an operating systems.

Windows Vs Linux


Windows Vs Linux

                                Windows
                                      Linux
    • It is a proprietary software everything need to buy
    • It is an open source software everything is free
    • Less Secure
    • More Secure
    • More costly
    • Less Cost compare to windows
    • Chance to get a carpal tunnel syndrome
    • There is no chance to get carpal tunnel syndrome
    • Developed by Microsoft corporation
    • Developed by Linus Torvalds
    • Options need to select
    • You can develop anything as per your requirement
    • Kernel is not editable
    • Kernel is editable

NagiosXI Login Notification

If you want to monitor who is logged in to the NagiosXI web console then schedule this below script in your crontab it will check for User Activities and it will send you a Mail alert.

#!/bin/bash
# Purpose: To get alerts when user is logged in to Nagiosxi console
# Author: Ankam Ravi Kumar
# Date: 13-Feb-2015
# NagiosXI Console Login check Script START
DT=`date +%Y-%m-%d`
psql -U nagiosxi -d nagiosxi -t -A -F"," -c "select * from xi_auditlog;" > /tmp/auditlog.txt
cat /tmp/auditlog.txt |grep $DT > /tmp/today.txt
EPOCTIME=`cat /tmp/today.txt |awk -F, '{print $2}' |tail -1`
ENDTIME=$(date +%s)
STARTIME=$(date +%s -d"$EPOCTIME")
echo $((ENDTIME-STARTIME)) | awk '{print int($1/60)}' > /tmp/value1
count=`cat /tmp/value1`
if [ $count -lt 8 ]
then
        cat /tmp/auditlog.txt |grep $DT |tail -1 > /tmp/mail
        mail -s "NagiosXI Login ALERT: User `cat /tmp/mail | awk -F, '{print $4}'` `cat /tmp/mail | awk -F, '{print $6}'` to `hostname`" aravikumar48@gmail.com < /tmp/mail
fi
rm -rf /tmp/auditlog.txt /tmp/today.txt /tmp/value1 /tmp/mail
#END