• Masim “Vavai” Sugianto

    Founder PT. Excellent Infotama Kreasindo– perusahaan email services provider (ESP) dan menjadi konsultan pada berbagai instansi pemerintah, korporasi besar, lembaga perbankan dan institusi pendidikan di Indonesia.

    Lebih detail tentang Vavai.




  • Publishing

  • Recent Posts

    • Pengalaman Saat Sakit : Keluarga, Sahabat dan Bagaimana Jika…
    • Refleksi Setelah Sakit
    • Legacy
    • Bitcoin, Ethereum, Dogecoin
    • Penjualan Langsung : Keliling dan Mangkal
  • Recent Comments

    • PT. Infra Solution International on Perkembangan Usaha Penjualan Pisang “Zeze Zahra” Setelah 1 Bulan
    • PT. Infra Solution International on Refleksi Setelah Sakit
    • PT. Infra Solution International on Pengalaman Saat Sakit : Keluarga, Sahabat dan Bagaimana Jika…
    • ict Administrator on Pengalaman Saat Sakit : Keluarga, Sahabat dan Bagaimana Jika…
    • sada dua on Pengalaman Saat Sakit : Keluarga, Sahabat dan Bagaimana Jika…
  • Archives

    • February 2021
    • January 2021
    • December 2020
    • August 2020
    • July 2020
    • April 2020
    • March 2020
    • August 2019
    • July 2019
    • June 2019
    • March 2019
    • February 2019
    • January 2019
    • November 2018
    • October 2018
    • August 2018
    • May 2018
    • April 2018
    • January 2018
    • December 2017
    • July 2017
    • December 2016
    • November 2016
    • April 2016
    • March 2016
    • November 2015
    • July 2015
    • April 2015
    • November 2014
    • October 2014
    • February 2014
    • January 2014
    • December 2013
    • November 2013
    • October 2013
    • September 2013
    • August 2013
    • June 2013
    • May 2013
    • March 2013
    • February 2013
    • January 2013
    • December 2012
    • November 2012
    • October 2012
    • September 2012
    • August 2012
    • July 2012
    • June 2012
    • May 2012
    • April 2012
    • March 2012
    • February 2012
    • January 2012
    • December 2011
    • November 2011
    • October 2011
    • September 2011
    • August 2011
    • July 2011
    • June 2011
    • May 2011
    • April 2011
    • March 2011
    • February 2011
    • January 2011
    • December 2010
    • November 2010
    • October 2010
    • September 2010
    • August 2010
    • July 2010
    • June 2010
    • May 2010
    • April 2010
    • March 2010
    • February 2010
    • January 2010
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
  • Home
  • Bisnis & Marketing
  • Computer & IT Related
  • Lifestyle
  • Publishing
  • Free Stuff
  • About
  • Kontak

Monitoring System Dengan Nagios jilid 3

August 4, 2011

Artikel sebelumnya adalah : Bagaimana cara installasi  nagios pada OpenSUSE / SLES dan Konfigurasi Nagios pada OpenSUSE / SLES

Menambahkan host yang akan di monitoring

Pada konfigurasi default, nagios hanya memonitor sebuah host  yaitu localhost. Tentunya kita akan memonitor juga host lainnya. Untuk memonitor host lainnya anda harus membuat file konfigurasi monitoring host tersebut. sebagai contoh saya akan memonitor email server

1. Salin file konfigurasi untuk monitoring host localhost

cp /opt/nagios/etc/objects/localhost.cfg /opt/nagios/etc/objects/email.cfg

cp /opt/nagios/etc/objects/localhost.cfg /opt/nagios/etc/objects/email.cfg

2. Kemudian edit dan sesuaikan konfigurasi yang Anda iniginkan untuk email.cfg, apa saja service yang akan Anda monitoring, contoh saya akan memonitoring email server dengan ip address 10.88.1.2, service yang akan dimonitoring adalah ping, ssh,smtp,imap,pop dan http.

vi /opt/nagios/etc/objects/email.cfg

vi /opt/nagios/etc/objects/email.cfg

Konfigurasi:
[global]

###############################################################################
# LOCALHOST.CFG - SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE
#
# Last Modified: 05-31-2007
#
# NOTE: This config file is intended to serve as an *extremely* simple
#       example of how you can create configuration entries to monitor
#       the local (Linux) machine.
#
###############################################################################

