本帖最后由 820009174 于 2016-5-3 08:54 编辑
1、完成物理拓扑,确保桥接关系正确,因为监控服务器网络模式为NAT,路由器要和VMnet8桥接
2、配置相同网段的地址,确保互通
3、开启路由器的http、https、ssh服务
ip http server
ip http secure-server
ip domain name cisco
crypto key generate rsa label KEY module 1024
4、编辑nagios配置文件
cd /etc/nagios/conf.d/
vim 190.100.cfg
define host{
use generic-switch
; in (or inherited by) the linux-server host template definition.
host_name Gateway
alias Router
address 192.168.190.100
}
define service{
use generic-service
host_name 192.168.190.100
service_description check_ping
check_command check_ping!100.0,20%!200.0,50%
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service
host_name 192.168.190.100
service_description check_ssh
check_command check_ssh
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service
host_name 192.168.190.100
service_description check_tcp
check_command check_tcp
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service
host_name 192.168.190.100
service_description check_http
check_command check_http
max_check_attempts 5
normal_check_interval 1
notification_interval 60
}
service nagios restart
5、web查看监控效果
host:
service:
这里的监控tcp服务显示UNKNOWN,我觉得可能是因为tcp不是具体的服务监控项。
6、在R1写ACL封掉icmp
access-list 100 deny icmp host 192.168.190.129 host 192.168.190.128
interface f0/0
ip access-group 100 in
在Nagios即可检测到icmp服务中断。
1、完成物理拓扑,确保桥接关系正确,因为监控服务器网络模式为NAT,路由器要和VMnet8桥接
2、配置相同网段的地址,确保互通
3、开启路由器的http、https、ssh服务
ip http server
ip http secure-server
ip domain name cisco
crypto key generate rsa label KEY module 1024
4、编辑nagios配置文件
cd /etc/nagios/conf.d/
vim 190.100.cfg
define host{
use generic-switch
; in (or inherited by) the linux-server host template definition.
host_name Gateway
alias Router
address 192.168.190.100
}
define service{
use generic-service
host_name 192.168.190.100
service_description check_ping
check_command check_ping!100.0,20%!200.0,50%
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service
host_name 192.168.190.100
service_description check_ssh
check_command check_ssh
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service
host_name 192.168.190.100
service_description check_tcp
check_command check_tcp
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service
host_name 192.168.190.100
service_description check_http
check_command check_http
max_check_attempts 5
normal_check_interval 1
notification_interval 60
}
service nagios restart
5、web查看监控效果
host:
service:
这里的监控tcp服务显示UNKNOWN,我觉得可能是因为tcp不是具体的服务监控项。
6、在R1写ACL封掉icmp
access-list 100 deny icmp host 192.168.190.129 host 192.168.190.128
interface f0/0
ip access-group 100 in
在Nagios即可检测到icmp服务中断。
编辑回复