- 监控客户端81,82,22, 来自:网络
- [root@svr4 ~]# vim /usr/local/nagios/etc/objects/hosts.cfg
- define host {
- host_name svr1.labexam.com
- alias svr1
- address 10.1.1.10
- contact_groups sagroup
- check_command check-host-alive
- check_command nrpe!check_users
- check_command nrpe!check_total_procs
- check_command nrpe!check_load
- max_check_attempts 4
- notification_interval 5
- notification_period 24x7
- notification_options d,u,r
- }
- [root@svr4 objects]# vim svr1_services.cfg
- define service {
- host_name svr1.labexam.com
- service_description ALIVE
- check_period 24x7
- max_check_attempts 2
- normal_check_interval 2
- retry_check_interval 1
- contact_groups sagroup
- notification_interval 5
- notification_period 24x7
- notification_options w,u,c,r
- check_command check-host-alive nagios培训
- }
- define service {
- host_name svr1.labexam.com
- service_description SSH
- check_period 24x7
- max_check_attempts 2
- normal_check_interval 1
- retry_check_interval 2
- contact_groups sagroup
- notification_interval 5
- notification_period 24x7
- notification_options w,u,c,r
- check_command check_tcp!22
- }
- define service {
- host_name svr1.labexam.com
- service_description HTTP_81
- check_period 24x7
- max_check_attempts 2
- normal_check_interval 1
- retry_check_interval 1
- contact_groups sagroup
- notification_interval 5
- notification_period 24x7
- notification_options w,u,c,r
- check_command check_tcp!81 nagios实施
- }
- define service {
- host_name svr1.labexam.com
- service_description HTTP_82
- check_period 24x7
- max_check_attempts 2
- normal_check_interval 1
- retry_check_interval 1
- contact_groups sagroup
- notification_interval 5
- notification_period 24x7
- notification_options w,u,c,r
- check_command check_tcp!82
- }
- define service {
- host_name svr1.labexam.com
- service_description FASTCGI
- check_period 24x7
- max_check_attempts 2
- normal_check_interval 1
- retry_check_interval 1
- contact_groups sagroup
- notification_interval 5
- notification_period 24x7
- notification_options w,u,c,r
- check_command check_tcp!9000 监控软件
- }
- define service {
- host_name svr1.labexam.com
- service_description DISK
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 2
- retry_check_interval 2
- contact_groups sagroup
- notification_interval 2
- notification_period 24x7
- notification_options w,u,c,r
- check_command nrpe!check_df
- }
- define service {
- host_name svr1.labexam.com
- service_description LOAD
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 2
- retry_check_interval 2
- contact_groups sagroup
- notification_interval 2
- notification_period 24x7
- notification_options w,u,c,r
- check_command nrpe!check_load nagios配置
- }
- define service {
- host_name svr1.labexam.com
- service_description LOGOIN
- check_period 24x7
- max_check_attempts 2
- normal_check_interval 1
- retry_check_interval 1
- contact_groups sagroup
- notification_interval 5
- notification_period 24x7
- notification_options w,u,c,r
- check_command nrpe!check_users
- }
- [root@svr4 objects]# vim /usr/local/nagios/etc/nagios.cfg 开源监控软件
- 增加一条:
- cfg_file=/usr/local/nagios/etc/objects/svr1_services.cfg
- [root@svr4 objects]# /etc/init.d/nagios reload nagios安装
- Running configuration check...done.
- Reloading nagios configuration...done
[ /attachment/201108/230059791.png][ /uploads/img/201502/09231445_L4kU.png][/url][/url]
想做Nagios, Zabbix,Cacti,iTop各种交流的,可以进入开源监控工具Nagios交流 QQ群号 :476809427
|