V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
coolcokel
V2EX  ›  问与答

系统信息: Description: Ubuntu 16.04.4 LTS 安装 nagios

  •  
  •   coolcokel · 2018-10-22 19:55:32 +08:00 · 825 次点击
    这是一个创建于 2027 天前的主题,其中的信息可能已经有所发展或是发生改变。
    服务器端:
    安装基础环境:
    add-apt-repository ppa:ondrej/php
    apt-get update
    apt-get install apache2
    apt-get install php5.6
    用户和组配置
    Useradd nagios
    Groupadd nagcmd
    Usermod -a -G nagcmd nagios
    usermod -a -G nagios,nagcmd www-data
    安装 Nagios
    1.下载源文件
    cd ~
    wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.2.0.tar.gz
    tar -xzf nagios*.tar.gz
    cd nagios-4.2.0
    2.编译 Nagios
    构建 Nagios 之前,必须使用用户和之前创建的组来配置它
    ./configure --with-nagios-group=nagios --with-command-group=nagcmd
    make all
    sudo make install
    sudo make install-commandmode
    sudo make install-init
    sudo make install-config
    /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-available/nagios.conf
    并将 evenhandler 目录复制到 nagios 目录中:
    cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
    chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
    3.安装 nagios 插件
    cd ~
    wget https://nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz
    tar -xzf nagios-plugins*.tar.gz
    cd nagios-plugin-2.1.2/
    ./configure --prefix=/data/program/nagios --with-nagios-user=nagios --with-nagios-group=nagios && make && make install
    测试已安装的插件,修改 nagios.cfg 的配置文件,service_check_timeout=300
    cd /data/program/nagios/libexec/
    ./check_ping -H www.baidu.com -w 100.0,10% -c 100.0,30% -p 10 -t 2
    报错 CRITICAL - Plugin timed out 待解决

    自己动手搭建 nagios 服务器端参考网上教程做的,进行到这一步卡住了,修改 nagios.cfg 的配置文件,service_check_timeout=300 也试了,问题描述不清楚的还望指教!
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5498 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 05:55 · PVG 13:55 · LAX 22:55 · JFK 01:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.