Rabu, 10 Desember 2014

INSTALASI DAN KONFIGURASI NAGIOS3

INSTALASI DAN KONFIGURASI NAGIOS3




PENGERTIAN NAGIOS
   
 Nagios merupakan suatu host dan service yang di design untuk memonitoring keadaan suatu jaringan atau bisa memonitoring masalah-masalah pada suatu host tertentu yang ingin kita monitoring. Nagios mengawasi host-host dan servis yang telah ditetapkan, memberi peringatan jika keadaan memburuk, dan memberi tahu kapan keadaan tersebut membaik.

Keistimewaan Nagios
  • Memonitoring servis jaringan (SMTP, POP3, HTTP, NNTP, PING, dsb)
  • Servis cek yang paralel
  • Mendukung implementasi monitoring dengan host yang berle
  • Web interface yang fakultatip untuk melihat status network, urutan masalah dan pemberitahuan, log file, dsb)
  • Memonitoring sumber- sumber host (load prosesor, penggunaan disk, dsb)
  • Desain plugin yang serderhana, yang mengijinkan pengguna untuk lebih mudah menggunakan pemeriksaan terhadap servisnya
  • Kemampuan untuk mendefinisikan kejadian yang ditangani selama servis / host berlangsung untuk mempermudah pemecahan masalah Perputaran file log yang otomatis.


LANGKAH INSTALASI DAN KONFIGURASI NAGIOS3
1.  Buka terminal Ubuntu 12.04, lalu masukkan perintah berikut :
$ sudo su
$ masukkan password

2. Setelah masuk ke root, cek APACHE2 & NAGIOS3 dengan perintah berikut :
$ dpkg –l |grep apache2 
$ dpkg –l |grep nagios3  

3. Apabila APACHE2 dan NAGIOS3 telah di install, sebaiknya kita me-remove nya terlebih dahulu untuk memastikan tidak ada konfigurasi yang telah dilakukan sebelumnya dengan perintah :
$ apt-get remove apache2
$ apt-get remove nagios3


4.  install kembali apache2 dan nagios3 dengan perintah :
$ apt-get install apache2
$ apt-get install nagios3

5.            Untuk konfigurasi localhost, ketik :
nano /etc/nagios3/conf.d/localhost_nagios.cfg
  •  Tambahkan define host  tetangga dibawah define host local atau bisa juga dengan cara mengcopy file localhost_nagios2.cfg dengan nama lain asalkan nama pada local host tetap ada. Hal ini agar fungsi tidak hilang.
  •    Edit host name atau address sesuai dengan nama dan IP tetangga.
  •   Tambahkan define service host tetangga untuk masing-masing service description.


Contohnya seperti berikut:

# A simple configuration file for monitoring the local host
# This can serve as an example for configuring other servers;
# Custom services specific to this host are added here, but services
# defined in nagios2-common_services.cfg may also apply.

define host{
use                 generic-host;
host_name  Jartel1
alias              RIFAT
address         172.16.30.38
}
define host{
use                 generic-host;
host_name Jartel2
alias            SRI
address         172.16.30.14
}
define host{
use                 generic-host;
host_name  Jartel3
alias             NIA
address         172.16.30.34
}

# Define a service to check the disk space of the root partition
# on the local machine.  Warning if < 20% free, critical if
# < 10% free space on partition.

define service{
use                                 generic-service;
host_name                  JARTEL1
service_description    Disk Space
check_command       check_all_disks!20%!10%
}
define service{
use                                 generic-service;
host_name                 JARTEL2
service_description    Disk Space
check_command       check_all_disks!20%!10%
}

define service{
use                                 generic-service;
host-name                   JARTEL3
service_description    Disk Space
check_command       check_all_disks!20%!10%
}

# Define a service to check the number of currently logged in
# users on the local machine.  Warning if > 20 users, critical
# if > 50 users.

define service{
use                                 generic-service;
host_name                  JARTEL1
service_description    Current Users
check_command       check_users!20!50
}
define service{
use                                 generic-service
host_name                  JARTEL2
service_description    Current Users
check_command       check_users!20!50
}
define service{
use                                 generic-service
host_name                  JARTEL3
service_description    Current Users
check_command       check_users!20!50
}

