在另一台主机(Xubuntu 16.04)上遵循相同的说明,但似乎在Nagios Server中不可见。
以下是nagios服务器hosts.cfg和services.cfg文件的快照。
[root@agent2 etc]# cat 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 jim-Ubuntu1504 ; The name we're giving to this server
alias Ubuntu 16.04 ; A longer name for the server
address 192.168.1.2 ; IP address of Remote Linux host
}
## Default
define host{
use linux-box ; Inherit default values from a template
host_name jim-VirtualBox ; The name we're giving to this server
alias Xubuntu 16.04 ; A longer name for the server
address 192.168.1.11 ; IP address of Remote Linux host
[root@agent2 etc]#
[root@agent2 etc]# cat services.cfg
define service{
use generic-service
host_name jim-Ubuntu1504
service_description CPU Load
check_command check_nrpe!check_load
}
define service{
use generic-service
host_name jim-Ubuntu1504
service_description Total Processes
check_command check_nrpe!check_total_procs
}
define service{
use generic-service
host_name jim-Ubuntu1504
service_description Current Users
check_command check_nrpe!check_users
}
define service{
use generic-service
host_name jim-Ubuntu1504
service_description SSH Monitoring
check_command check_nrpe!check_ssh
}
define service{
use generic-service
host_name jim-Ubuntu1504
service_description FTP Monitoring
check_command check_nrpe!check_ftp
}
define service{
use generic-service
host_name jim-VirtualBox
service_description CPU Load
check_command check_nrpe!check_load
}
define service{
use generic-service
host_name jim-VirtualBox
service_description Total Processes
check_command check_nrpe!check_total_procs
}
define service{
use generic-service
host_name jim-VirtualBox
service_description Current Users
check_command check_nrpe!check_users
}
define service{
use generic-service
host_name jim-VirtualBox
service_description SSH Monitoring
check_command check_nrpe!check_ssh
}
define service{
use generic-service
host_name jim-VirtualBox
service_description FTP Monitoring
check_command check_nrpe!check_ftp
}
[root@agent2 etc]#
不确定发生了什么,因为在Nagios服务器中无法看到Xubuntu(jim-Virtualbox)。
非常感谢任何帮助。
P.S:NRPE正在代理上运行。
root@jim-VirtualBox:/tmp/nagios-plugins-2.1.1/nrpe-2.15# netstat -nap|grep nrpe
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 11019/nrpe
tcp6 0 0 :::5666 :::* LISTEN 11019/nrpe
unix 2 [ ] DGRAM 46618 11019/nrpe
root@jim-VirtualBox:/tmp/nagios-plugins-2.1.1/nrpe-2.15#
root@jim-VirtualBox:/tmp/nagios-plugins-2.1.1/nrpe-2.15#