Nagios 監控系列學習 —— 簡介和安裝

來源:互聯網
上載者:User

標籤:硬體   mysql   伺服器   資訊   監視軟體   


1、nagios特點:監控伺服器狀態; 警示功能強大; 繪圖功能較弱需要藉助其他外掛程式實現或整合其他監視軟體。


2、nagios的五種狀態:OK WARNNING CRITICAL UNKNOWN PENDING

OK : 正常

WARNNING: 警告 (一般超過閾值)

CRITICAL:嚴重警告(主機或服務宕掉或超過規定閾值)

UNKNOWN:未知

PENDING: 待定(一般添加新服務初始狀態)


3、監控頁面:650) this.width=650;" src="http://s2.51cto.com/wyfs02/M01/7F/42/wKiom1cYHwmz6uugAAIOr_qWT5Q259.png" title="2.png" alt="wKiom1cYHwmz6uugAAIOr_qWT5Q259.png" />


nagios不僅監控和顯示服務或主機的狀態,還會顯示相關資訊,但不能繪圖來顯示趨勢等


4、架構:

650) this.width=650;" src="http://s4.51cto.com/wyfs02/M00/7F/42/wKiom1cYHHijA-1sAAOqd2eSQN8661.png" title="1.png" alt="wKiom1cYHHijA-1sAAOqd2eSQN8661.png" />


nagios伺服器端主要的組件:nagios 和nagios plugins(需要apache或nginx以及php的支援,如果需要監控mysql則需要安裝mysql等)


5、監控方式:

主動式監控:被監控伺服器提供對外服務,例如:WEB服務等,監控端可通過相應外掛程式直接探測,根據返回資訊進行狀態判斷,此種方式不需要被監控端安裝任何外掛程式或做任何特殊配置。

(半)被動監控方式:例如 被監控的硬體資源、溫度等資訊,監控端不能直接探測,只能通過在被監控端安裝相關擷取資訊的外掛程式來實現,例如:NRPE、snmp等,但由於探測動作是由監控端發起,所以屬於半被動監控(以監控端審視),被動監控方式有NSCA等,監控端處於監控狀態,監控資訊完全由被監控端放主動發送。


NRPE:可監控linux/unix和windows,linux/unix需要安裝nrpe和nagios plugins(nrpe依賴plugins)

windows需要安裝nsclient+,此軟體提供NRPE功能(還有其他,例如check_nt等)

使用方式:被監控端的nrpe預設監控tcp 5666連接埠,監控端使用外掛程式check_nrpe指令直接遠程調用被監控端已有的外掛程式擷取相關資訊,因此,被監控端需要提前配置好檢測資訊的相關外掛程式(指令)

snmp:主要用來監控交換器路由器等互連裝置


6、安裝

[[email protected] ~]# yum install -y httpd php php-devel php-mysql mysql-devel mysql-server

mysql相關組件選擇性安裝

建立相關使用者和組:

[[email protected] ~]# groupadd nagcmd[[email protected] ~]# useradd -G nagcmd nagios[[email protected] ~]# passwd nagios[[email protected]  ~]#  usermod -a -G nagcmd apache  #將運行apache的使用者添加到nagcmd組中

編譯安裝nagios

[[email protected]  ~]#  ./configure --prefix=/usr/local/nagios --with-command-group=nagcmd --enable-event-broker[[email protected]  ~]# [[email protected]  ~]# make all[[email protected]  ~]# make install[[email protected]  ~]# make install-init[[email protected]  ~]# make install-commandmode[[email protected]  ~]# make install-config[[email protected]  ~]# [[email protected]  ~]# make install-webconf  #產生nagios網頁相關設定檔 /etc/httpd/conf.d/nagios.conf [[email protected]  ~]#


建立訪問nagios的使用者名稱和密碼:

[[email protected]  ~]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin[[email protected]  ~]#

註:驗證檔案和使用者名稱最好使用此預設,如果修改了驗證檔案請在 /etc/httpd/conf.d/nagios.conf中修改相關項目,如果想使用其他賬戶請修改 /usr/local/nagios/cgi.cfg相關選項, 如下:

[[email protected] etc]# cat cgi.cfg  | grep nagiosadminauthorized_for_system_information=nagiosadminauthorized_for_configuration_information=nagiosadminauthorized_for_system_commands=nagiosadminauthorized_for_all_services=nagiosadminauthorized_for_all_hosts=nagiosadminauthorized_for_all_service_commands=nagiosadminauthorized_for_all_host_commands=nagiosadmin[[email protected] etc]#




本文出自 “逆行者” 部落格,請務必保留此出處http://lingyi.blog.51cto.com/2837715/1766070

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.