Nagios adalah Tools network monitoring system opensource yang mudah digunakan. Nagios awalnya didesign untuk berjalan pada sistem operasi Linux, namun dapat juga berjalan dengan baik hampir disemua sistem operasi unix.
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 berlebih
ü 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 di terminal 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.
2. Entri password ubuntu anda
3. Melakukan 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 :
#apt-get remove nagios3
4. Kemudian instal kembali nagios 3
#apt-get install nagios3
5. Lalu melakukan konfigurasi dengan perintah
#nano /etc/nagios3/conf.d/localhost_2.cfg
Isi dari konfigurasi ini awalnya hanya 1 member. Jika ingin menambah member atau yang akan dimonitoring jaringannya yaitu dengan cara meng-copy file localhost_2.cfg. Pada percobaan ini saya melakukan pemonitoringan jaringan 2 IP dalam 1 LAN, yaitu mamad (jartel2), edo wahyu anggara (edo). hostname dan inisial tidal terlalu berpengaruh nantinya, yang penting adalah IP yang akan dimonitoring.
Konfigurasi:
# 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 zilla
alias ocu
address 172.16.30.4
}
define host{
use generic-host ; Name of host template$
host_name faruq
alias dy
address 172.16.30.20
}
# 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 zilla
alias ocu
address 172.16.30.4
}
define host{
use generic-host ; Name of host template$
host_name faruq
alias dy
address 172.16.30.20
}
define host{
use generic-host ; Name of host template$
host_name taufiq
alias hidayat
address 172.16.30.40
}
define host{
use generic-host ; Name of host template$
host_name fitra
alias dajon
address 172.16.30.45
use generic-host ; Name of host template$
host_name taufiq
alias hidayat
address 172.16.30.40
}
define host{
use generic-host ; Name of host template$
host_name fitra
alias dajon
address 172.16.30.45
}
# 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 zilla
service_description Disk Space
check_command check_all_disks!20%!10%
}
define service{
use generic-service ; Name of servi$
host_name faruq
service_description Disk Space
check_command check_all_disks!20%!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 zilla
service_description Disk Space
check_command check_all_disks!20%!10%
}
define service{
use generic-service ; Name of servi$
host_name faruq
service_description Disk Space
check_command check_all_disks!20%!10%
}
define service{
use generic-service ; Name of servi$
host_name taufiq
service_description Disk Space
check_command check_all_disks!20%!10%
}
define service{
use generic-service ; Name of servi$
host_name fitra
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 zilla
service_description Current Users
check_command check_users!20!50
}
define service{
use generic-service ; Name of serv$
host_name faruq
service_description Current Users
check_command check_users!20!50
use generic-service ; Name of servi$
host_name taufiq
service_description Disk Space
check_command check_all_disks!20%!10%
}
define service{
use generic-service ; Name of servi$
host_name fitra
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 zilla
service_description Current Users
check_command check_users!20!50
}
define service{
use generic-service ; Name of serv$
host_name faruq
service_description Current Users
check_command check_users!20!50
define service{
use generic-service ; Name of servi$
host_name taufiq
service_description Current Users
check_command check_users!20!50
}
define service{
use generic-service ; Name of serv$
host_name fitra
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 zilla
service_description Total Processes
check_command check_procs!250!400
}
define service{
use generic-service ; Name of serv$
host_name faruq
service_description Total Process
check_command check_procs!250!400
}
use generic-service ; Name of servi$
host_name taufiq
service_description Current Users
check_command check_users!20!50
}
define service{
use generic-service ; Name of serv$
host_name fitra
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 zilla
service_description Total Processes
check_command check_procs!250!400
}
define service{
use generic-service ; Name of serv$
host_name faruq
service_description Total Process
check_command check_procs!250!400
}
define service{
use generic-service ; Name of servi$
host_name taufiq
service_description Total Processes
check_command check_procs!250!400
}
define service{
use generic-service ; Name of serv$
host_name fitra
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 zilla
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 taufiq
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.$
use generic-service ; Name of servi$
host_name taufiq
service_description Total Processes
check_command check_procs!250!400
}
define service{
use generic-service ; Name of serv$
host_name fitra
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 zilla
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 taufiq
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.$
}
define service{
use generic-service ; Name of servi$
host_name faruq
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 fitra
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.$
use generic-service ; Name of servi$
host_name faruq
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 fitra
service_description Current Load
check_command check_load!5.0!4.0!3.0!10.0!6.$
}
6. Kemudian melakukan konfigurasi hostgrup-nya:
#nano /etc/nagios3/conf.d/hostgroups_nagios2.cfg
Konfigurasi:
# Some generic hostgroup definitions
# A simple wildcard hostgroup
define hostgroup {
hostgroup_name all
alias All Servers
members zilla,faruq,taufiq,fitra
}
# A list of your Debian GNU/Linux servers
define hostgroup {
hostgroup_name debian-servers
alias Debian GNU/Linux Servers
members zilla,faruq,taufiq,fitra
}
# A list of your web servers
define hostgroup {
hostgroup_name http-servers
# A simple wildcard hostgroup
define hostgroup {
hostgroup_name all
alias All Servers
members zilla,faruq,taufiq,fitra
}
# A list of your Debian GNU/Linux servers
define hostgroup {
hostgroup_name debian-servers
alias Debian GNU/Linux Servers
members zilla,faruq,taufiq,fitra
}
# A list of your web servers
define hostgroup {
hostgroup_name http-servers
alias HTTP servers
members zilla,faruq,taufiq,fitra
}
# A list of your ssh-accessible servers
define hostgroup {
hostgroup_name ssh-servers
alias SSH servers
members zilla,faruq,taufiq,fitra
}
# A list of your ping-accessible serversmembers zilla,faruq,taufiq,fitra
}
# A list of your ssh-accessible servers
define hostgroup {
hostgroup_name ssh-servers
alias SSH servers
members zilla,faruq,taufiq,fitra
}
define hostgroup {
hostgroup_name ping-servers
alias PING servers
members zilla,faruq,taufiq,fitra
}
7. Lalu melakukan konfigurasi service nagios-nya:
#nano /etc/nagios3/conf.d/services_nagios2.cfg
Konfigurasi:
#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 renotified
}
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
}
8. Selanjutnya restart nagios 3:
# /etc/init.d/nagios3 restart
http:/localhost/nagios3. Nantinya anda akan dimintai web server dan password. Isi web server= nagiosadmin dan password (yang tadi anda isi ketika penginstalan nagios). Kemudian setelah login muncul seperti gambar dibawah ini:
10. Klik MAP pada bagian kanan halaman Nagios, maka akan muncul tampilan host tetangga yang telah anda konfigurasi tadi. Tampilannya seperti ini :
HOST
Host merupakan pengguna yang diinputkan pada instalasi nagios tersebut :
SERVICES
Services 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.
HOSTGROUPS
Hostgroups merupakan grup untuk beberapa host. Pada Hostgroup ini dapat dilihat juga rincian-rincian status dari host-host yang termasuk ke dalam hostgroup. Berikut ini adalah tampilan dari Service Overview For All Host Groups :
SERVICES GROUPS
NOTE :
- Apabila host host yang akan kita monitoring dalam keadaan mati (down) akan ada 2 kemungkinan status informasi nya pada Host Status :
1. Critical – Host Unreachable
2. PING CRITICAL – Packet loss = 100%
- Apabila host host yang akan kita monitoring dalam keadaan nyala (UP) maka status information nya pada host status akan dinyatakan sebagai : PING OK – packet loss = 0%, dan dengan nilai RTA yang relatif.
Referensi
http://irfanthomi.blogspot.com/2014/06/instalasi-nagios-3-pada-ubuntu-1204_14.html
http://egajarot.blogspot.com/2012/07/konfigurasinagios-3-pada-ubuntu-11.html
Tidak ada komentar:
Posting Komentar