- 论坛徽章:
- 0
|
本帖最后由 kaiyang2013 于 2013-05-14 16:20 编辑
回复 9# chenyx
谢谢楼主啦,按照楼主给的提示信息,我做了相应修改,可是出现的提示信息是Name or service not known ,用了多个url测试,均出现这个问题,麻烦楼主帮忙给检查一下哪里出问题了,万分感谢!
1.定义命令- define command{
- command_name check_http_u
- command_line $USER1$/check_http -I $HOSTADDRESS$ -u $ARG1$
- }
复制代码 2.定义相应服务- define service{
- use generic-test-service ; Name of service template to use
- host_name apabi ;前面定义好的主机名
- service_description HTTP_URL;
- check_command check_http_u!'/path/index.html' ;
- notifications_enabled 1;
- }
复制代码 3.主机定义- define host{
- use web-80-test1-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 apabi
- alias apabi
- address http://www.apabi.com/xzjlt/
- notifications_enabled 1
- }
复制代码 4.主机模板定义- define host{
- name web-80-test1-server ; The name of this host template
- use generic-host ; This template inherits other values from the generic-host template
- check_period 24x7 ; By default, Linux hosts are checked round the clock
- check_interval 5 ; Actively check the host every 5 minutes
- retry_interval 1 ; Schedule host check retries at 1 minute intervals
- max_check_attempts 20 ; Check each Linux host 20 times (max)
- check_command check_http_u ; Default command to check if servers are "alive"
- notification_period workhours ; Linux admins hate to be woken up, so we only notify during the day
- ; Note that the notification_period variable is being overridden from
- ; the value that is inherited from the generic-host template!
- notification_interval 360 ; Resend notifications every 2 hours
- notification_options d,u,r ; Only send notifications for specific host states
- contact_groups admins ; Notifications get sent to the admins by default
- register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
- }
复制代码 5.服务模板定义- define service{
- name generic-test-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
- is_volatile 0 ; The service is not volatile
- check_period 24x7 ; The service can be checked at any time of the day
- max_check_attempts 20 ; Re-check the service up to 3 times in order to determine its final (hard) state
- normal_check_interval 10 ; Check the service every 10 minutes under normal conditions
- retry_check_interval 2 ; Re-check the service every two minutes until a hard state can be determined
- contact_groups admins ; Notifications get sent out to everyone in the 'admins' group
- notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events
- notification_interval 360 ; Re-notify about service problems every hour
- notification_period 24x7 ; Notifications can be sent out at any time
- register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
- }
复制代码 |
|