您好,登錄后才能下訂單哦!
CentOS下主要監(jiān)控軟件的區(qū)別可參考http://os.51cto.com/art/201104/252820.htm
在這里總結(jié)下nagios的安裝配置.
1.安裝必要組件:
yum -y install httpd php php-gd freetype php-mysql php-snmp php-devel mysql mysql-server perl-DBD-MySQL php-pdo net-snmp net-snmp-libs net-snmp-utils net-snmp-devel ruby ruby-devel gcc glibc glibc-common gd gd-devel ntp openssl openssl-devel
2.關(guān)閉selinux和iptables.
3.安裝nagios:
----創(chuàng)建nagios用戶和組:
[root@web1 ~]# useradd nagios
[root@web1 ~]# groupadd nagcmd
[root@web1 ~]# usermod –a -G nagcmd nagios
----下載nagios程序和nagios插件
[root@web1 ~]# wget http://jaist.dl.sourceforge.net/project/nagios/nagios-3.x/nagios-3.5.0/nagios-3.5.0.tar.gz
[root@web1 ~]# wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.16.tar.gz
----解壓nagios程序和插件
[root@web1 ~]# tar zxvf nagios-3.5.0.tar.gz
[root@web1 ~]# tar zxvf nagios-plugins-1.4.16.tar.gz
----安裝nagios程序
[root@web1 ~]#cd nagios
[root@web1 nagios]#./configure --with-command-group=nagcmd
[root@web1 nagios]#make all
[root@web1 nagios]#make install
[root@web1 nagios]#make install-init
[root@web1 nagios]#make install-config
[root@web1nagios]#make install-commandmode
[root@web1 nagios]#make install-webconf
注意:
make install 用于安裝主要的程序、CGI及HTML文件
make install-init 用于生成init啟動腳本
make install-config 用于安裝示例配置文件
make install-commandmode 用于設(shè)置相應(yīng)的目錄權(quán)限
make install-webconf 用于安裝Apache配置文件
復(fù)制eventhandlers:
[root@web1 nagios]# cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
[root@web1 libexec]# chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
校驗nagios配置文件是否配置有誤:
[root@web1 libexec]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
添加修改http訪問頁面用戶nagiosadmin及密碼123456
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
啟動nagios:
/etc/init.d/nagios start
/etc/init.d/httpd start
----安裝nagios插件
[root@web1 ~]# cd nagios-plugins-1.4.16
[root@web1 nagios-plugins-1.4.16]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
[root@web1 nagios-plugins-1.4.16]# make
[root@web1 nagios-plugins-1.4.16]# make install
----通過web訪問nagios:
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。