Search Windows and Linux Networking

Showing posts with label Open Source. Show all posts
Showing posts with label Open Source. Show all posts

Thursday, October 4, 2012

Installing VNC Server in Linux (CentOS)

How to install VNC server in CentOS


Install Required Packets using yum

# yum install vnc-server gnome-desktop xorg-x11-xinit xterm gnome-applets gnome-session gnome-themes gnome-panel gdm firefox dbus-x11

Set Password for VNC server user

# vncpasswd



Type new password and confirm it for accessing vnc server

Note:- To set password to user you must login with that user to create vnc password.

# vi /etc/sysconfig/vncservers

VNCSERVERS="1:root"
VNCSERVERARGS[2]=”-geometry 800×600 -nolisten tcp -nohttpd -localhost”


#service vncserver start
#service vncserver stop

#vi .vnc/xstartup

Uncomment the following two lines for normal desktop:
 
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc


# service vncserver start

It done. Now connect to vnc server from vncviewer with <IP_Address>:1


Wednesday, February 8, 2012

How to Install and Configure Proftpd Server on CentOS Step by Step


Installing Proftpd Server on CentOS (Linux)
 
Proftpd is the Highly configurable GPL-licensed FTP server software .it is an enhanced, secure and highly configurable FTP server. Its configuration syntax is very similar to apache web server. You can know more information from http://www.proftpd.org .

Download proftpd rpm package from http://pkgs.org/ and install with rpm –ivh <Package name>.rpm

OR

If you want to install using yum then add repository  and then install proftpd server

#  cd /etc/yum.repos.d/
# wget http://centos.karan.org/kbsingh-CentOS-Extras.repo
# rpm --import http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
# Vi /etc/yum.repos.d/ kbsingh-CentOS-Extras.repo
Set both enable=1
# yum clean all
# yum update all

Now install Proftpd

# yum install proftpd

Now your ftp server is ready to functional  with default configuration but you should check following values for your Basic ftp server in /etc/proftpd.conf configuration file

Server Name, Server Type and Port

Now start proftpd and set on for startup

# service proftpd start
# chkconfig proftpd on

Check running process for proftpd
# ps -ef | grep proftpd
nobody    4463     1  0 23:35 ?        00:00:00 proftpd: (accepting connections)
root      4470  4202  0 23:36 pts/2    00:00:00 grep proftpd

OR you can verify whether your FTP server is running using:

# netstat -an | grep -F tcp | grep -F LISTEN | grep -F 21
tcp        0      0 :::21                       :::*                        LISTEN


Now when you try to connect ftp server it will be ask you for your name and password type valid user name and password as per /etc/passwd file . it will take you home directory of that user. 

Anonymous FTP Server :-

If you wanted Anonymous access uncomment Anonymous directive. Or you can add following in /etc/proftpd.conf file
# vi /etc/proftpd.conf

<Anonymous /var/ftp/pub>
AnonRequirePassword       off
User                                   ftp
Group                                 ftp
RequireValidShell                off
<Directory *>
<Limit WRITE>
          DenyAll
</Limit>
</Directory>
</Anonymous>


 Note: - user and group must be valid

verify configuration :-

# proftpd –t6

If it not given any error then reload configuration

# service proftpd reload

Now if you try to access FTP server it will not ask you any password and show you contain of /var/ftp/pub directory.
If you wanted to allow user to upload data then in Limit WRITE directive change it AllowAll.

Friday, December 9, 2011

Step by Step How to: Uninstalling Zabbix Agent from Windows system.

Step by Step How to: Uninstalling Zabbix Agent from Windows system.

Suppose you have installed Zabbix Agent in C:\Program Files\Zabbix with following method :-

Echo Server=192.168.73.142 > "c:\Program Files\zabbix\zabbix_agentd.conf"
Echo Hostname=%COMPUTERNAME% >> "c:\Program Files\zabbix\zabbix_agentd.conf"
"C:\Program Files\zabbix\zabbix_agentd.exe" -c "c:\Program Files\zabbix\zabbix_agentd.conf" –i
"C:\Program Files\zabbix\zabbix_agentd.exe" -c "c:\Program Files\zabbix\zabbix_agentd.conf" –s


And you want to uninstall it now to do fire the following command from command prompt:

Note:- It is always good option to backup our configuration file want to use later.

C:\Program Files\Zabbix>zabbix_agentd.exe -x -c"C:\Program Files\Zabbix\zabbix_agentd.Conf"
C:\Program Files\Zabbix>zabbix_agentd.exe -d -c"C:\Program Files\Zabbix\zabbix_agentd.Conf"
rmdir /s "C:\Program Files\Zabbix"


This will uninstall windows zabbix agnet from your system. 1st command stop zabbix agent service , 2nd uninstalled zabbix agent and last one do cleanup by deleting Zabbix directory with all constant from it. 

Wednesday, November 23, 2011

Quick overview Nagios (Open Source Monitoring system)


