Selasa, 18 Juni 2013

KONFIGURASI DAN INSTALASI NAGIOS PADA UBUNTU 12.04

1. PENGERTIAN NAGIOS

Apa itu nagios?

Nagios merupakan sebuah sistem dan aplikasi monitoring jaringan yang diciptkan oleh Ethan Galstad (http://nagios.org). Nagios mengawasi host-host dan servis yang telah ditetapkan, memberi peringatan jika keadaan memburuk serta memberi tahu kapan keadaan tersebut membaik. Nagios ini bersifat modular, mudah digunakan dan memiliki skalabilitas tinggi. Modul atau plugin pada Nagios dapat disesuaikan dengan kebutuhan pengguna.

Beberapa fitur yang tersedia pada Nagios diantaranya ialah : 
-Monitoring service-service pada jaringan (SMTP, POP3, HTTP, PING dan sebagainya).
-Monitoring sistem host (Processor load, Disk usage, dan sebagainya).
-Web-based interface
-Desain plugin yang sederhana.
-Jika terjadi masalah, Nagios dapat menghubungi user lewat email dan sms.


 2. TUTORIAL INSTALASI NAGIOS3 PADA UBUNTU 12.04

 Untuk menginstall nagios3 pada ubuntu ini, diperlukan beberapa langkah seperti berikut :)
1. Buka terminal ubuntu
    $sudo su
    $masukan password

2. Cek terlebih dahulu, apakah apache2 dan nagios3 telah di instal atau belum
    dpkg -l |grep apache2
    dpkg -l |grep nagios3
    Jika ubuntu telah terinstal apache2 dan nagios3, maka anda dapat melanjutkan langkah berikutnya.

3. Namun, jika anda ingin menginstal apache2 dan nagios3 yang baru, maka anda harus menghapus yang telah terinstal tadi dengan cara :
   #apt-get remove apache2
   #apt-get remove nagios3

4. Jika telah terhapus apache2 dan nagios3 tcb, maka anda harus menginstal kembali.
   #apt-get install apache2
   #apt-get install nagios3

5. Kemudian konfigurasi selanjutnya ialah menambahkan host tetangga dengan perintah :
   nano /etc/nagios3/conf.d/localhost_nagios3.cfg

Dari perintah pada langkah kelima, maka kita harus :
-Menambahkan difine host tetangga dibawah define host local atau bisa juga dengan cara mengcopy file dari localhost_nagios2.cfg dengan nama lain asalkan nama pada local host tetap ada supaya fungsi tidak hilang.
-Edit host name atau address sesuai dengan nama dan IP tetangga.
-Tambahkan define service untuk host tetangga untuk masing-masing service description.

Nah, perintah yang dicopy dan diedit tadi tampilannya akan muncul seperti ini :

# 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               Agung
address          172.16.30.6
}
define host{
use                 generic-host;
host_name     Jartel2
alias               lili
address          172.16.30.3
}
define host{
use                 generic-host;
host_name     Jartel3
alias              retna
address          172.16.30.19
}
# 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 selanjutnya ialah :
    nano /etc/nagios3/conf.d/hostgroup_nagios2.cfg
    Dari perintah diatas, maka :
   -Tambahkan define hostgroup untuk PING
   -Ubah members sesuai dengan host tetangga yang ingin di monitoring.
    Beginilah tampilannya :




7. Kemudian konfigurasi selanjutnya ialah :
    nano /etc/nagios3/conf.d/service_nagios2.cfg

   Dari perintah diatas, maka :
   -Tambahkan define service untuk ping
   -Pada hostgroup_name isi dengan ping-servers, service description ialah PING
    dan pada check_command isi dengan check_ping

    Dan berikut tampilannya :

8. Setelah langkah-langkah diatas selesai dikonfigurasi, maka restart nagios3 dengan cara :
  /etc/init.d/nagios3 restart

9. Lalu buat password baru dengan perintah :
    htpasswd-c /etc/nagios3/htpaswd. nagiosadmin

10.Jika telah selesai, maka buka browser Ubuntu dan klik URL dengan alamat perintah :
     http:/localhost/nagios3
     Jika anda telah berhasil masuk ke alamat tersebut, maka masukan name & passwd tadi.
     Berikut tampilan jika anda telah berhasil memasukan name dan pswd nya

11.  Jika anda ingin melihat tampilan host tetangga, klik MAP di sebelah kiri layar browser.
      Nanti dapat dilihat apakah tetangga masih DOWN atau UP.
      Berikut ini hasil dari monitoring host tetangga yang telah saya buat, yaitu:
      dari host Agung, lili dan retna.




 12. Jika anda ingin melihat bagian lain kecuali MAP, anda dapat melihat fitur menu yang ada di bagian kiri atas dari web browser nagios ini. Beberapa diantara nya ialah :

service overview for all Host Groups

 Service Status Details for all hosts


 Host Status Details For All Host Groups



Nah, itulah ilmu yang saya dapatkan saat mengkonfigurasi Nagios3 pada ubuntu 12.04 :)




http://daliman.wordpress.com/tag/nagios/
http://andygiyai77.blogspot.com/
http://www.pj-syuhada.blogspot.com/2012/08/tutorial-konfigurasi-nagios-pada-ubuntu.html
http://meytamorfosis.blogspot.com/2012/08/konfigurasi-nagios-di-ubuntu-1110.html
http://wodedailies.blogspot.com/2013/06/instalasi-dan-konfigurasi-nagios3-pada.html

0 komentar:

Posting Komentar