CentOS 7.3 安裝 Nagios 4.3.4 和 Nagios Plugins 2.2.1

來源:互聯網
上載者:User

標籤:centos 7.3   nagios   nagios plugins   

安裝要求:

1. 純淨迷你安裝 CentOS 7.3

2. 使用 root 使用者登入系統

3. 有IP地址,系統能串連公網



安裝依賴包及工具軟體

# yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp unzip


下載 Nagios Core 和 Nagios Plugins

# cd /tmp

# wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.3.4.tar.gz

# wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz


添加Nagios使用者和組

# useradd nagios

# groupadd nagcmd

# useradd -a -G nagcmd nagios

# usermod -a -G nagios,nagcmd apache


安裝 Nagios Core

解壓安裝包

# tar zxvf nagios-4.3.4.tar.gz

# tar zxvf nagios-plugins-2.2.1.tar.gz


轉到Nagios Core安裝目錄

# cd nagios-4.3.4

# ./configure --with-command-group=nagcmd


*** Configuration summary for nagios 4.3.4 2017-08-24 ***:


 General Options:

 -------------------------

        Nagios executable:  nagios

        Nagios user/group:  nagios,nagios

       Command user/group:  nagios,nagcmd

             Event Broker:  yes

        Install ${prefix}:  /usr/local/nagios

    Install ${includedir}:  /usr/local/nagios/include/nagios

                Lock file:  /run/nagios.lock

   Check result directory:  ${prefix}/var/spool/checkresults

           Init directory:  /etc/rc.d/init.d

  Apache conf.d directory:  /etc/httpd/conf.d

             Mail program:  /bin/mail

                  Host OS:  linux-gnu

          IOBroker Method:  epoll


 Web Interface Options:

 ------------------------

                 HTML URL:  http://localhost/nagios/

                  CGI URL:  http://localhost/nagios/cgi-bin/

 Traceroute (used by WAP):  



Review the options above for accuracy.  If they look okay,

type ‘make all‘ to compile the main program and CGIs.


# make all

# make install 

# make install-init 

# make install-config 

# make install-commandmode 

# make install-webconf 

# cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/

# chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers

# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

# systemctl start nagios

# systemctl start httpd



建立 Web 存取使用者

# htpasswd –c /usr/local/nagios/etc/htpasswd.users nagiosadmin


安裝 Nagios Plugin

# cd /tmp

# tar zxvf nagios-plugins-2.2.1.tar.gz

# cd nagios-plugins-2.2.1

# ./configure --with-nagios-user=nagios --with-nagios-group=nagios 

# make 

# make install 


設定 Nagios 開機啟動服務


# chkconfig --add nagios

# chkconfig --level 35 nagios on

# systemctl enable httpd


配置防火牆

# firewall-cmd --permanent --add-service=http

# firewall-cmd --reload


訪問 Nagios Web 介面


http://<your.nagios.server.ip>/nagios



參考官方安裝文檔:

https://assets.nagios.com/downloads/nagioscore/docs/Installing_Nagios_Core_From_Source.pdf

本文出自 “望雲眷蜀” 部落格,請務必保留此出處http://wyjs6.blog.51cto.com/465920/1963380

CentOS 7.3 安裝 Nagios 4.3.4 和 Nagios Plugins 2.2.1

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.