#the check_wls_server_adminserver on the remote host.
define service{
use generic-service
host_name HPUX_XX.XX.XX.XX
service_description Weblogic Server adminserver
check_command check_nrpe! check_wls_server_adminserver
}
|
###############################################################################
###############################################################################
#
# SERVICE TEMPLATES
#
###############################################################################
###############################################################################
# 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
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 3 ; 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 60 ; 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!
}
|
# This defines a timeperiod where all times are valid for checks,
# notifications, etc. The classic "24x7" support nightmare. :-)
define timeperiod{
timeperiod_name 24x7
alias 24 Hours A Day, 7 Days A Week
sunday 00:00-24:00
monday 00:00-24:00
tuesday 00:00-24:00
wednesday 00:00-24:00
thursday 00:00-24:00
friday 00:00-24:00
saturday 00:00-24:00
}
|
# Some P.R.C holidays
#
中国的一些法定节假日
define timeperiod{
name cn-holidays
timeperiod_name cn-holidays
alias CN Holidays
january 1 00:00-00:00 ; 1.1
may 1 00:00-00:00 ; 5.1
october 1 00:00-00:00 ; 10.1
}
# Work time
# Week monday to friday
# Time 8:00 to 17:00
#
工作时间
周一至周五的早八点到晚五点
define timeperiod{
timeperiod_name cn_work_time_8x5
alias CN Work TIme 8x5
use cn-holidays ;
使用cn-holidays模板
sunday 00:00-00:00
monday 08:00-17:00
tuesday 08:00-17:00
wednesday 08:00-17:00
thursday 08:00-17:00
friday 08:00-17:00
saturday 00:00-00:00
}
|
# 8x5 service definition template - This is NOT a real service, just a template!
define service{
name generic-service-8x5 ; The name of this service template
use generic-service ; Inherit default values from the generic-service definition
check_period cn_work_time_8x5
notification_period cn_work_time_8x5
}
|
#the check_wls_server_adminserver on the remote host.
define service{
use generic-service-8x5
host_name HPUX_XX.XX.XX.XX
service_description Weblogic Server adminserver
check_command check_nrpe!check_wls_server_adminserver
}
|
bash-3.00$ ./nagios -v ../etc/nagios.cfg
Nagios 3.0.3
Copyright (c) 1999-2008 Ethan Galstad ([url]http://www.nagios.org[/url])
Last Modified: 06-25-2008
License: GPL
Reading configuration data...
Running pre-flight check on configuration data...
Checking services...
Checked 111 services.
Checking hosts...
Checked 7 hosts.
Checking host groups...
Checked 1 host groups.
Checking service groups...
Checked 1 service groups.
Checking contacts...
Checked 2 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 25 commands.
Checking time periods...
Checked 7 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
|
bash-3.00# svcadm restart nagios
bash-3.00# svcs nagios
STATE STIME FMRI
online 9:48:11 svc:/site/nagios:default
|