linux下Nagios的安裝和配置

來源:互聯網
上載者:User

標籤:參考   byte   response   star   href   yum   htpasswd   forbidden   rtt   

Nagios是企業普遍使用的最具影響力的網路資訊監視系統之一,它可以動態監視指定的網路狀態,並在狀態異常時發出警告音或郵件警示通知營運人員。監控的類型和警報定時器是完全可定製的。

Nagios的另一強大功能是它能同時監測主機和服務。例如,它可以同時監測到IP地址和TCP/UDP連接埠號碼。為進一步闡述此功能,我們假定有台需要監測的web伺服器,Nagios可運用在伺服器上基於IP/伺服器名運行ping命令的方法檢測伺服器是否線上,同時當伺服器的RTT(往返時延)增加時,Nagios會隨時警示。另外,Nagios還能檢測TCP的80連接埠(web伺服器)是否可達,比如可能出現伺服器線上但Apache/IIS沒有響應的情況。

而基於Nagios的第三方監測工具如Centreon, FAN , op5 Monitor 在介面設計,自動化運行和支援人員方面在獨立的Nagios引擎基礎上提供了相應的補充。

centos7下

先安裝所有需要的套件

yum install httpd php php-cli gd gd-devel gcc glibc glibc-common net-snmp wget

# useradd nagios# passwd nagios# groupadd nagcmd# usermod -a -G nagcmd nagios# usermod -a -G nagcmd apache

建立使用者以及使用者組

# cd /usr/local/src# wget http://liquidtelecom.dl.sourceforge.net/project/nagios/nagios-4.x/nagios-4.0.8/nagios-4.0.8.tar.gz# tar xzf nagios-4.0.8.tar.gz# cd nagios-4.0.8# ./configure –with-command-group=nagcmd# make all# make install# make install-init# make install-config# make install-commandmode# make install-webconf

安裝nagios

d /usr/local/src# wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz# tar xzf nagios-plugins-2.0.3.tar.gz# cd nagios-plugins-2.0.3# ./configure –with-nagios-user=nagios –with-nagios-group=nagios# make# make install

安裝外掛程式

# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin# systemctl start httpd# systemctl enable httpd

設定密碼,啟動httpd服務

# systemctl start nagios# systemctl enable nagios

啟動nagios並設定開機自啟動

下面是用yum下載

yum install nagios nagios-plugins

1、本機監控HTTP SSH的Notifications顯示警告錯誤,解決方案:

#vim /usr/local/nagios/etc/objects/localhost.cfg

define service{
use local-service ; Name of service template to use
host_name localhost
service_description SSH
check_command check_ssh
notifications_enabled 1  #改為1,即可
}

 

# Define a service to check HTTP on the local machine.
# Disable notifications for this service by default, as not all users may have HTTP enabled.

define service{
use local-service ; Name of service template to use
host_name localhost
service_description HTTP
check_command check_http
notifications_enabled 1 #改為1,即可
}

 

2、Nagios顯示類似錯誤:HTTP WARNING: HTTP/1.1 403 Forbidden - 5240 bytes in 0.002 second response time。

該錯誤表明在apache web根目錄沒有index.html檔案。解決方案:在web根目錄(如:/var/www/html/目錄)建立index.html檔案,重啟apache和nagios即可。

參考自https://www.phpini.com/linux/rhel-centos-7-install-nagios

http://www.sosidc.com/post-41.html

linux下Nagios的安裝和配置

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.