[root@nagios objects]# vi hosts.cfg
# Define a host for the local machine
define host{
use linux-server
host_name 1.3-samba
alias 1.3-samba
address 10.89.1.3
}
define host{
use linux-server
host_name 1.2-nagios
alias 1.2-nagios
address 10.89.1.2
}
define host{
use linux-server
host_name 1.34-web-lnmp
alias 1.34-web-lnmp
address 10.89.1.34
}
define host{
use linux-server
host_name 1.34-web
alias 1.34-web
address 10.89.1.34
}
# Define an optional hostgroup for Linux machines
define hostgroup{
hostgroup_name linux-servers ; The name of the hostgroup
alias Linux Servers ; Long name of the group
members 1.3-samba,1.2-nagios,1.34-web-lnmp,1.34-web
}
Things look okay - No serious problems were detected during the pre-flight check
OK.
[root@nagios objects]#
如果报下面错误:
Error:Service check command 'check_nrpe' specified in service 'Disk Partition' for
host '10-client01' not defined anywhere!
则编辑commands.cfg 文件:
[root@nagios objects]# vi commands.cfg
如果登录后提示错误:
It appears as though you do not have permission to view information for any of the hosts you requested...
If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.
编辑 cgi.cfg
[root@nagios objects]# cd ../
[root@nagios etc]# vi cgi.cfg
# PHYSICAL HTML PATH
# This is the path where the HTML files for Nagios reside. This
# value is used to locate the logo images needed by the statusmap
# and statuswrl CGIs.