CentOS 6.3_Nagios配置笔记
4、新建linux.cfg设置要监控的内容(address表示被监控的客户端IP) [root@nagios ~]# vim /usr/local/nagios/etc/object/services.cfg #定义被监控端名称和地址 define host{ use linux-server host_name server1 alias server1 address 192.168.7.93 } #定义被监控端服务 define service{ host_name server1 service_description check_ping check_command check_nrpe!check_ping max_check_attempts 5 normal_check_interval 3 retry_check_interval 2 check_period 24x7 notification_interval 10 notification_period 24x7 notification_options w,u,c,r } define service{ host_name server1 service_description check_users check_command check_nrpe!check_users max_check_attempts 5 normal_check_interval 3 retry_check_interval 2 check_period 24x7 notification_interval 10 notification_period 24x7 notification_options w,u,c,r } define service{ host_name server1 service_description check_load check_command check_nrpe!check_load max_check_attempts 5 normal_check_interval 3 retry_check_interval 2 check_period 24x7 notification_interval 10 notification_period 24x7 notification_options w,u,c,r } define service{ host_name server1 service_description check_disk_sda3 check_command check_nrpe!check_disk_sda3 max_check_attempts 5 normal_check_interval 3 retry_check_interval 2 check_period 24x7 notification_interval 10 notification_period 24x7 notification_options w,u,c,r } define service{ host_name server1 service_description check_zombie_procs check_command check_nrpe!check_zombie_procs max_check_attempts 5 normal_check_interval 3 retry_check_interval 2 check_period 24x7 notification_interval 10 notification_period 24x7 notification_options w,u,c,r } define service{ host_name server1 service_description check_total_procs check_command check_nrpe!check_total_procs max_check_attempts 5 normal_check_interval 3 retry_check_interval 2 check_period 24x7 notification_interval 10 notification_period 24x7 notification_options w,u,c,r } define service{ host_name server1 service_description check_swap check_command check_nrpe!check_swap max_check_attempts 5 normal_check_interval 3 retry_check_interval 2 check_period 24x7 notification_interval 10 notification_period 24x7 notification_options w,u,c,r } define service{ host_name server1 service_description check_http check_command check_nrpe!check_http max_check_attempts 5 normal_check_interval 3 retry_check_interval 2 check_period 24x7 notification_interval 10 notification_period 24x7 notification_options w,u,c,r } define service{ host_name server1 service_description check_ssh check_command check_nrpe!check_ssh max_check_attempts 5 normal_check_interval 3 retry_check_interval 2 check_period 24x7 notification_interval 10 notification_period 24x7 notification_options w,u,c,r } define service{ host_name server1 service_description check_mysql check_command check_nrpe!check_mysql max_check_attempts 5 normal_check_interval 3 retry_check_interval 2 check_period 24x7 notification_interval 10 notification_period 24x7 notification_options w,u,c,r } //对以上的linux.cfg文件编辑如果有错,将会导致nagios无法启动; 验证Nagios 配置文件 [root@nagios ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg (编辑:应用网_丽江站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |