十三、配置services.cfg文件
define service{
use generic-service
host_name tecmint
service_description CPU Load
check_command check_nrpe!check_load
}
define service{
use generic-service
host_name tecmint
service_description Total Processes
check_command check_nrpe!check_total_procs
}
define service{
use generic-service
host_name tecmint
service_description Current Users
check_command check_nrpe!check_users
}
define service{
use generic-service
host_name tecmint
service_description SSH Monitoring
check_command check_nrpe!check_ssh
}
define service{
use generic-service
host_name tecmint
service_description FTP Monitoring
check_command check_nrpe!check_ftp
}
十四、配置hosts.cfg文件
## Default Linux Host Template ##
define host{
name linux-box ; Name of this template
use generic-host ; Inherit default values
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 30
notification_options d,r
contact_groups admins
register 0 ; DONT REGISTER THIS - ITS A TEMPLATE
}
## Default
define host{
use linux-box ; Inherit default values from a template
host_name tecmint ; The name we're giving to this server
alias CentOS 6.5 ; A longer name for the server
address 192.168.1.250 ; IP address of Remote Linux host
十五、检查配置并重启nagios
[root@www ~]# /usr/local/nagios/bin/nagios -v /etc/nagios/nagios.cfg
Total Warnings: 0
Total Errors: 0
[root@www ~]# service nagios restart 十六、在web页面上查看结果