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

监控客户端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
}
 
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
}
 
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
}
 
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
Running configuration check...done.
Reloading nagios configuration...done

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/wyyypg.html