加入收藏 | 设为首页 | 会员中心 | 我要投稿 济南站长网 (https://www.0531zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

CentOS 6.3_Nagios配置笔记

发布时间:2016-09-14 06:00:54 所属栏目:Linux 来源:站长网
导读:一、Nagios监控主机配置(IP:192.168.7.249) 1、安装nrpe服务 解压缩 [root@nagios ~]# tar -zxvf nrpe-2.14.tar.gz [root@nagios ~]# cd nrpe-2.14 编译 [[root

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

(编辑:济南站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读