Nagios
merupakan sebuah sistem dan aplikasi monitoring jaringan yang diciptakan oleh
Ethan Galstad. 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,Oracle, PING, dsb).
·
Desain plugin yang serderhana, yang
mengijinkan pengguna untuk lebih mudah menggunakan pemeriksaan terhadap
servisnya.
·
Servis cek yang paralel.
·
Pemberitahuan ketika terjadi masalah
pada servis atau host dan mendapatkan pemecahannya ( lewat email, atau metode
user-defined).
·
Perputaran file log yang otomatis.
·
Web interface yang informatif untuk
melihat status network, urutan masalah dan pemberitahuan, log file, dsb).
Konfigurasi
Nagios
1. Masuk ke terminal Ubuntu dan ketik :
# sudo su
2. Masukkan password ubuntu
3. Lakukan pengecekan untuk setiap paket
yang dibutuhkan dengan cara seperti di bawah ini:
# dpkg -l |grep apache2 (mengecek
paket apache2)
# dpkg -l |grep nagios3 (mengecek
paket nagios3)
4. Jika sudah terinstall, maka lakukan
remove terlebih dahulu untuk install ulang paket. Hal ini dilakukan
untuk memastikan
bahwa paket yang telah diinstall lengkap dengan menginstall ulang paketnya
sendiri. Remove dapat dilakukan dengan cara :
# apt-get remove apache2 (meremove
paket apache2)
# apt-get remove nagios3 (meremove
paket nagios3)
5. Install Nagios3 pada Ubuntu dengan
cara:
# apt-get install nagios3
6. Setelah itu lakukan konfigurasi
selanjutnya dengan cara:
# nano /etc/nagios3/conf.d/localhost_nagios3.cfg
Ini merupakan perintah untuk konfigurasi pada local hostnya. Pada
Konfigurasi ini, saya akan
memonitoring 3 jaringan tetangga, yaitu ulul
(jartel2), valina (jartel3), dan desi (jartel4).
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 jartel2
alias ulul
address 172.16.30.17
}
define host{
use generic-host ; Name of host
template$
host_name jartel3
alias valina
address 172.16.30.48
}
define host{
use generic-host ; Name of host
template$
host_name jartel4
alias desi
address 172.16.30.32
}
# 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 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 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 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 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 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 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.$
}
7. Kemudian lakukan konfigurasi pada
host groupsnya, dengan cara :
# nano /etc/nagios3/conf.d/hostgroups_nagios2.cfg
Konfigurasinya
:
#
Some generic hostgroup definitions
# A simple wildcard hostgroup
define hostgroup {
hostgroup_name all
alias All Servers
members jartel2,jartel3,jartel4
}
# A list of your Debian GNU/Linux
servers
define hostgroup {
hostgroup_name debian-servers
alias Debian GNU/Linux Servers
members jartel2,jartel3,jartel4
}
# A list of your web servers
define hostgroup {
hostgroup_name http-servers
alias
HTTP servers
members jartel2,jartel3,jartel4
}
# A list of your ssh-accessible servers
define hostgroup {
hostgroup_name ssh-servers
alias SSH servers
members jartel2,jartel3,jartel4
}
# A list of your ping-accessible servers
define hostgroup {
hostgroup_name ping-servers
alias PING servers
members jartel2,jartel3,jartel4
}
8. Setelah itu lakukan konfigurasi pada
servicenya, dengan cara seperti di bawah ini :
# nano /etc/nagios3/conf.d/services_nagios2.cfg
Konfigurasinya :
#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$
}
9. Setelah konfigurasi pada local host,
host groups, dan services selesai, lakukan restart.
# /etc/init.d/nagios3 restart
10. Untuk mengatur password baru sesuai
dengan yang diinginkan, ketik :
# sudo htpasswd -c /etc/nagios3/htpasswd.users nagiosadmin
11. Buka web browser, kemudian ketik
link http:/localhost/nagios3 , maka akan muncul tampilan seperti di
bawah ini :
Masukkan password dan username.
12. Setelah berhasil login, maka akan muncul
tampilan berikut :
13.
Klik MAP pada sebelah kiri layar browser, maka akan terlihat tampilan host
tetangga
yang
telah dibuat :
14. Setelah itu, anda bisa melihat apakah jaringan tetangga down atau up.
Jika down, maka daerah pada gambar akan berwarna pink. Sebaiknya tunggu
sebentar sebelum jaringan tetangga menjadi up. Berikut ini hasil dari monitoring
host tetangga yang telah dibuat, yaitu dari host Ulul,Valina dan Desi.
Pada gambar
diatas dapat dilihat bahwa jaringan pada hari senin tanggal 26 May 2014 jam 3
sore lumayan banyak traffik atau user yang menggunakan akses internet. Peran monitoring
jaringan menggunakan Nagios sangatlah penting dimana Nagios dapat digunakan untuk
memonitoring atau melihat sistem jaringan mati, jaringan dalam keadaan sibuk
atau dalam keadaan normal. Dengan Nagios maka dapat dengan mudah mengetahui
atau memantau kondisi traffic jaringan.