Home > Old Post dari Unilanet > QUICK AND DIRTY INSTALL NAGIOS ON FREEBSD HOW TO

QUICK AND DIRTY INSTALL NAGIOS ON FREEBSD HOW TO


Our Online Nagios Tool  http://mon.unila.ac.id/nagios/ or http://inherent.unila.ac.id or http://apmon.unila.ac.id (LAN Only)

1.    Masuk ke direktori ports.

unila-inherent-gtw# cd /usr/ports/net-mgmt/nagios
unila-inherent-gtw# ll
-rw-r–r–    1 root     wheel        3175 Oct  1 03:01 Makefile
-rw-r–r–    1 root     wheel         188 Apr 19  2007 distinfo
drwxr-xr-x    2 root     wheel         512 Apr 19  2007 files
-rw-r–r–    1 root     wheel         677 May 29  2002 pkg-descr
-rw-r–r–    1 root     wheel       11633 Apr 19  2007 pkg-plist
drwxr-xr-x    3 root     wheel         512 Dec 10 12:21 work
unila-inherent-gtw#

2.    Configure dan install

unila-inherent-gtw# make clean
===>  Cleaning for autoconf-2.61_2
===>  Cleaning for nagios-plugins-1.4.10,1
===>  Cleaning for automake-1.9.6_2
===>  Cleaning for automake-wrapper-20071109
===>  Cleaning for nagios-2.9_2
unila-inherent-gtw#

unila-inherent-gtw# make && make install
===>  Vulnerability check disabled, database not found
===>  Found saved configuration for nagios-2.9_2
===>  Extracting for nagios-2.9_2
=> MD5 Checksum OK for nagios-2.9.tar.gz.
=> SHA256 Checksum OK for nagios-2.9.tar.gz.
===>   nagios-2.9_2 depends on file: /usr/local/bin/perl5.8.8 – found
===>  Patching for nagios-2.9_2
===>   nagios-2.9_2 depends on file: /usr/local/bin/perl5.8.8 – found
===>  Applying FreeBSD patches for nagios-2.9_2
===>   nagios-2.9_2 depends on file: /usr/local/bin/perl5.8.8 – found
===>   nagios-2.9_2 depends on file: /usr/local/bin/autoconf-2.61 – found
===>   nagios-2.9_2 depends on shared library: gd.4 – found
===>   nagios-2.9_2 depends on shared library: iconv.3 – found
===>  Configuring for nagios-2.9_2
^C
unila-inherent-gtw#

Tinggalin Ngopi Doloeee…………  Cool Cool Cool Cool Cool Cool Cool Cool Cool

3.    Periksa hasil install nagios

unila-inherent-gtw# pkg_info | grep nagios
nagios-2.9_2        Extremely powerful network monitoring system
nagios-plugins-1.4.10,1 Plugins for Nagios
unila-inherent-gtw#

instalasi akan menghasilkan folder html nagios di folder
/usr/local/www/nagios

unila-inherent-gtw# cd /usr/local/www/nagios/
unila-inherent-gtw# ll

total 36
drwxr-xr-x    2 root     wheel         512 Dec 10 12:21 cgi-bin
drwxr-xr-x    2 root     wheel        1536 Dec 10 12:21 contexthelp
drwxr-xr-x    3 root     wheel        1536 Dec 10 12:21 docs
drwxr-xr-x    3 root     wheel        1536 Dec 10 12:21 images
-rw-r–r–    1 root     wheel         658 Dec 10 12:21 index.html
-rw-r–r–    1 root     wheel        2408 Dec 10 12:21 main.html
drwxr-xr-x    2 root     wheel         512 Dec 10 12:21 media
-rw-r–r–    1 root     wheel          26 Dec 10 12:21 robots.txt
-rw-r–r–    1 root     wheel       12729 Dec 10 12:21 side.html
drwxr-xr-x    2 root     wheel         512 Dec 10 12:21 ssi
drwxr-xr-x    2 root     wheel         512 Dec 10 12:21 stylesheets

unila-inherent-gtw#

dan direktori /usr/local/etc/nagios

4.    Masuk ke Direktori NAGIOS

unila-inherent-gtw# cd /usr/local/etc/nagios/
unila-inherent-gtw# pwd
/usr/local/etc/nagios
unila-inherent-gtw#

unila-inherent-gtw# ll
total 142
-rw-r–r–    1 root     wheel        9569 Dec 10 12:21 cgi.cfg-sample
-rw-r–r–    1 root     wheel        8571 Dec 10 12:21 commands.cfg-sample
-rw-r–r–    1 root     wheel       12485 Dec 10 12:21 localhost.cfg-sample
-rw-r–r–    1 root     wheel       31087 Dec 10 12:21 nagios.cfg-sample
-rw-r–r–    1 root     wheel        1338 Dec 10 12:21 resource.cfg-sample
unila-inherent-gtw#

Rename semua file tersebut  misal  cgi.cfg-sample mennjadi cgi.cfg

5.    Modif  file cgi.cfg, seperti berikut ini

