Nagios的安裝
監控對於對於系統管理人員的日常運維工作來說是非常重要的,而比較知名的開源監控軟件有Ganglia、Cacti、Nagios、Zabbix等等,而本次就簡單的說下Nagios的安裝部署,因為Nagios是基於web頁面查看管理的,那可以選用lamp或者是lnmp這些比較容易實現的web系統框架來實現即可,Nagios的官網是:https://www.nagios.org/downloads/,當然下載版本建議用最新的穩定版。Nagios的監控實現是由各個插件來完成的它本身是沒有監控功能的,所以Nagios使用非常靈活,而在需要監控不同的平臺主機、硬件時用不同的插件,下面從網頁上找的一張圖能很好的說明:
從圖中得知Nagios監控中的插件SNMP在不同平臺的主機、硬件上都有用到,而Linux中有send-nsca和NRPE一般我們常用的是NRPE,監聽的是tcp的5666端口;而在Windows主機上使用的是NSClient++,監聽的是12489和5666端口,這一點很重要做為被監控的主機上一定要開放這些端口。
在安裝Nagios之前需要先安裝Nagios的監控主機(server端),然後再到被監控主機(clinet端)上安裝相應的插件。
1、server端:
在安裝之前先要檢查依賴包
[[email protected] ~]# yum -y groupinstall "Development Tools" "Development Libraries"#在配置好yum源的主機上,先檢查下開發包組是否安裝 [[email protected]
在依賴關系解決後就開始正常的Nagios安裝,先安裝Nagios的核心引擎和web頁面
[[email protected] ~]# groupadd -r nagcmd#添加nagcmd組 [[email protected] ~]# useradd -M -G nagcmd -r -s /sbin/nologin nagios [[email protected]