# Define a service to check the number of currently running procs
# on the local machine. Warning if > 250 processes, critical if
# > 400 processes.

define service{
use                                 generic-service;
host_name                  JARTEL1
service_description    Total Processes
check_command       check_procs!250!400
}
define service{
use                                 generic-service;
host_name                 JARTEL2
service_description    Total Processes
check_command       check_procs!250!400
}
define service{
use                                 generic-service;
host_name                 JARTEL3
service_description    Total Processes
check_command       check_procs!250!400
}

# Define a service to check the load on the local machine.

Define service{
use                                 generic_service;
host_name                  JARTEL1
service_description    Current Load
check_command       check_load!5.0!4.0!3.0!10.0!6.0!4.0
}
Define service{
use                                 generic_service;
host_name                 JARTEL2
service_description    Current Load
check_command       check_load!5.0!4.0!3.0!10.0!6.0!4.0
}
Define service{
use                                 generic_service;
host_name                 JARTEL3
service_description    Current Load
check_command       check_load!5.0!4.0!3.0!10.0!6.0!4.0

}

6.        konfigurasi host group,ketik :
gedit /etc/nagios3/conf.d/hostgroup_nagios2.cfg
·        Tambahkan define hostgroup nya untuk “PING”
·        Ubah member sesuai dengan host tetangga yang ingin di monitoring atau yang sesuai dengan yang anda buat pada localhost sebelumnya.

Contohnya seperti berikut :

# Some generic hostgroup definitions

# A simple wildcard hostgroup
define hostgroup {
        hostgroup_name  all
                alias           All Servers
                members         jartel1,jartel2,jartel3
        }

# A list of your Debian GNU/Linux servers
define hostgroup {
        hostgroup_name  debian-servers
                alias           Debian GNU/Linux Servers
                members         jartel1,jartel2,jartel3
        }

# A list of your web servers
define hostgroup {
        hostgroup_name  http-servers
 alias           HTTP servers
                members         jartel1,jartel2,jartel3
        }

# A list of your ssh-accessible servers
define hostgroup {
        hostgroup_name  ssh-servers
                alias           SSH servers
                members         jartel1,jartel2,jartel3
        }
# A list of your ping-accessible servers
define hostgroup {
        hostgroup_name ping-servers
                alias           PING servers
                members         jartel1,jartel2,jartel3
}




7.        konfigurasi service, ketikkan :
gedit /etc/nagios3/conf.d/services_nagios2.cfg
·         Tambahkan define services nya untuk PING
·         Pada hostgroup_name isi menjadi ping-servers, service_description isi menjadi PING dan check_command isi dengan check_ping
Contohnya seperti berikut :

#check that web services are running
define service {
        hostgroup_name                  http-servers
        service_description             HTTP
        check_command                   check_http
        use                             generic-service
        notification_interval           0 ; set > 0 if you want to be renotified
}

# check that ssh services are running
define service {
        hostgroup_name                  ssh-servers
        service_description             SSH
        check_command                   check_ssh
        use                             generic-service
        notification_interval           0 ; set > 0 if you want to be renotified
}
# check that ping services are running
define service {
        hostgroup_name                  ping-servers
        service_description             PING
        check_command                   check_ping
        use                             generic-service
        notification_interval           0 ; set > 0 if you want to be renotifi$
}


8.        selanjutnya lakukan restart Nagios dengan mengetik :
/etc/init.d/nagios3 restart
  
9.        buat password baru dengan perintah :
htpasswd –c /etc/nagios3/htpaswd.users nagiosadmin

10.    kemudian buka browser, ketik URL berikut :
http:/localhost/nagios3
Maka akan muncul tampilan berikut :




11.    Masukkan user name dan password yang baru saja anda buat.
Setelah berhasil login, maka akan muncul tampilan berikut :




12.  Klik MAP pada sebelah kiri layar browser, maka akan terlihat tampilan host tetangga yang telah di buat tadi :




13.  Setelah itu, anda dapat melihat beberapa jenis monitoring dari host tetangga. Apabila masih terdapat DOWN, tunggu beberapa saat sampai tampilan host tetangga anda akan menjadi UP. 
·         Host Status Detail for All Groups



·         Service Status for All Groups





MAKASIIH!!!



Tidak ada komentar:

Posting Komentar