Pages

Senin, 06 Agustus 2012

Konfigurasi Nagios


Konfigurasi Nagios

Nagios adalah tool network monitoring system open source yang terbaik. Nagios bersifat modular, mudah digunakan, dan memiliki skalablitas tinggi. Modul atau plugin pada nagios sangat simple Anda pun dapat membuatnya guna melengkapi system checking pada nagios sesuai dengan kebutuhan Anda. Untuk mendownload source nagios klik url ini http://www.nagios.org/download/ Nagios awalnya didesain untuk berjalan pada sistem operasi Linux, namun dapat juga berjalan dengan baik hampir disemua sistem operasi unix like.

Instalasi Nagios

Sebelum melakukan instalasi pastikan bahwa apache2 telah terinstal dengan benar pada PC anda.

# apt-get install nagios3

untuk mengecek apakah nagios sudah berjalan dengan baik caranya yaitu buka web browser kemudian ketik pada urlnya localhost/nagios3. sebelum masuk ke web dari nagios, terlebih dahulu kita akan diperintahkan untuk memasukkan User Name dan Password.


Setelah kita masukkan User Name dan Password, barulah kita masuk ke web Nagios tersebut.


Gambar diatas merupakan tampilan dari web nagios. dan bila muncul tampilan seperti gambar diatas maka proses instalasi dari nagios berhasil.

Menambah Host Yang Akan Di Monitoring

Menambah host yang akan dimonitoring
  • Duplikat file localhost_nagios2.cfg dengan cara

"cp /etc/nagios3/conf.d/localhost_nagios2.cfg /etc/nagios3/conf.d/thetarget.cfg"

  • Kemudian buka file duplikat tadi dan edit menjadi seperti berikut:

"nano /etc/nagios3/conf.d/heru.cfg"

# 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 to use
host_name jartel1
alias PJ
address 172.16.40.62 <== ip host yang akan dimonitoring
}

define host{
use generic-host ; Name of host template to use
host_name jartel2
alias Ega
address 172.16.30.14 <== ip host yang dimonitoring
}

define host{
use generic-host ; Name of host template to use
host_name jartel3
alias Benny
address 172.16.30.28 <== ip host yang dimonitoring


# 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 service template to use
host_name jartel1
service_description Disk Space
check_command check_all_disks!20%!10%
}

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

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

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

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

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

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

  • tambahkan service ping pada services_nagios2

"nano /etc/nagios3/conf.d/services_nagios2.cfg"

# 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
}

define service {
hostgroup_name ping
service_description ping
check_command check_ping
use generic-service
notification_interval 0 ; set > 0 if you want to be renotified

  • pada bagian hostgroup_nagios2.cfg, tambahkan hostname yang telah kita buat tadi pada bagian member, sehingga menjadi  members jartel1, jartel2, jartel3. Disini penulis menambah 3 member, yaitu jartel1, jartel2, jartel3. Dimana:
Jartel1 (Pj)         : 172.16.40.62
Jartel2 (Ega)       : 172.16.30.14
Jartel3 (Benny)   : 172.16.30.28

  • restart nagois

"/etc/init.d/nagois3 restart"

  • Buka web browser kemudian ketik

"localhost/nagios3", maka host-host yang dimonitoring akan terlihat.







Tidak ada komentar:

Posting Komentar