instalasi network monitoring system (nagios) centos 6.4

5

Click here to load reader

Upload: febi-gelar-ramadhan

Post on 05-Jul-2015

897 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Instalasi Network Monitoring System (Nagios) Centos 6.4

Instalasi Network Monitoring System Nagios di Centos 6

1. Pertama installkan packet yang diperlukan untuk memakai nagios supaya bisa dipakai

untuk memonitoring jaringan.

Apache

PHP

GCC Compiler

GD development libraries

[root@localhost]# yum install httpd php

[root@localhost]# yum install gcc glibc glibc-common

[root@localhost]# yum install gd gd-devel

2. Lalu masuk menjadi user root

[root@localhost]# su –l

3. Lalu buat user nagios beserta paswordnya

[root@localhost]#/usr/sbin/useradd –m nagios

[root@localhost]#passwd nagios

4. Lalu buat group nagcmd untuk member akses ijin external command dari web interface

dan masukan user ke group yang telah di buat.

[root@localhost]#/usr/sbin/groupadd nagcmd

[root@localhost]#/usr/sbin/usermod –a –G nagcmd nagios

[root@localhost]#/usr/sbin/usermod –a –G nagcmd apache

5. Lalu kita download packet nagios yang akan kita pakai dan

[root@localhost]#wget

http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.3.1.tar.gz

[root@localhost]#wget

http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-

1.4.15.tar.gz

6. Setelah kita download kita mulai compile dan install packet tersebut

[root@localhost]#cd ~/downloads

[root@localhost downloads]#tar xzf nagios-3.3.1.tar.gz

[root@localhost downloads]#cd nagios

7. Lalu jalankan script konfig nagios melewati group “nagcmd” yang telah kita buat

sebelumnya.

[root@localhost nagios]#./configure –with-command-

group=nagcmd

8. Lalu compile semua source code nagios, dan install semua binary, skrip, int dan set

permission command external pada direktori nya.

[root@localhost nagios]#Make all

Page 2: Instalasi Network Monitoring System (Nagios) Centos 6.4

[root@localhost nagios]#Make make install

[root@localhost nagios]#make install-init

[root@localhost nagios]#make install-config

[root@localhost nagios]#make-install-commandmode

9. File konfigurasi sudah terinstall dan sudah bisa digunakan, dan perlu beberapa perubahan

untuk menjalankannya lebih lanjut. Lalu ubah dahulu alamat email dan kontak

nagiosadmin nya terlebih dahulu.

[root@localhost]#vi/usr/local/nagios/etc/objects/contacts.cfg

10. Lalu install file nagios web config pada directori apache conf.d

[root@localhost]#make install-webconf

11. Lalu masukan password pada user untuk bisa masuk authentication pada tampilan nagios

nanti.

[root@localhost]#htpasswd -c /usr/local/nagios/etc/htpasswd.users

nagiosadmin

12. Lalu restart apache supaya bisa berfungsi

[root@localhost]#service httpd restart

13. Lalu selanjutnya ekstrak dan install plugin nagios

[root@localhost]#cd ~/downloads

[root@localhost downloads ]#tar xzf nagios-plugins-1.4.15.tar.gz

[root@localhost downloads]#cd nagios-plugins-1.4.15

14. Lalu compile dan install plugin nagios

[root@localhost nagios-plugins-1.4.15]#./configure --with-nagios-

user=nagios --with-nagios-group=nagios

[root@localhost nagios-plugins-1.4.15]#make

[root@localhost nagios-plugins-1.4.15]#make install

15. Lalu jalankan dan tambahkan ke daftart system service dan atur service nagios berjalan

setiap booting.

[root@localhost nagios-plugins-1.4.15]#chkconfig --add nagios

[root@localhost nagios-plugins-1.4.15]#chkconfig nagios on

16. Lalu kita cek dan verifikasi apakah konfigurasi sudah benar atau belum.

[root@localhost]#/usr/local/nagios/bin/nagios -v

/usr/local/nagios/etc/nagios.cfg

Page 3: Instalasi Network Monitoring System (Nagios) Centos 6.4

17. Lalu cek SELinux, dan ubah ke mode permissive.

[root@localhost]#getenforce

[root@localhost]#setenforce 0

18. Lalu pastikan SELinux dalam keadaan disable dan bertype enforce/targeted.

[root@localhost]#vi etc/selinux/config

19. Lalu jalankan CGI melalui mode enforcing/targeted tadi.

[root@localhost]#chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/

[root@localhost]#chcon -R -t httpd_sys_content_t /usr/local/nagios/share/

20. Setelah itu kita bisa mencoba mengakses melalui web browser.

http://182.23.45.27/nagios <-- contoh alamat nagios.

21. Lalu saat muncul kolom authentication masuk dengan user dan password yang telah kita

atur di httpasswd.user.

Page 4: Instalasi Network Monitoring System (Nagios) Centos 6.4

22. Jika telah login anda akan masuk pada halaman utama nagios.

23. Setelah itu jika ingin melakukan pengecekan lakukan konfigurasi pada localhost.cfg dan

masukan konfigurasi host yang akan di monitoring. Ganti semua localhost denganost

yang anda akan monitoring, dan masukan dalam group monitoring.

[root@localhost]#vi /usr/local/nagios/etc/objects/localhost.cfg

24. Lalu restart nagios dan nagios pun akan muncul dengan tampilan host yang sudah

didaftarkan.

[root@localhost]#service nagios restart

Page 5: Instalasi Network Monitoring System (Nagios) Centos 6.4

25. Setelah itu kita bisa melihat status host yang kita monitoring, tapi untuk mendapatkan

data yang akurat kita harus menginstalkan agent NRPE pada client/host yang akan kita

monitoring.