Rabu, 10 Desember 2014

INSTALASI NAGIOS 3 PADA UBUNTU 12.04 LTS


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. 
 
KONFIGURASI NAGIOS 3
 
           1.Masuk ke terminal Ubuntu, lalu ketikan perintah berikut:
        $ sudo su
       Kemudian masukkan password yg telah di tentukan

  
                    2. Lakukan pengecekan untuk setiap paket yang dibutuhkan sebelum menginstal cacti 
           dengan perintah berikut:
           dpkg -l |grep apache2 >> untuk mengecek paket apache2
      dpkg -l |grep nagios3 >> untuk mengecek paket nagios3

3. Jika sudah terinstall, maka lakukan remove terlebih dahulu untuk install ulang paket dengan perintah berikut:
    #apt-get remove apache2 >> untuk meremove paket apache2
    #apt-get remove nagios3 >> untuk meremove paket nagios3

4. Install kembali Nagios 3 pada Ubuntu dengan perintah:
     #apt-get install nagios3

5. Setelah itu lakukan konfigurasi selanjutnya dengan perintah berikut:
    
    #nano /etc/nagios3/conf.d/localhost_nagios3.cfg

Konfigurasi pada local host ini dapat dilakukan seperti di bawah 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 ; Name of host template$
host_name jartel1
alias ryan
address 172.16.30.16
}
define host{
use generic-host ; Name of host template$
host_name jartel2
alias nia
address 172.16.30.34
}
define host{
use generic-host ; Name of host template$
host_name jartel3
alias fajri
address 172.16.30.32
define host{
use generic-host ; Name of host template$
host_name jartel4
alias fajar
address 172.16.30.2

# 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 serv$
        host_name                       jartel3
        service_description             Disk Space
        check_command                   check_all_disks!20%!10%
        }
define service{
use generic-service ; Name of serv$
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 serv$
host_name jartel2
service_description Current Users
check_command check_users!20!50
}
define service{
use generic-service ; Name of serv$
host_name jartel3
service_description Current Users
check_command check_users!20!50
}
define service{
use generic-service ; Name of serv$
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 serv$
host_name jartel2
service_description Total Process
check_command check_procs!250!400
}
define service{
use generic-service ; Name of serv$
host_name jartel3
service_description Total Process
check_command check_procs!250!400
}
define service{
use generic-service ; Name of serv$
host_name jartel4
service_description Total Process
check_command check_procs!250!400


# Define a service to check the load on the local machine.
define service{
use generic-service ; Name of servi$
host_name jartel1
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 serv$
host_name jartel2
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.$
}

define service{
use generic-service ; Name of serv$
host_name jartel3
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.$
define service{
use generic-service ; Name of serv$
host_name jartel4
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.$
}

6. Kemudian lakukan konfigurasi pada host groups nya, dengan perintah berikut :
    #nano /etc/nagios3/conf.d/hostgroups_nagios2.cfg 
   
   lalu konfigurasi seperti ini:
# 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
}

7. Setelah itu lakukan konfigurasi pada servicenya, dengan cara seperti di bawah ini :
   #nano /etc/nagios3/conf.d/services_nagios2.cfg

Konfigurasinya seperti ini :
 #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. Setelah konfigurasi pada local host, host groups, dan services selesai, lakukan restart dengan perintah berikut:
   # /etc/init.d/nagios3 restart 

9. Untuk mensetting password baru sesuai dengan yang anda inginkan, ketikkan seperti perintah di bawah ini :
  #sudo htpasswd -c /etc/nagios3/htpasswd.users nagiosadmin

10. Buka browser, kemudian buka link ini http:/localhost/nagios3 , maka akan muncul tampilan seperti di bawah ini :

 
Masukkan password yang telah anda buat, kemudian masukkan usernamenya “nagiosadmin”.
11. Setelah login, maka tampilan awal Nagios3 seperti ini :   
 

12. Klik MAP pada bagian kanan halaman Nagios, maka akan muncul tampilan host tetangga yang telah  dikonfigurasi tadi. Tampilannya seperti ini :




Di sini kita dapat melihat PC mana yang sedang ON dan OF

apabila kita meng-klik bagian service maka tampilan akan sebagai berikut :

 

Berikut tampilan untuk melihat jaringan yang pada awalnya down secara terperinci: 
 
Setelah ditunggu beberapa saat semua jaringan pun bestatus UP. Berarti semua jaringan telah aktif, seperti tampilan berikut ini.

 Berikut tampilan sebuah jaringan untuk melihat lebih detail keterangan jaringan:
 
Demikianlah cara menginstalasi nagios 3 pada ubuntu 12.04, apabila ada kesalahan dalam penulisan saya minta maaf. Terimakasih

Tidak ada komentar:

Posting Komentar