Nagios Documentation
================================================================
Nagios Server Basic information:-
================================================================
Nagios Binaries: -/opt/nagios
Nagios server Configuration: - /etc/Nagios
Nagios data: /var/Nagios
Nagios plugins: - /opt/nagios/plugins/
User for Nagios : Nagios
Nagios user password: Nagios
Nagios group: nagioscmd
================================================================
Configuration files:-
================================================================
/etc/nagios/hosts.cfg :-  File to define host
/etc/nagios/services.cfg:- File to define services
/etc/nagios/hostgroups.cfg:- File to define host groups  or add host in to group
/etc/nagios/servicegroups.cfg:- File to define service group or add service in to group
/etc/nagios/contacts.cfg:- File to define contact and contact group
/etc/nagios/service_dependencies.cfg:- file to define Service dependencies
/etc/nagios/escalationservices.cfg:- File to define service escalation template
/etc/nagios/escalationhost.cfg:- File to define host escalation template
/etc/nagios/serviceescalation/:-  Directory  to define service escalation
/etc/nagios/hostescalation/ :- Directory  to define host escalation
/etc/nagios/notification/notifications.cfg : File to define notification command
===================================================================
Adding new host for monitoring
===================================================================
  1. Two templates are created for Servers and network devices as core-server for server and core-network for network devices. 
  2. To add new host in Nagios we required host name and IP address of system.
  3. To add host for monitoring we have to modify and append /etc/nagios/hosts.cfg  at the bottom of the file define host information a:-
 define host{
        use                                 core-server
        host_name                 sandeep.domainname.com
        alias                               sandeep
        address                        192.168.1.115
         parents                        Router_Pune
        statusmap_image     win40.gd2
}






=====================================================================
Add new host group or adding host in to group.
=====================================================================
we have to modify and append /etc/nagios/hostgroups.cfg this file when we required to add new host group  or to add other group into other host group or to add host in to existing group.

define hostgroup{
hostgroup_name             All_Server
alias                                All_Server
hostgroup_members      Mumbai_Win_Server,Pune_Win_Server
members                      Sandeep.domainname.com,Linux05.domainname.com
        }
define hostgroup{
 hostgroup_name            Mumbai_Win_Server
alias                                Mumbai_Win_Server
members                         File_Server01.domainname.com,AD_Pri.domainname.com
}



========================================================================
Add services in to Nagios for monitoring.
========================================================================
  1. We have to modify or append /etc/nagios/services.cfg file for adding new services in to nagios or monitoring services for the host.
  2. Created templates for comman setting for services and latter use that template for monitoring services and adding host information to monitor services.
         For example:- we have created one common template as services for all services and latter we create new separate template for each service and then use that template and add host by separated by " , "  .

define service{
        name                              services
       active_checks_enabled             1
        passive_checks_enabled            1
        parallelize_check                 1
        obsess_over_service               1
        check_freshness                   0
        notifications_enabled             1
        event_handler_enabled             1
        flap_detection_enabled            1
        failure_prediction_enabled        1
        process_perf_data                 1
        retain_status_information         1
        retain_nonstatus_information      1
        is_volatile                       0
        check_period                      24x7
        max_check_attempts                3
        normal_check_interval             10
        retry_check_interval              2
        contact_groups                    admins
        notification_options              w,u,c,r
#        notification_interval            60
        notification_period               24x7
         register                         0
        }



For example monitoring ping for all host:-

 define service{
        use                             services,graphed-service,srv-pnp
        name                            ping
        check_command                   check_ping!1000.0,20%!2000.0,60%
        register                        0
        }
define service{
        use                             ping
        service_description             PING
        contact_groups                 admins
        hostgroup_name                  all_hosts
        }


One more example  for monitoring C drive :-

define service{
        use                             services
        name                            Disk space on c
        check_command                   check_nt!USEDDISKSPACE!-l c -w 80 -c 90
        register                       0
        }

define service{
        use                             Disk space on c
        service_description             C: Drive Space
       host_name         File_Server01.domainname.com, AD_Pri.domainname.com, Sandeep.domainname.com
#        hostgroup_name                  Domain Controllers
}






========================================================================
Add Service group in to Nagios.
========================================================================
To add service group we have to modify or append  /etc/nagios/servicegroups.cfg file . Service group are same as host group only instead of hostgroup_name . We have to use servicegroup_name. and one more thing to conceder is that when adding member syntax for this is < hostname,service_description>   

define servicegroup{
        servicegroup_name          dns-server
        alias                   DNS Servers
        members                 DC-01.domainname.com,Dns,DC01-MUMBAI.domainname.com,Dns,
}             

define servicegroup{
        servicegroup_name       C: Drive
        alias                   C: Drive
        members                 File_Server01.domainname.com,C: Drive Space,AD_Pri.domainname.com,C: Drive Space
}


========================================================================
Create new contact or contact group in to Nagios.
=========================================================================
We define contact or contact group in nagios. by modify or append /etc/nagios/contacts.cfg file.