###############################################################################
###############################################################################
#
# HOST DEFINITION
#
###############################################################################
###############################################################################

# 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 that are defined
; in (or inherited by) the linux-server host template definition.
host_name               email
alias                   email-server
address                 10.88.1.2
}

###############################################################################
###############################################################################
#
# HOST GROUP DEFINITION
#
###############################################################################
###############################################################################

# Define an optional hostgroup for Linux machines
#
#define hostgroup{
#        hostgroup_name  linux-servers ; The name of the hostgroup
#       alias           Linux Servers ; Long name of the group
#       members         localhost, file-server     ; Comma separated list of hosts that belong to this group
#        }

###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################

# Define a service to "ping" the local machine

define service{
use                             local-service         ; Name of service template to use
host_name                       email
service_description             PING
check_command            check_ping!100.0,20%!500.0,60%
}

# Define a service to check the disk space of the root partition
# on the local machine.  Warning if < 20% free, critical if
# < 10% free space on partition.

#define service{
#        use                             local-service         ; Name of service template to use
#        host_name                       file-server
#        service_description
#    check_command            check_local_disk!20%!10%!/
#        }

# Define a service to check the number of currently logged in
# users on the local machine.  Warning if > 20 users, critical
# if > 50 users.

#define service{
#        use                             local-service         ; Name of service template to use
#        host_name                       localhost
#        service_description             Current Users
#    check_command            check_local_users!20!50
#       }

# Define a service to check the number of currently running procs
# on the local machine.  Warning if > 250 processes, critical if
# > 400 users.

#define service{
#        use                             local-service         ; Name of service template to use
#        host_name                       localhost
#        service_description             Total Processes
#    check_command            check_local_procs!250!400!RSZDT
#        }

# Define a service to check the load on the local machine.

#define service{
#        use                             local-service         ; Name of service template to use
#        host_name                       localhost
#        service_description             Current Load
#    check_command            check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
#        }

# Define a service to check the swap usage the local machine.
# Critical if less than 10% of swap is free, warning if less than 20% is free

#define service{
#        use                             local-service         ; Name of service template to use
#        host_name                       localhost
#        service_description             Swap Usage
#    check_command            check_local_swap!20!10
#        }

# Define a service to check SSH on the local machine.
# Disable notifications for this service by default, as not all users may have SSH enabled.

define service{
use                             local-service         ; Name of service template to use
host_name                       email
service_description             SSH
check_command            check_ssh
notifications_enabled        0
}

# Define a service to check HTTP on the local machine.
# Disable notifications for this service by default, as not all users may have HTTP enabled.

define service{
use                             local-service         ; Name of service template to use
host_name                       email
service_description             HTTP
check_command            check_http
notifications_enabled        0
}

define service{
use                             local-service         ; Name of service template to use
host_name                       email
service_description             SMTP
check_command            check_smtp
notifications_enabled        0
}
define service{
use                             local-service         ; Name of service template to use
host_name                       email
service_description             imap
check_command            check_imap
notifications_enabled        0
}

define service{
use                             local-service         ; Name of service template to use
host_name                       email
service_description             pop
check_command            check_pop
notifications_enabled        0
}

3. Edit file /opt/nagios/etc/nagios.cfg untuk menambahkan entri konfigurasi host email server yang akan di monitor

vi /opt/nagios/etc/nagios.cfg

vi /opt/nagios/etc/nagios.cfg

# Definitions for monitoring the local (Linux) host
 
cfg_file=/opt/nagios/etc/objects/localhost.cfg
 
cfg_file=/opt/nagios/etc/objects/email.cfg

# Definitions for monitoring the local (Linux) host cfg_file=/opt/nagios/etc/objects/localhost.cfg cfg_file=/opt/nagios/etc/objects/email.cfg

4. menambahkan email-server sebagai member dari hostgroup linux­server

vi /opt/nagios/etc/objects/localhost.cfg

vi /opt/nagios/etc/objects/localhost.cfg

# Define an optional hostgroup for Linux machines
#
define hostgroup{
        hostgroup_name  linux-servers ; The name of the hostgroup
       alias           Linux Servers ; Long name of the group
       members         localhost,email     ; Comma separated list of hosts that belong to this group
        }

