Pengaturan

Gambar

Lainnya

Tentang KASKUS

Pusat Bantuan

Hubungi Kami

KASKUS Plus

© 2024 KASKUS, PT Darta Media Indonesia. All rights reserved

aatea2010Avatar border
TS
aatea2010
Monitoring Port TCP dengan Nagios di Ubuntu Server 10.04
Bismillahirohmannirohhim

Bagi agan2 yang mau memonitoring port tcp salah satunya bisa menggunakan nagios, salah satu kelebihan dari nagios bisa memberikan alarm saat ada port yang down. Langsung aja gan cekibrotttttttt emoticon-Big Grin

Langkah2 yang ane berikan memakai Ubuntu Server 10.04, untuk distro yang lain disesuaikan saja gan emoticon-Big Grin

Kalo belum terinstall nagiosnya bisa mengikuti tutorial berikut ini:
http://library.linode.com/server-mon...s-installation

Setelah install dan konfigurasi selesai silakan download plugin check_port.pl di http://exchange.nagios.org/directory...-%28Generic%29

Setelah plugin check_port.pl di download simpan file tersebut di "/usr/local/nagios/libexec" tanpa tanda kutip ya emoticon-Big Grin, setiap ada tanda kutip jangan dibawa ya.....

lalu "chmod a+x /usr/local/nagios/libexec/check_port.pl"

Setelah itu editlah file "commands.cfg" dengan cara sbb "nano /usr/local/nagios/etc/objects/commands.cfg" tambahkan perintah berikut :

# 'check_port' command definition
define command{
command_name check_port
command_line $USER1$/check_port.pl -p $ARG1$ -h $HOSTADDRESS$ -c $ARG2$ -w $ARG3$ -v $ARG4$
}


berikut ini contohnya : "ane mau monitoring port 100 dan 200"

salahsatunya ane bikin di "windows.cfg", berikut langkah2nya :
nano /usr/local/nagios/etc/objects/windows.cfg
tambahkan perintah berikut ini :

# Change the host_name, alias, and address to fit your situation
define host{
use windows-server ; Inherit default values from a template
host_name server-1 ; The name we're giving to this host
alias SERVER-1 ; A longer name associated with the host
address 192.168.1.1 ; IP address of the host
}
define host{
use windows-server ; Inherit default values from a template
host_name server-2 ; The name we're giving to this host
alias SERVER-2 ; A longer name associated with the host
address 192.168.1.2 ; IP address of the host
}


# Define a hostgroup for Windows machines
# All hosts that use the finet template will automatically be a member of this group

define hostgroup{

hostgroup_name 01-windows-server ; The name of the hostgroup
alias SERVER WINDOWS ; Long name of the group
members server-1,server-2
}


# Change the host_name to match the name of the host you defined above
# Cek Ping
define service{
use local-service ; Name of service template to use
host_name server-1
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service{
use local-service ; Name of service template to use
host_name server-2
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}


# Cek Port
define service{
use local-service ; Name of service$
host_name server-1
service_description Check Port 100
check_command check_port!100!0.5!0.2!
}
define service{
use local-service ; Name of service$
host_name server-2
service_description Check Port 100
check_command check_port!100!0.5!0.2!
}
define service{
use local-service ; Name of service$
host_name server-1
service_description Check Port 200
check_command check_port!200!0.5!0.2!
}
define service{
use local-service ; Name of service$
host_name server-2
service_description Check Port 200
check_command check_port!200!0.5!0.2!
}

"nanti disesuaikan dengan server dan port yang mau agan monitoring ya!!! ini hanya contoh saja" emoticon-Big Grin


sedikit penjelasan aja gan untuk perintah berikut ini "check_port!200!0.5!0.2!" maksudnya:

- check_port! : itu perintah untuk cek portnya, bisa disesuaikan dengan keinginan kita dengan terlebih dahulu mengedit perintah di "commands.cfg" lalu merubah command_name check_port menjadi sesuai keinginan kita misalnya command_name check_port_tcp maka check_port! dirubah jadi check_port_tcp!

- 200! : port yang mau kita monitoring
- 0.5! : waktu dalam satuan detik
- 0.2! : waktu dalam satuan detik


Ini perintah dasar dari plugin check_port.pl, sbb :

check_port.pl -p -h (-c -w -v)
-p # port number to examine
-h # hostname or ip address to contact
-c # the number of seconds to wait before a going critical
-w # the number of seconds to wait before a flagging a warning
-v # creates nagios performance information

e.g check_port.pl -p 80 -h [url]www.google.com[/url] -c 1.5 -w 1.0 -v

Sekian dulu sharing dari ane gan kalo ada kekurangan atau penjelasan yang kurang dimengerti mohon maaf dan mohon diluruskan. Terima kasih

Kalo berkenan bagi emoticon-Toast gan!!!

Tidak nerima di emoticon-Bata (S)
0
3.6K
24
GuestAvatar border
Komentar yang asik ya
Urutan
Terbaru
Terlama
GuestAvatar border
Komentar yang asik ya
Komunitas Pilihan