install nagios

Assalamu’alaikum wr Wb,
Kali ini penulis akan mencoba install salah satu ‘network monitoring tools” di Ubuntu Server.
Ok…agar tidak terlalu lama, langsung saja.
1. Install program webserver ( apache, GCC compiler dll )
Pembahasan ini sudah ditulis pada saat membahas installasi
webserver, tapi jika belum bisa di install dengan lankah sbb
root@nms:/# apt-get install apache2
root@nms:/# apt-get install build-essential
root@nms:/# apt-get install libgd2-xpm-dev
Jika sudah ada semua, maka tidak akan terinstall🙂

2. Buat user dan group untuk nagios dan juga setting passwordnya
root@nms:/# useradd nagios
root@nms:/# passwd nagios
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@nms:/# /usr/sbin/groupadd nagcmd
root@nms:/# /usr/sbin/usermod -G nagcmd nagios
root@nms:/# /usr/sbin/usermod -G nagcmd www-data

3. Download nagios dan pluginnya
root@nms:/# mkdir ~/downloads
root@nms:/# cd ~/downloads
root@nms:~/downloads# wget http://switch.dl.sourceforge.net
/sourceforge/nagios/nagios-2.10.tar.gz
root@nms:~/downloads# wget http://kent.dl.sourceforge.net
/sourceforge/nagiosplug/nagios-plugins-1.4.10.tar.gz

4. Compile dan install nagios
root@nms:~/downloads# tar -xzvf nagios-2.10.tar.gz
root@nms:~/downloads# cd nagios-2.10
root@nms:~/downloads/nagios-2.10# ./configure –with-command-
group=nagcmd
Setelah selesai configure akan muncul sebagai berikut
Review the options above for accuracy. If they look okay,
type ‘make all’ to compile the main program and CGIs.
maka lakukan make all sebagaimana disebut tuh diatas🙂
root@nms:~/downloads/nagios-2.10# make all
Kemudian setelah itu berturut-turut lakukan perintah dibawah
Sesuai dengan perintah setelah make all
*** Compile finished ***

If the main program and CGIs compiled without any errors, you
can continue with installing Nagios as follows (type ‘make’
without any arguments for a list of all possible options):

make install
– This installs the main program, CGIs, and HTML files

make install-init
– This installs the init script in /etc/init.d

make install-commandmode
– This installs and configures permissions on the
directory for holding the external command file

make install-config
– This installs *SAMPLE* config files in /usr/local/nagios/etc
You’ll have to modify these sample files before you can
use Nagios. Read the HTML documentation for more info
on doing this. Pay particular attention to the docs on
object configuration files, as they determine what/how
things get monitored!

root@nms:~/downloads/nagios-2.10# make install
root@nms:~/downloads/nagios-2.10# make install-init
root@nms:~/downloads/nagios-2.10# make install-config
root@nms:~/downloads/nagios-2.10# make install-commandmode

5. Konfigurasi
contoh konfigurasi sudah terinstall di /usr/local/nagios/etc

6. Konfigure web interface untuk nagios
install nagios web config
root@nms:~/downloads/nagios-2.10# make install-webconf
Maka akan muncul
/usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/conf.d/nagios.conf

*** Nagios/Apache conf file installed ***

7. Create account untuk nagios admin dan set password
root@nms:~/downloads/nagios-2.10# htpasswd -c /usr/local
/nagios/etc/htpasswd.users nagiosadmin
New password:
Re-type new password:
Adding password for user nagiosadmin

8. Restart Apache
root@nms:~/downloads/nagios-2.10# /etc/init.d/apache2 reload
* Reloading web server config apache2 [ OK ]

9. Compile dan Install nagios plugIn
root@nms:~/downloads/nagios-2.10# cd ~/downloads/
root@nms:~/downloads# tar -xzvf nagios-plugins-1.4.10.tar.gz
root@nms:~/downloads# cd nagios-plugins-1.4.10
root@nms:~/downloads/nagios-plugins-1.4.10# ./configure –with-
nagios-user=nagios –with-nagios-group=nagios
root@nms:~/downloads/nagios-plugins-1.4.10# make
root@nms:~/downloads/nagios-plugins-1.4.10# make install

10. start Nagios
Agar nagios bisa berjalan pada saat boot, maka kita buat ln
root@nms:~/downloads/nagios-plugins-1.4.10# ln -s /etc/init.d
/nagios /etc/rcS.d/S99nagios
Kita coba jalankan konfigurasi nagios, apakah ada error/tidak
root@nms:~/downloads/nagios-plugins-1.4.10# /usr/local/nagios
/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Okey…tidak ada error, spt comment dibawah
Total Warnings: 0
Total Errors: 0

Things look okay – No serious problems were detected during the pre-flight check

Ok…kita jalankan sekarang nagiosnya..
root@nms:/# /etc/init.d/nagios start
Kemudian kita coba akses via web
http://ipaddress/nagios, maka akan muncul seperti gambar dibawah

username : nagiosadmin
password : nagiosadmin password seperti yang dibuat diatas.

Setelah login, maka akan tampil menu2nya seperti gambar dibawah

11. Install software tambahan
Software untuk menerima notifikasi dari nagios, yaitu mailx
Ok…tak apa, kita install tuh software, kalau dah ada, ndak usah sudah🙂
root@nms:/# apt-get install mailx
dan restart nagios kalau dah selesai install🙂

Ups….Setelah dilihat lagi, Error nih nagiosnya, spt gambar dibawah

Terus, bagaimana solusinya…..?
hilangkan tanda # pada command2 dibawah ini di file cgi.cfg
root@nms:/usr/local/nagios/etc# nano cgi.cfg
authorized_for_system_information=nagiosadmin
authorized_for_system_commands=nagiosadmin
authorized_for_configuration_information=nagiosadmin
authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin
authorized_for_all_host_commands=nagiosadmin
authorized_for_all_service_commands=nagiosadmin

Sekarang..coba lihat gambarnya…

Oke selamat mencoba yah…konfigurasi2 dan lain2, silahkan dibaca setelah login, menu2nya dipelajari sendiri yah….:-)

Wassalamu’alaikum Wr Wb,
Al-Faqir, Saudi Arabia

Leave a comment

No comments yet.

Comments RSS TrackBack Identifier URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s