|
[root@rhel local]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 3.2.0
Copyright (c) 2009 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2009
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/hostgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/contactgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/services.cfg'...
Processing object config file '/usr/local/nagios/etc/timeperiods.cfg'...
Read object config files okay...
Running pre-flight check on configuration data...
Checking services...
Error: Service check command 'check_nrpe' specified in service 'check-disk' for host 'kyhack' not defined anywhere!
Error: Service check command 'check_nrpe' specified in service 'check-load' for host 'kyhack' not defined anywhere!
Error: Service check command 'check_nrpe' specified in service 'total_procs' for host 'kyhack' not defined anywhere!
Checked 5 services.
Checking hosts...
Checked 1 hosts.
Checking host groups...
Checked 1 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Error: Service notification command 'service-notify-by-email' specified for contact 'kyhack' is not defined anywhere!
Error: Host notification command 'host-notify-by-email' specified for contact 'kyhack' is not defined anywhere!
Checked 1 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 24 commands.
Checking time periods...
Checked 1 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: 5
***> One or more problems was encountered while running the pre-flight check...
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
********************************
以下为hosts.cfg内容
define host{
host_name kyhack
alias nagios server
#use kyhack
address 192.168.0.10
check_command check-host-alive
contact_groups sagroup
max_check_attempts 5
notification_interval 10
notification_period 24x7
notification_options d,u,r
}
*********************
以下为 services.cfg
[root@rhel etc]# cat services.cfg
# service definition
define service{
host_name kyhack
service_description check-host-alive
check_command check-host-alive
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
check_period 24x7
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
contact_groups sagroup
}
define service {
host_name kyhack
service_description check_tcp 80
check_period 24x7
max_check_attempts 4
normal_check_interval 3
retry_check_interval 2
contact_groups sagroup
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
check_command check_tcp!80
}
define service{
host_name kyhack
service_description check-disk
check_command check_nrpe!check_df
max_check_attempts 4
normal_check_interval 3
retry_check_interval 2
check_period 24x7
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
contact_groups sagroup
}
define service{
host_name kyhack
service_description check-load
check_command check_nrpe!check_load
max_check_attempts 4
normal_check_interval 3
retry_check_interval 2
check_period 24x7
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
contact_groups sagroup
}
define service{
host_name kyhack
service_description total_procs
check_command check_nrpe!check_total_procs
max_check_attempts 4
normal_check_interval 3
retry_check_interval 2
check_period 24x7
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
contact_groups sagroup
}
现在都不知道是那里出了问题,,,
Checking contacts...
Error: Service notification command 'service-notify-by-email' specified for contact 'kyhack' is not defined anywhere!
Error: Host notification command 'host-notify-by-email' specified for contact 'kyhack' is not defined anywhere!
特别是这一个,,,请教一下,
contacts.cfg的内内容如下:
[root@rhel etc]# cat contacts.cfg
define contact {
contact_name kyhack
alias system administrator
use generic-contact
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands service-notify-by-email
host_notification_commands host-notify-by-email
email ky.vicp@163.com
# pager 13713996274
} |
|