A. NAGIOS3
Nagios adalah
tool network monitoring system open source yang terbaik.Nagios bersifat modular,
mudah digunakan, dan memiliki skalabilitas tinggi. Modul atau plugin pada
nagios sangat simple.
Kita pun dapat membuatnya guna melengkapi sistem checking pada Nagios sesuai dengan kebutuhan kita.Nagios awalnya didesain untuk berjalan pada sistem operasi Linux, namun dapat juga berjalan dengan baik hampir disemua sistem operasi unix like.
Kita pun dapat membuatnya guna melengkapi sistem checking pada Nagios sesuai dengan kebutuhan kita.Nagios awalnya didesain untuk berjalan pada sistem operasi Linux, namun dapat juga berjalan dengan baik hampir disemua sistem operasi unix like.
B. FITUR NAGIOS
→ Memonitoring network
services (SMTP, POP3, HTTP, NNTP, PING, etc.)
→ Memonitoring
sumber host (load processor, pemakaian disk, etc.)
→ Design
plugin yang simple sehingga memudahkan user untuk pemeriksaan terhadap servicenya.
→ Service
check yang paralel.
→ Kemampuan
menentukan hirarki jaringan host menggunakan “parent” hosts, memberikan deteksi
dan perbedaan antara host yang down dan yang tidak terjangkau.
→ Pemberitahuan
ketika terjadi masalah pada service atau host dan mendapatkan pemecahannya (via
email, pager, atau metode yang ditetapkan pengguna).
→ Kemampuan
untuk menentukan event handlers yang dijalankan selama
perbaikan.
→ Perputaran
file log yang otomatis.
→ Mendukung
implementasi monitoring dengan host yang berlebih.
→ Pilihan web
interface untuk melihat status jaringan terkini, notification dan
problem history, log file, dll.
C. TUTORIAL INSTALASI DAN KONFIGURASI NAGIOS3
1. Buka terminal Ubuntu 12.04, lalu masukkan
perintah berikut :
→ sudo su
→ masukkan password ubuntu
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. Pada saat
dijalankan sudo akan meminta password user yang menjalankan sudo tersebut,
tetapi bisa juga dibuat untuk meminta password root atau tanpa password sama
sekali. Secara default password yang dimasukkan tadi akan disimpan selama 15
menit agar dalam waktu 15 menit kedepan anda tidak perlu lagi memasukkan
password jika menggunakan sudo.
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. Setelah
masuk ke root, cek APACHE2 & NAGIOS3 dengan
perintah berikut :
→ dpkg –l |grep apache2 à cek
APACHE2
→ dpkg –l |grep nagios3 à cek
NAGIOS3
Perintah dpkg merupakan salah satu package manager yang dapat kita gunakan
untuk melakukan management (install/uninstall). Perintah dpkg banyak macamnya,
salah satunya adalah dpkg -l yang merupakan perintah untuk melihat daftar
package yang telah terinstall beserta versi package yang telah terinstall dan
deskripsinya.
Sedangkan |grep digunakan untuk
mencari file-file yang mengandung teks dengan kriteria yang telah Anda
tentukan. Paket – paket tersebut dibutuhkan untuk dapat menginstall Nagios
dengan sempurna dan dapat menghasilkan grafik yang diinginkan.
3. Apabila telah di install APACHE2 dan NAGIOS3
nya, ada baiknya kita me-remove nya terlebih dahulu untuk memastikan tidak ada
konfigurasi yang telah dilakukan sebelumnya :
→ apt-get remove apache2
→ apt-get remove nagios3
4. Apabila keempat paket tersebut belum
ter-install, maka install terlebih dahulu dengan memasukkan perintah seperti
dibawah ini:
→ apt-get install apache2
Perintah apt-get install ini merupakan perintah untuk meng-install aplikasi.
Seperti contoh diatas berarti perintah tersebut untuk meng-install aplikasi –
aplikasi tersebut.
5. Selanjutnya, ketikkan perintah seperti dibawah
ini :
→ nano
/etc/nagios3/conf.d/localhost_nagios2.cfg
Ini merupakan
perintah untuk konfigurasi pada local hostnya. Pada Konfigurasi ini, saya akan
memonitoring 4 jaringan tetangga, yaitu alvid(jartel1) ,ilham(jartel2) ,aufar(jartel3)
dan hamdani (jartel4).
Konfigurasi pada local host ini dapat dilakukan seperti di bawah ini :
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 alvid
address 172.16.30.45
}
define host{
use generic-host ; Name of host template$
host_name jartel2
alias ilham
address 172.16.30.52
}
define host{
use generic-host ; Name of host template$
host_name jartel3
alias aufar
address 172.16.30.39
}
define host{
use generic-host ; Name of host template$
host_name jartel4
alias hamdani
address 172.16.30.28
}
# 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$
}
# 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 alvid
address 172.16.30.45
}
define host{
use generic-host ; Name of host template$
host_name jartel2
alias ilham
address 172.16.30.52
}
define host{
use generic-host ; Name of host template$
host_name jartel3
alias aufar
address 172.16.30.39
}
define host{
use generic-host ; Name of host template$
host_name jartel4
alias hamdani
address 172.16.30.28
}
# 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$
}
tambahan :
ü host_name : dari localhost diubah
menjadi jartel
ü
alias : dari
localhost menjadi nama pemilik PC misalnya, alvid
ü
address :
dari 127.0.0.1 diubah menjadi IP add PC si alvid tadi
ü lakukan perintah 1-3 untuk keempat define host
lainnya.
6. Kemudian
lakukan konfigurasi pada host groups nya, dengan cara seperti dibawah ini :
#nano /etc/nagios3/conf.d/hostgroups_nagios2.cfg
a. tambahkan
define hostgroup untuk ping
b. ubah members sesuai dengan nama host-host tetangga (yang kita monitoring).
b. ubah members sesuai dengan nama host-host tetangga (yang kita monitoring).
Konfigurasi seperti
dibawah 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
}
# 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 service nya, dengan cara seperti di bawah ini :
#nano /etc/nagios3/conf.d/services_nagios2.cfg
#nano /etc/nagios3/conf.d/services_nagios2.cfg
a. tambahkan define service untuk ping
b. pada hostgroup-name dan service
description adalah ping, check_command adalah
check_ping.
Konfigurasinya
seperti ini :
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
}
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
}
8. Setelah
konfigurasi pada local host, host groups, dan services selesai, lakukan
restart.
#
/etc/init.d/nagios3 restart
9. Untuk men-setting password baru sesuai dengan yang anda inginkan, ketikkan seperti 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 :
11. Setelah
login, anda akan masuk ke halaman Nagios3 seperti tampilan dibawah ini :
12. Klik MAP pada bagian kanan halaman Nagios, maka akan muncul tampilan
host tetangga yang telah anda konfigurasi
tadi. Tampilannya seperti dibawah ini :
Tambahan
Status Map merupakan fitur yang dapat digunakan untuk mengetahui
jaringan local yang akan dimonitoring. Selain itu, juga dapat dilihat jaringan
mana saja yang sudah dalam keadaan DOWN, PENDING, dan UP. Seperti terlihat pada
gambar, jaringan yang berwarna Hijau merupakan jaringan yang sudah UP.
Sedangkan untuk jaringan yang berwarna Merah adalah jaringan yang masih PENDING
atau DOWN. Jaringan yang masih PENDING bisa saja terjadi karena PC yang baru
dihidupkan. Jaringan yang DOWN terjadi karena PC pada jaringan tersebut dalam
keadaan shut down (mati), sehingga ketika dilakuka monitoring jaringan tersebut
dalam keadaan Down.
13.
apabila kita meng-klik bagian host maka tampilan
seperti dibawah ini :
Tambahan
Monitoring telah dapat dilakukan dengan menggunakan nagios. Jika masih
ada jaringan yang Down, maka tunggu beberapa saat untuk jaringan tersebut Up.
Monitoring dapat dilakukan dalam beberapa tampilan. Disini saya
memonitoring 4 jaringan tetangga, yaitu alvid(jartel1),ilham(jartel2) ,aufar(jartel3)
dan hamdani (jartel4).
14.
apabila kita meng-klik bagian service maka
tampilan seperti dibawah ini :
Tambahan
Service adalah atribut dari host yang ditetapkan oleh host pula, seperti DNS Record, dll.
Pada konfigurasi yang saya lakukan ada tujuh services yang digunakan, yaitu
Current Load, Current Users, Disk Space, HTTP, PING, SSH dan Total Processes.
Ketujuh service ini lah yang akan dimonitoring oleh host dalam suatu jaringan.
Pada gambar tersebut terlihat status setiap service memiliki kondisi yang berbeda-beda,
yaitu Unknown ,Critical ,pending dan ok.
Demikian lah tutorial instalasi nagios3 pada ubuntu 12.04 ,semoga bermanfaat terima kasih !!!!