知识屋:更实用的电脑技术知识网站
所在位置:首页 > 操作系统 > linux

nagios监控配置详解四监控主机和服务

发布时间:2014-09-05 16:45:54作者:知识屋

# 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

(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)
收藏
  • 人气文章
  • 最新文章
  • 下载排行榜
  • 热门排行榜