网站地图
首页
新闻
电影新闻
电视新闻
人物新闻
专题策划
影评
最新影评
新片热评
经典赏析
媒体评论
电影院
北京影讯
上海影讯
广州影讯
深圳影讯
成都影讯
电影库
典藏佳片
全球新片
即将上映
票房榜
社区
日志
相册
电影
好友
专辑
收藏
影视杂谈
明星时尚
文化休闲
群组
话题
达人
排行榜
电影榜
电视榜
人物榜
日志榜
话题榜

小亮

我们应该注意自己不用语言去伤害别的同志,但是,当别人用语言来伤害自己的时候,也应该受得起。。

http://i.mtime.com/liujinliang/

您当前的位置: 社区>> 博客>>

编辑 | 删除 转载: 利用Nagios实现服务器监控(中)

小亮 发布于:

配置Nagios
#cd /usr/local/nagios/etc
#mkdir sample
#mv * sample
#cd sample
#for i in *cfg-sample; do mv $i `echo $i | sed -e s/cfg-sample/cfg/`; done;
#cp cgi.cfg ../
#cp checkcommands.cfg ../
#cp minimal.cfg ../
#cp misccommands.cfg ../
#cp nagios.cfg ../
#cp resource.cfg ../
#vi minimal.cfg   \\注销掉COMMANDS分栏里面的所有项


###############################################################################
#
# HOSTS
#
###############################################################################

# Generic host definition template - This is NOT a real host, just a template!

define host{
name generic-host    ; The name of this host template
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information    1 ; Retain non-status information across program restarts
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}


# Since this is a simple configuration file, we only monitor one host - the
# local host (this machine).

define host{
use generic-host ; Name of host template to use
host_name test
alias Test Server
address 192.168.100.131
check_command check-host-alive
max_check_attempts 10
check_period 24x7
notification_interval   120
notification_period 24x7
notification_options    d,r
contact_groups  admins
}

###############################################################################
#
# HOST GROUPS
#
###############################################################################

# We only have one host in our simple config file, so there is no need to
# create more than one hostgroup.

define hostgroup{
hostgroup_name  test-server
alias Test Servers
members test
}

###############################################################################
#
# SERVICES
#
###############################################################################

# Generic service definition template - This is NOT a real service, just a template!

define service{
name generic-service ; The 'name' of this service template
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness'
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information    1 ; Retain non-status information across program restarts
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}


# Define a service to "ping" the local machine

define service{
use generic-service ; Name of service template to use
host_name test
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_options w,u,c,r
notification_interval 960
notification_period 24x7
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 generic-service ; Name of service template to use
host_name test
service_description Root Partition
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_options w,u,c,r
notification_interval 960
notification_period 24x7
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 generic-service ; Name of service template to use
host_name test
service_description Current Users
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_options w,u,c,r
notification_interval 960
notification_period 24x7
check_command check_local_users!20!50
}

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

define service{
use generic-service ; Name of service template to use
host_name test
service_description Current Load
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_options w,u,c,r
notification_interval 960
notification_period 24x7
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}


#vi cgi.cfg  \\去掉验证

use_authentication=0

回复 (0) | 收藏 (0) | 2132 次阅读 |

小亮103945 (北京)

男 33岁 巨蟹座