KONFIGURASI
NAGIOS 3 PADA UBUNTU 11.10
contoh simple nya saja, di sini kita dapat melihat PC mana yang sedang ON dan OFF
Read more...
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
Berikut adalah langkah
langkah untuk menginstall Nagios 3 pada komputer atau laptop user,, perlu untuk
diketahui " saya melakukan monitoring jaringan menggunakan Nagios 3 pada
Laboraturium 234 kampus Politeknik Caltex Riau.
- Pastikan apache pada PC anda
sudah terinstal, jika belum bisa diinstall dengan script sebagai berikut : apt-get
install apache2
- Akan lebih baik jika kita
melakukan Update (misal : pada repo PCR), dengan script sebagai berikut : apt-get update
- kemudian install Nagios 3
dengan menggunakan script:
apt get install
Nagios3
Setelah
proses install Nagios 3 selesai maka akan tampil kotak dialog seperti dibawah
ini,,
- Jika langkah telah selesai,
maka bisa lansung mengaksesnya pada browses yang ada (mozilla, google
crome) ke http://localhost/nagios3 , maka
akan muncul seperti dibawah ini.
- apabila anda tidak login menggunakan password yang telah anda buat tadi, maka ketikkan scriptberikut ini pada terminal : sudo htpasswd -c /etc/nagios3/htpasswd.users nagiosadmin
- Ketikkan kembali perintah pada browser ke http://localhost/nagios3. Masukkan user name
dan password
baru anda.
- Setelah berkasil login maka tampilan nya akan seperti ini.
- kembali ke terminal dan Ketikkan perintah: nano/etc/nagios3/conf.d/localhost_nagios2.cfg
jika anda ingin memonitoring 4 PC, maka anda cukup
mengcopy mulai dari define host hingga tanda } kemudian paste kan tepat dibawah
nya, hingga jumlah define host ada 4 buah. dan yang akan anda edit adalah mulai
dari :
- host_name : dari localhost diubah menjadi jartel1
- alias : dari localhost menjadi nama pemilik PC misal, ary
- address : dari 127.0.0.1 diubah menjadi IP add PC si ary tadi
- lakukan perintah 1-3 untuk ketiga define host lainnya.
CONTOH :
#
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 ary
address 172.16.30.2
}
define host{
use generic-host ; Name of host template$
host_name jartel2
alias noval
address 172.16.30.3
}
define host{
use generic-host ; Name of host template$
host_name jartel3
alias amin
address 172.16.30.5
}
define host{
use generic-host ; Name of host template$
host_name jartel4
alias haye
address 172.16.30.8
}
# 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 ary
address 172.16.30.2
}
define host{
use generic-host ; Name of host template$
host_name jartel2
alias noval
address 172.16.30.3
}
define host{
use generic-host ; Name of host template$
host_name jartel3
alias amin
address 172.16.30.5
}
define host{
use generic-host ; Name of host template$
host_name jartel4
alias haye
address 172.16.30.8
}
# 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$
}
- Lalu ketikkan perintah : 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).
CONTOH :
#
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
}
- ketikkan perintah : nano /etc/nagios3/conf.d/services_nagios2.cfg
- tambahkan define service untuk ping
- pada hostgroup-name dan service description adalah ping, check_command adalah
check_ping.
CONTOH :
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
}
- Lakukan restart, dengan mengetikka perintah : /etc/init.d/nagios3 restart
jika tampil [OK] maka anda sudah bisa melakukan
monitoring
·
kembali
ke browser http://localhost/nagios3 ,, pilih
bagian MAP maka akan terlihat PC yang
akan
dimontoring.
dimontoring.
- apabila kita meng-klik bagian hosts maka tampilan akan sebagai berikut :
contoh simple nya saja, di sini kita dapat melihat PC mana yang sedang ON dan OFF
- apabila kita meng-klik bagian service maka tampilan akan sebagai berikut :
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.