# Define an optional hostgroup for Linux machines # define hostgroup{         hostgroup_name  linux-servers ; The name of the hostgroup        alias           Linux Servers ; Long name of the group        members         localhost,email     ; Comma separated list of hosts that belong to this group         }

5. Check apakah ada error dalam file hasil configurasi atau tidak

/opt/nagios/bin/nagios -v /opt/nagios/etc/nagios.cfg

/opt/nagios/bin/nagios -v /opt/nagios/etc/nagios.cfg

6. Restart Nagios

service nagios restart
atau
/etc/init.d/nagios restart

service nagios restart atau /etc/init.d/nagios restart

7. Buka nagios pada web browser dan klik menu Hosts,Services, Host Groups

Catatan : Untuk menambahkan host lainnya yang akan dimonitor dapat melakukan hal yang sama dengan mengkopi file localhost.cfg, checking system apa saja yang bisa di monitor dapat dilihat pada folder /opt/nagios/libexec

Silakan dicoba dan semoga bermanfaat 😀

LinuxMigrasi ServeropenSUSE & SLESplanet-terasi-aggregatorTipsTricks & Tutorial
Share

Linux  / Migrasi Aplikasi  / Migrasi Server  / openSUSE & SLES  / Tips, Tricks & Tutorial

Ahmad Imanudin
Ahmad Imanudin, Guest Blogger di http://www.vavai.com.Tinggal di Bekasi. Bekerja sebagai salah satu support di PT. Excellent Infotama Kreasindo.

You might also like

Aplikasi Screencopy untuk Screencast Tampilan HP pada PC/Laptop
April 23, 2020
Mengecek dan Memperbaiki Performa Web Menggunakan GTMetrix dan Google Pagespeed Insights
April 22, 2020
Update Script untuk Ubuntu Initial Server Setup
April 20, 2020

7 Comments


Monitoring System Dengan Nagios jilid 2 | Migrasi Windows Linux
August 4, 2011 at 11:15 am

[…] Berlanjut pada : Menambahkan host lain untuk dimonitoring Ahmad Imanudin, Linux Addict yang menjadi Guest Blogger di https://www.vavai.com. Tinggal di […]



wawan
August 4, 2011 at 11:54 am

Kelihatannya pertanyaan saya sudah terjawab di bagian ini. terimakasih. semoga puasanya berkah.



bangpei
August 5, 2011 at 1:00 am

Kayaknya ribert banget ya napa enggak nyobain zabbix atau cactiEZ



Masim Vavai Sugianto
August 5, 2011 at 3:32 am

@Bangpei,

Kalau Bangpei bisa share tulisan mengenai Zabbix atau CactiEZ, kami tentu sangat-sangat welcome 😉



dini purwanti
August 9, 2011 at 1:08 pm

sudah setahun lebih saya pakai nagios tapi gak tahu bisa gak nagios untuk monitoring koneksi IP camera?

thx



Ahmad Imanudin
October 21, 2011 at 9:35 am

http://opensuse.or.id/panduan/aplikasi/aplikasi-utility/instalasi-cacti-pada-opensuse/



rizki
October 24, 2011 at 9:27 am

mas Ahmad…saya sudah coba untuk menjalani nagios ini tapi masih ada yang ga bisa terbuka nih yaitu status mapnya….apa mungkin karena settingan httpd.conf nya kah ?? thx sharingnya



Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

CAPTCHA
Refresh

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Artikel



  • Blogroll

    • DNS Propagation Checker
    • Instagram Photo/Video Downloader
    • PT. Excellent Infotama Kreasindo
  • Publishing

  • Recent Posts

    • Pengalaman Saat Sakit : Keluarga, Sahabat dan Bagaimana Jika…
    • Refleksi Setelah Sakit
    • Legacy
    • Bitcoin, Ethereum, Dogecoin
    • Penjualan Langsung : Keliling dan Mangkal
    • Perkembangan Usaha Penjualan Pisang “Zeze Zahra” Setelah 1 Bulan
    • Bekerja Keras dan Responsif
    • Bank Syariah Indonesia
    • Meningkatkan Nilai Tambah & Daya Tarik
    • Kios Aneka Pisang “Zeze Zahra II”