zoukankan      html  css  js  c++  java
  • nagios 插件ndoutils 安装配置

    nagios 插件ndoutils 安装配置

     原文地址:http://www.cnblogs.com/caoguo/p/5022645.html

    # Nagios install ndoutils
    
    # 安装ndoutils插件
    [root@Cagios ~]# yum install -y mysql-devel perl-DBD-MySQL
    [root@Cagios ~]# wget http://nchc.dl.sourceforge.net/project/nagios/ndoutils-2.x/ndoutils-2.0.0/ndoutils-2.0.0.tar.gz
    
    [root@Cagios src]# tar zxf ndoutils-2.0.0.tar.gz 
    [root@Cagios src]# cd ndoutils-2.0.0
    [root@Cagios ndoutils-2.0.0]# ./configure --prefix=/usr/local/nagios 
    --with-ndo2db-user=nagios --with-ndo2db-group=nagcmd
    
    [root@Cagios ndoutils-2.0.0]# make && make install
    
    [root@Cagios ndoutils-2.0.0]# cp daemon-init /etc/init.d/ndo2db
    [root@Cagios ndoutils-2.0.0]# chmod 755 /etc/init.d/ndo2db
    [root@Cagios ndoutils-2.0.0]# cp config/ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg
    [root@Cagios ndoutils-2.0.0]# cp config/ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg
    [root@Cagios ndoutils-2.0.0]# chown nagios.nagcmd /usr/local/nagios/etc/ndo*
    [root@Cagios ndoutils-2.0.0]# chmod 664 /usr/local/nagios/etc/ndo*
    
    
    # 建立数据库及数据帐户
    [root@Cagios ~]# mysql -uroot -p
    Enter password: 
    mysql> create database nagios;
    mysql> create user nagios@localhost identified by 'nagios';
    mysql> grant all on nagios.* to nagios@localhost;
    mysql> flush privileges;
    mysql> quit
    
    
    # 导入表结构
    [root@Cagios ndoutils-2.0.0]# cd db/
    [root@Cagios db]# ./installdb -u nagios -p nagios -h localhost -d nagios
    
    # ndo2db配置数据连接
    [root@Cagios ~]# cd /etc/nagios/
    [root@Cagios nagios]# vi ndo2db.cfg
    ndo2db_user=nagios
    ndo2db_group=nagcmd
    
    db_name=nagios
    db_user=nagios
    db_pass=nagios
    [root@Cagios ~]# /etc/init.d/ndo2db start
    
    
    # nagios与ndoutils通信
    [root@Cagios nagios]# vi nagios.cfg
    broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg
    
    [root@Cagios ~]# /etc/init.d/nagios restart

    #重启nagios,nagios日志输出应该如下

    #查看下数据库

    数据存入数据时ok的,结束!!!

  • 相关阅读:
    C#概述
    作为一个程序员小小感悟!!
    c# 合并两个DataTable
    C# FastReport .NET打印
    c# System.Net.Sockets =》TcpListener用法
    开博第一章
    Vue 报错 Uncaught (in promise)
    ASP.NET MVC 中的过滤器
    SpringBoot 打包成war
    SprintBoot 实现上传下载
  • 原文地址:https://www.cnblogs.com/caoguo/p/5022645.html
Copyright © 2011-2022 走看看