Nagios adalah framework network monitoring system open source yang terbaik. Nagios bersifat modular, mudah digunakan, dan memiliki skalabilitas tinggi. Modul atau plugin pada Nagios sangat sederhana dan Anda pun dapat membuatnya guna melengkapi sistem pengecekan pada Nagios sesuai dengan kebutuhan Anda. Untuk men-download source Nagios klik URL ini http://www.nagios.org/download/
Atau anda juga bisa membuat repo section :
[root@lab008 snmp]# cd /etc/yum.repos.d/
Buat sebuah file seksi dengan nama FAN.repo :
[root@lab008 yum.repos.d]# vi FAN.repo
Isi file FAN.repo adalah sbb :
[root@lab008 yum.repos.d]# more FAN.repo
[FAN]
name=FAN-Base
baseurl=http://cedrictemple.net/FAN/repository/fan2prod/
gpgcheck=1
gpgkey=http://cedrictemple.net/FAN/repository/fan2prod/RPM-GPG-KEY-FAN-1
[root@lab008 yum.repos.d]#
Lakukan update YUM
[root@lab008 yum.repos.d]# yum --disablerepo=\* --enablerepo=local,FAN update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
FAN | 951 B 00:00
Setting up Update Process
No Packages marked for Update
[root@lab008 yum.repos.d]#
Lalu install via YUM untuk aplikasi PERL dan PHP:
[root@lab008 yum.repos.d]# yum --disablerepo=\* --enablerepo=local,FAN install perl* php*
Lalu install via YUM untuk aplikasi Nagios, dkk :
[root@lab008 yum.repos.d]# yum --disablerepo=\* --enablerepo=local,FAN install nagios-* nagvis* ndo*
jika gagal, karena ada pesan :
--> Missing Dependency: libmcrypt.so.4 is needed by package nagios-nsca-client-2.7.2-fan.7.i386 (FAN)
nagios-nsca-2.7.2-fan.7.i386 from FAN has depsolving problems
--> Missing Dependency: libmcrypt.so.4 is needed by package nagios-nsca-2.7.2-fan.7.i386 (FAN)
Error: Missing Dependency: libmcrypt.so.4 is needed by package nagios-nsca-client-2.7.2-fan.7.i386 (FAN)
Error: Missing Dependency: libmcrypt.so.4 is needed by package nagios-nsca-2.7.2-fan.7.i386 (FAN)
jalankan :
[root@lab008 yum.repos.d]# yum --disablerepo=\* --enablerepo=local,FAN --exclude=nagios-nsca* install nagios-* nagvis* ndo*
Aktifkan sistem :
[root@lab008 yum.repos.d]# service httpd start
[root@lab008 yum.repos.d]# service nagios start
[root@lab008 yum.repos.d]# service ndo2db start
Lihat Nagios :
http://192.168.30.108/nagios/
Masukkan username nagiosadmin dan password nagios admin
Mengkonfigurasi Nagios untuk menambah obyek pengecekan :
[root@lab008 yum.repos.d]# cd /etc/nagios/
[root@lab008 nagios]# cd objects/
[root@lab008 objects]# cp localhost.cfg serpong3.cfg
[root@lab008 objects]# vi serpong3.cfg
Isi file serpong3.cfg yang mengalami perubahan :
# Define a host for the local machine
define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables tha
t are defined
; in (or inherited by) the linux-server host template
definition.
host_name serpong3
alias serpong3
address 192.168.30.1
}
# Define an optional hostgroup for Linux machines
define hostgroup{
hostgroup_name gateway ; The name of the hostgroup
alias Cisco Router ; Long name of the group
members serpong3 ; Comma separated list of hosts that belong to this group
}
# Define a service to "ping" the local machine
define service{
use local-service ; Name of service template to use
host_name serpong3
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
[root@lab008 objects]# vi /etc/nagios/nagios.cfg
Tambahkan sebaris pada file /etc/nagios/nagios.cfg
# Definitions for monitoring the local (Linux) host
cfg_file=/etc/nagios/objects/localhost.cfg
cfg_file=/etc/nagios/objects/serpong3.cfg
[root@lab008 objects]# service nagios reload
Running configuration check...done.
Reloading nagios configuration...done
[root@lab008 objects]#
Lain-lain :
[root@lab008 yum.repos.d]# history |grep yum
[root@lab008 yum.repos.d]# !101
hallo..
ReplyDeletesaya mau tanya..
saat saya menambah line cfg_file=/etc/nagios/objects/host1.cfg, nagios-nya jd error padahal host1.cfg sudah didefinisikan di /etc/nagios/objects/
definisinya:
define host{
use linux-server host_name 172.16.122.15
alias CentOS
address 172.16.122.15
}
define service{
use generic-service
host_name 172.16.122.15
service_description CPU Load
check_command check_nrpe!check_load
}
define service{
use generic-service
host_name 172.16.122.15
service_description Free Disk Space
check_command check_nrpe!check_disk
}