nagios監控配置詳解四監控主機和服務

來源:互聯網
上載者:User

# A simple configuration file for monitoring the local host
# This can serve as an example for configuring other servers;
# Custom services specific to this host are added here, but services
# defined in nagios2-common_services.cfg may also apply.
#

########################################################
## 定義主機
########################################################
define host{
 use  generic-host //使用的模板
 host_name localhost //定義主機名稱
 alias  localhost //別名
 address  127.0.0.1 //IP地址
        }


#define host{
 use  generic-host //使用的模板
 host_name ceshi228
 alias  ceshi228
 address  221.204.219.228
 }
########################################################
## 定義要監控的服務或者進程
########################################################

# check that web services are running
define service {
        hostgroup_name                  http-servers
        service_description             HTTP
  check_command                   check_http
        use                             generic-service
 notification_interval           0 ; set > 0 if you want to be renotified
}

define service {
        hostgroup_name                  http-servers
        service_description             Current Load
        check_command                   check_load
        use                             generic-service
        notification_interval           0 ;set > 0 if you want to be renotified
}
define service {
        hostgroup_name                  http-servers
        service_description             Current Disks
        check_command                   check_all_disks!20%!10%!/
        use                             generic-service
        notification_interval           0 ;set > 0 if you want to be renotified
}

define service {
        hostgroup_name                  http-servers
        service_description             Current Process
        check_command                   check_procs
        use                             generic-service
        notification_interval           0   ;set > 0 if you want to be renotified
}
########################################################
## 自訂服務,監聽連接埠
########################################################
# check that mysql services are running
define service {
        hostgroup_name                  mysql-server //主機群組,很多跑這個服務的主機都要放進這個組裡
        service_description             mysql
  check_command                   check_tcp!3306
        use                             generic-service
 notification_interval           1 ; set > 0 if you want to be renotified
}

 jaty0817 的BLOG

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.