86565656 发表于 2019-1-16 10:47:50

nagios监控客户端应用81,82,22


[*]监控客户端81,82,22,
[*]# 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
[*]}
[*]
[*]
[*]# 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
[*]}
[*]
[*]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_descriptionHTTP_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
[*]}
[*]
[*]define service {
[*]      host_name svr1.labexam.com
[*]      service_descriptionHTTP_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
[*]}
[*]
[*]define service {
[*]      host_name svr1.labexam.com
[*]      service_descriptionLOGOIN
[*]      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
[*]}
[*]
[*]# vim /usr/local/nagios/etc/nagios.cfg
[*]增加一条:
[*]cfg_file=/usr/local/nagios/etc/objects/svr1_services.cfg
[*]
[*]# /etc/init.d/nagios reload
[*]Running configuration check...done.
[*]Reloading nagios configuration...done

http://blog.运维网.com/attachment/201108/230059791.png



页: [1]
查看完整版本: nagios监控客户端应用81,82,22