服务端
一. nagios 的配置文件在 /usr/local/nagios/etc
1.vi cgi.cfg
refresh_rate=30 #nagios主页的刷新时间,我设置成30秒自动刷新
use_authentication=0 #关闭认证功能,当nagios配置好后,建议开回来
2.在配置文件/usr/local/nagios/etc/nagios.cfg
已经定义了所用主机文件都在servers
3.在servers 下创建新建主机目录
例:被监控的主机IP:192.168.66.221
[root@localhost etc]# cd /usr/local/nagios/etc/servers
[root@localhost servers]# vi 192.168.66.221.cfg
编辑内容为:
define service{
use generic-service
host_name 192.168.66.221 (被监控主机的IP)
service_description check_sda1
check_command check_nrpe!check_sda1
max_check_attempts 5
normal_check_interval 1
}
define host{
use linux-server
host_name 192.168.66.221 (被监控主机的IP)
alias 192.168.66.221 (被监控主机的IP)
address 192.168.66.221 (被监控主机的IP)
}
define service{
use generic-service
host_name 192.168.66.221 (被监控主机的IP)
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.66.221 (被监控主机的IP)
service_description check_ftp
check_command check_ftp!21
max_check_attempts 5
normal_check_interval 1
}
define service{
use generic-service
host_name 192.168.66.221 (被监控主机的IP)
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.66.221 (被监控主机的IP)
service_description check_http
check_command check_http
max_check_attempts 5
normal_check_interval 1
}
被监控端
在/usr/local/nagios/etc 下的nrpe.cfg
修改配置;server_address=192.168.66.221(本地IP)
allowed_hosts=192.168.211.129(服务端IP)
未完
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。