define contact{
        contact_name            sandeep
        use                             generic-contact
        alias                           sandeep kapadane
        email                          sandeepk@email.com
        }
define contact{
        contact_name             yourname
        use                             generic-contact
        alias                           Your Name
        email                          yourname@email.com
        }

To create contact group same like servicegroup_name and hostgroup_name:-

define contactgroup{
        contactgroup_name     IT_Team_Pune
        alias                              IT Team Pune Administrators
        members                      sandeep,yourname
        }


========================================================================
Configure Service dependencies in  Nagios.
========================================================================
We have to modify or append  /etc/nagios/service_dependencies.cfg  for configure service dependences in nagios.

define servicedependency{
        host_name                                              File_Server01.domainname.com
        service_description                             NSClient++ Version
        dependent_host_name                     File_Server01.domainname.com
        dependent_service_description     UP TIME ,C: Drive Space,CPU Load,Memory Usage,Server Service,DNS Server Service
        notification_failure_criteria            o,c,w,u,p
        execution_failure_criteria              n
        }


define servicedependency{
        host_name                                              File_Server01.domainname.com
        service_description                            
UP TIME
        dependent_host_name                     File_Server01.domainname.com
        dependent_service_description     C: Drive Space,CPU Load,Memory Usage,Server Service,DNS Server Service
        notification_failure_criteria            o,c,w,u,p
        execution_failure_criteria              n
        }




=========================================================================
Define service escalation template
=========================================================================
Service escalation template will define in /etc/nagios/escalationservices.cfg file  latter we use this template for every service escalation .

# First three notification sent to every 60 min interval (one mail per 1hr in a day )
define serviceescalation{
        name                    1stnotification
        first_notification      1
        last_notification       3
        notification_interval   60
        register                        0
        }
# After 3rd notification 4th and 5th every 300 min (one mail per 5hr )
define serviceescalation{
        name                    2ndnotification
        first_notification      4
        last_notification       5
        notification_interval   300
        register                        0
        }
# After 5th notification 6th and 7th notification every 12 hr 
define serviceescalation{
        name                    3rdnotification
        first_notification      6
        last_notification       7
        notification_interval   720
        register                        0
        }
# After 7th notification 8th to 14th notification  every 24hr (one mail per day)
define serviceescalation{
        name                    4thnotification
        first_notification      8
        last_notification       14
        notification_interval   1440
        register                        0
        } 
# After 14th notification one mail every 7200 min (one mail per week) till fix the problem
define serviceescalation{

       name                    5thnotification
        first_notification      15

        last_notification       0

        notification_interval   7200
        register                        0

        }         




=====================================================================
Define host escalation template
======================================================================
Host escalation template define in file /etc/nagios/escalationhost.cfg and it same as service escalation only we have to change serviceeescalation with hostescalation for example:-
define hostescalation{
        name                         1stnotification
        first_notification       1
        last_notification        3
        notification_interval   60
        register                        0
        }

define hostescalation{
        name                    2ndnotification
        first_notification      4
        last_notification       5
        notification_interval   300
        register                0
        }



========================================================================
Define service escalation
========================================================================
To define service escalation for services we need to create new file for each services in /etc/nagios/serviceescalation/ directory with file extension with .cfg file for example service escalation for ping service we have to create new file name as ping.cfg and add notification option and contact name.
Ping.cfg”-

# For Defining service escalation  nagios required at list host_name And/or hostgroup_name , contacts and/or contact_groups and service_description  along with our template :- 

define serviceescalation{
        use                     1stnotification
#       host_name               sandeep.domainname.com
        hostgroup_name          all_hosts
        service_description     PING
#       contact_groups          admins
        contacts                sandeep
        }

define serviceescalation{
        use                     2ndnotification
#       host_name               sandeep.domainname.com
        hostgroup_name          all_hosts
        service_description     PING
#       contact_groups          admins
        contacts                sandeep,yourname
        }

define serviceescalation{
        use                     3rdnotification
#       host_name               sandeep.domainname.com
        hostgroup_name          all_hosts
        service_description     PING
#       contact_groups          admins
        contacts                sandeep,yourname,help
        }

define serviceescalation{
        use                     4thnotification
#       host_name               sandeep.domainname.com
        hostgroup_name          all_hosts
        service_description     PING
#       contact_groups          admins
        contacts                sandeep,yourname,help
        }

define serviceescalation{
        use                     5thnotification
#       host_name               sandeep.domainname.com
        hostgroup_name          all_hosts
        service_description     PING
#       contact_groups          admins
        contacts                sandeep,yourname,help
        }



========================================================================
Define host escalation
========================================================================
Configuring host escalation is same as service escalation just we have to create new file in /etc/nagios/hostescalation/ directory. For example host escallaion for all_host group

# For Defining host escalation  nagios required at list host_name And/or hostgroup_name , contacts and/or contact_groups along with our template   :- 

define hostescalation{
        use                     1stnotification
#       host_name               sandeep.domainname.com
        hostgroup_name          all_hosts
#       contact_groups          admins
        contacts                sandeep
        }