Selasa, 09 Desember 2014

Pratikum Manajemen Jaringan


INSTALASI DAN KONFIGURASI NAGIOS 3 PADA UBUNTU 12.04

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 dari 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.

Berikut dibawah ini adalah tutorial dari instalasi dan konfigurasi Nagios3 di Ubuntu :  
1.( Masuk ke terminal Ubuntu)
#sudo su
Sudo adalah program yang terdapat di linux yang digunakan untuk menjalankan perintah yang membutuhkan akses dari akun root. Sudo hanya dapat digunakan oleh user yang sudah terdaftar di file /etc/sudoers.Sudo su memberikan kewenangan agar user biasa dapat bertingkah seperti super user (sudo --> super user do) sehingga user biasa pun dapat leluasa "menguasai sistem

2. Masukan password,contoh :(234)
    Masukan password ubuntu pada PC/laptop yang kita gunakan.

3. Jika sudah terinstall, maka lakukan remove terlebih dahulu untuk install ulang paket. Hal ini dilakukan untuk    memastikan bahwa paket yang anda install lengkap dengan menginstall ulang paketnya sendiri. Remove dapat dilakukan dengan cara perintah sebagai berikut :
#apt-get remove nagios3 : untuk meremove paket nagios3

4.Kemudian Install Nagios 3 di ubuntu dengan perintah :
#apt-get install nagios3 lalu masukan administrative user beserta passwordnya, berikut tampilannya dibawah ini :




5. Jika langkah telah selesai dan instalasi berhasil, kita bisa melakukan  pengecekan dengan mengaksesnya pada browser yang ada, (mozila,googlecrome) ke http://localhost/nagios3

6.  Setelah login (akses internet) maka akan tampil,tampilan sebagai berikut :
 7. Selanjutnya kembali ke terminal untuk konfigurasi localhost pada PC yang akan kita monitoring, dengan perintah sebagai berikut :
#nano /etc/nagios3/conf.d/localhost_nagios2.cfg
 akan muncul tampilan seperti dibawah ini :
8. Kami melakukan monitoring pada $ buah PC, maka cukup melakukan copy pada bagian define host{sampai tanda} sebanyak PC yang akan kita menitoring, berikut contoh nya :

CONTOH
# 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 ; Name of host template$
host_name jartel1
alias ica
address 172.16.30.4
}

define host{
use generic-host ; Name of host template$
host_name jartel2
alias mauliza
address 172.16.30.24
}

define host{
use generic-host ; Name of host template$
host_name jartel3
alias jeffy
address 127.16.30.13
}

define host{
use generic-host ; Name of host template$
host_name jartel4
alias laura
address 172.16.30.10
}


# 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 ; Name of servi$
host_name jartel1
service_description Disk Space
check_command check_all_disks!20%!10%
}

define service{
use generic-service ; Name of servi$
host_name jartel2
service_description Disk Space
check_command check_all_disks!20%!10%
}

define service{
use generic-service ; Name of servi$
host_name jartel3
service_description Disk Space
check_command check_all_disks!20%!10%
}

define service{
use generic-service ; Name of servi$
host_name jartel4
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 ; Name of servi$
host_name jartel1
service_description Current Users
check_command check_users!20!50
}

define service{
use generic-service ; Name of servi$
host_name jartel2
service_description Current Users
check_command check_users!20!50
}

define service{
use generic-service ; Name of servi$
host_name jartel3
service_description Current Users
check_command check_users!20!50
}

define service{
use generic-service ; Name of servi$
host_name jartel4
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 ; Name of servi$
host_name jartel1
service_description Total Processes
check_command check_procs!250!400
}

define service{
use generic-service ; Name of servi$
host_name jartel2
service_description Total Processes
check_command check_procs!250!400
}

define service{
use generic-service ; Name of servi$
host_name jartel3
service_description Total Processes
check_command check_procs!250!400
}

define service{
use generic-service ; Name of servi$
host_name jartel4
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 ; Name of service template to use
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 ; Name of servi$
host_name jartel2
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.0$
}

define service{
use generic-service ; Name of servi$
host_name jartel3
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.0$
}

define service{
use generic-service ; Name of servi$
host_name jartel4
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.0$
}
Tampilannya sebagai berikut :

 
9. Kemudian melakukan konfigurasi untuk Hostgroup,dengan perintah :
    #nano /etc/nagios3//conf.d/hosgroups_nagios2.cfg 
  •   Ubah members sesuia dengan nama host tetangga yg kita monitoring contohnya (jartel1,jartel2,jartel3,jartel4)
  • lalu menambahkan define hostgroup ping pada bagian paling bawah
Contoh :
# Some generic hostgroup definitions

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

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

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

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

#A list of your ping-accessible servers
define hostgroup {
hostgroup_name ping-servers
alias ping servers
members jartel1,jartel2,jartel3,jartel4
}
10. Selanjutnya konfigurasi Service dengan perintah :
   #nano /etc/nagios3/conf.d/services_nagios2.cfg
  • Tambahkan service ping pada bagian paling bawah
  • Pada hostgroup-name dan service description adalah ping, check_command adalah check_ping
Contoh :

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 renotified
}
11. Setelah melakukan semua konfigurasi dengan benar sesuai perintah diatas , selanjutnya melakukan restart dengan perintah :
  #/etc/init.d/nagios3 restart
Jika tampilan Ok restart tidak terdapat error , maka monitoring yang kita lakukan berhasil dengan sempurna dan kembali ke monitoring web kita.
12. kembali ke browser dengan perintah :
 http://localhost/nagios3
13. setelah muncul tampilan pada web browser seperti tampilan dibawah ini, klik pada bagian map dan akan muncul jumlah PC yang kita lakukan pe-montoringan.
14.  Tampilan di atas adalah tampilan monitoring yang dilakukan oleh 4 buah PC dengan ip masing-masing pada PC nya.

15. Tampilan akan berubah menjadi "up" setelah kita menunggu beberapa saat

 Tampilan data diatas penunjukan sedang berjalannya monitoring pada ke 4 buah PC, ada 2 buah PC yang berubah menjadi up, dan 2 PC lainnya masih dengan status Pending, itu artinya monitoring sedang berjalan, jika jaringan bagus dia akan berubah menjadi up dan jika pada saat monitoring jaringan dalam keadaan tidak stabil,maka akan bisa berubah menjadi status down.
15. Klik pada menu yang ada tulisan nagios sesuai yang kita inginkan,sebagai contoh berikut tampilannya :
Service status detail for all host
 service overview for all host gorups
 tactical monitor overviwe
 Percobaan selesai, semoga tutorial ini bermanfaat,terimakasih :)

  
    

Tidak ada komentar:

Posting Komentar