# AUTHENTICATION USAGE
# This option controls whether or not the CGIs will use any
# authentication when displaying host and service information, as
# well as committing commands to Nagios for processing.
#
# Read the HTML documentation to learn how the authorization works!
#
# NOTE: It is a really *bad* idea to disable authorization, unless
# you plan on removing the command CGI (cmd.cgi)!  Failure to do
# so will leave you wide open to kiddies messing with Nagios and
# possibly hitting you with a denial of service attack by filling up
# your drive by continuously writing to your command file!
#
# Setting this value to 0 will cause the CGIs to *not* use
# authentication (bad idea), while any other value will make them
# use the authentication functions (the default).

use_authentication=0

Ubah nilai default otentikasi menjadi 0, agar anonymous user bias mengakses aplikasi,  Nilai 1 memaksa user melakukan otentikasi sebelum melihat aplikasi.

6.    Modif file nagios.cfg

# Command definitions
cfg_file=/usr/local/etc/nagios/commands.cfg

# Host and service definitions for monitoring this machine
cfg_file=/usr/local/etc/nagios/localhost.cfg

buka tanda pagar untuk localhost.cfg dan commands.cfg

7.    Modif. File localhost.cfg,  server saya kira-kira seperti ini

###########################################################
# LOCALHOST.CFG – SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE
#
# Last Modified: 11-27-2006
# By Gigih Forda Nama
# NOTE: This config file is intended to servce as an *extremely* simple
#       example of how you can create your object configuration file(s).
##########################################################

Detail KONFIGURASI NAGIOS BISA LIAT DISINI

8.    Tambahkan option startup pada /etc/rc.conf

nagios_enable=”YES”

9.    Jalankan Program nagios dengan mengetikkan command berikut

unila-inherent-gtw# /usr/local/etc/rc.d/nagios start
nagios already running? (pid=89792).
unila-inherent-gtw#

10.
11.    Tambahkan skrip berikut di /usr/local/etc/apache22/extra/httpd-vhosts.conf

<VirtualHost *:80>
ServerAdmin // <![CDATA[

var prefix = 'ma' + 'il' + 'to';
var path = 'hr' + 'ef' + '=';
var addy69026 = 'gigih' + '@';
addy69026 = addy69026 + 'unila' + '.' + 'ac' + '.' + 'id';
document.write( '‘ );
document.write( addy69026 );
document.write( ” );
//
]]>
gigih@unila.ac.id
This email address is being protected from spam bots, you need Javascript enabled to view it

DocumentRoot /usr/local/www/apache22/data/lg
ServerName mon.unila.ac.id
ErrorLog /var/log/httpd/error.log
CustomLog /var/log/httpd/access.log common
Alias       /bw    “/usr/local/bandwidthd/htdocs”

<Directory “/usr/local/bandwidthd/htdocs”>
AllowOverride All
Options Indexes FollowSymLinks MultiViews
Order allow,deny
Allow from all
</Directory>

<Directory /usr/local/www/nagios>
Order allow,deny
Allow from all
</Directory>

<Directory /usr/local/www/nagios/cgi-bin>
Options ExecCGI
</Directory>

ScriptAlias /nagios/cgi-bin/ /usr/local/www/nagios/cgi-bin/
Alias /nagios/  /usr/local/www/nagios/
</VirtualHost>

Restart apache

unila-inherent-gtw# /usr/local/etc/rc.d/apache22 restart
Performing sanity check on apache22 configuration:
Syntax OK
Stopping apache22.
Waiting for PIDS: 11313.
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.
unila-inherent-gtw#

12.    Buka browser ke http://localhost/nagios/, atau http://mon.unila.ac.id/nagios/
13.    Check file konfigurasi dengan menjalankan perintah

unila-inherent-gtw# nagios -v /usr/local/etc/nagios/nagios.cfg

Nagios 2.9
Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)
Last Modified: 04-10-2007
License: GPL

Reading configuration data…

Running pre-flight check on configuration data…

Checking services…
Checked 18 services.
Checking hosts…
Checked 14 hosts.
Checking host groups…
Checked 4 host groups.
Checking service groups…
Checked 0 service groups.
Checking contacts…
Checked 1 contacts.
Checking contact groups…
Checked 1 contact groups.
Checking service escalations…
Checked 0 service escalations.
Checking service dependencies…
Checked 0 service dependencies.
Checking host escalations…
Checked 0 host escalations.
Checking host dependencies…
Checked 0 host dependencies.
Checking commands…
Checked 22 commands.
Checking time periods…
Checked 4 time periods.
Checking extended host info definitions…
Checked 0 extended host info definitions.
Checking extended service info definitions…
Checked 0 extended service info definitions.
Checking for circular paths between hosts…
Checking for circular host and service dependencies…
Checking global event handlers…
Checking obsessive compulsive processor commands…
Checking misc settings…

Total Warnings: 0
Total Errors:   0

Things look okay – No serious problems were detected during the pre-flight check
unila-inherent-gtw#

  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: