您好,登錄后才能下訂單哦!
這篇文章主要為大家展示了“CentOS/RHEL 5平臺如何安裝FAN nagios”,內容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領大家一起研究并學習一下“CentOS/RHEL 5平臺如何安裝FAN nagios”這篇文章吧。
一、FAN是一個基于centos的迷你版系統,可以直接下載iso鏡像安裝。它也可以安裝在redhat平臺上,FAN 2.1一般都是安裝在redhat 5.x平臺的32位系統上。
官網:http://www.fullyautomatednagios.org/download/
二、配置網絡和dns
1.network
[root@oracle64 Desktop]# cat /etc/sysconfig/network-scripts/ifcfg-eth4
2.dns
[root@oracle64 Desktop]# cat /etc/resolv.conf
search localdomain
nameserver 210.21.4.130
nameserver 221.5.88.88
二、安裝在32位的系統上很簡單
1.安裝 epel-release
[root@oracle64 Desktop]# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
2.安裝 Graphviz repo :
[root@oracle64 Desktop]# cd /etc/yum.repos.d/
[root@oracle64 Desktop]# wget http://www.graphviz.org/graphviz-rhel.repo
3.安裝 FAN repo :
[root@oracle64 Desktop]# wget http://www.fullyautomatednagios.org/FAN/repository/2.4/i386/fan-repo-2.4-fan.1.noarch.rpm
[root@oracle64 Desktop]# yum localinstall --nogpgcheck fan-repo-2.4-fan.1.noarch.rpm
4.64位系統不能這樣安裝,需要fan_nagios_x86_64.repo.tar.gz包(這個包是我自己新建了一個源),把該包直接解壓縮到/etc/yum.repos.d/文件夾即可
三、安裝 stable version 2.4
FAN standalone
[root@oracle64 Desktop]# yum install fan-standalone
FAN poller
[root@oracle64 Desktop]# yum install fan-poller
FAN central
[root@oracle64 Desktop]# yum install fan-central
FAN database
[root@oracle64 Desktop]# yum install fan-database
四、用PNP繪制歷史曲線
Pnp是一個基于php和perl,用rrdtool將nagios采集的數據繪制圖表的工具,所以安裝pnp之前必須先安裝php、perl和rrdtool。
2.安裝需要的插件
yum -y install gcc-c++
yum -y install libxml2-devel
yum -y install pango*
3.安裝cgilib
tar zxvf cgilib-0.5.tar.gz
cd cgilib-0.5
cp cgi.h /usr/include
4.安裝rrdtool
tar zxvf rrdtool-1.4.5.tar.gz
cd rrdtool
./configure
make all
make install
5.編輯文件添加到最后面
vi /etc/httpd/conf/http.conf
Alias /pnp "/usr/local/nagios/share/pnp"
<Directory "/usr/local/nagios/share/pnp">
Options None
AllowOverride None
Order allow,deny
Allow from all
Authname "nagios access"
Authuserfile /etc/nagios/htpasswd.users
Require valid-user
Authtype basic
</Directory>
6.啟動apache和nagios就ok了,瀏覽器訪問http://ip/nagios,nagios默認用戶名密碼都是nagiosadmin
五、報錯
1.網卡流量報錯:Return code of 127 is out of bounds - plugin may be missing
/usr/lib/nagios/plugins/該文件夾下面缺少流量檢查腳本,然后賦權
ll /usr/lib/nagios/plugins/check_traffic.sh
cd /usr/lib/nagios/plugins
chmod 777 -R plugins
chown -R nagios.nagios plugins
2.vi /etc/httpd/conf/httpd.conf
找到#ServerName www.example.com:80 把#去掉,再重啟apache即可
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 172.16.195.101 for ServerName
3.nagios告警全部關掉模塊報錯
Error: Could not stat() command file '/var/log/nagios/rw/nagios.cmd'!
拷貝一個nagios.cmd文件到下面目錄,然后賦權解決
chmod -R 777 /var/log/nagios/rw/
4.CHECK_NRPE: Error - Could not complete SSL handshake.
vi /usr/local/nagios/etc/nrpe.cfg
添加nagios IP地址210.31.118.245
然后重啟nrpe
5.這些是只有210.31.118.245 機器ping不通,那就是防火墻屏蔽了,添加
PING CRITICAL - Packet loss = 100%
/sbin/iptables -A INPUT -p icmp -s 210.31.118.245 -j ACCEPT
6.這些都是5666端口telnet不通的,也是防火墻屏蔽了
CHECK_NRPE: Socket timeout after 10 seconds.
CHECK_NRPE: Socket timeout after 10 seconds.
/sbin/iptables -A INPUT -p tcp --dport 5666 -i eth2 -j ACCEPT
以上是“CentOS/RHEL 5平臺如何安裝FAN nagios”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。