您好,登錄后才能下訂單哦!
1、操作系統(tǒng)準(zhǔn)備:
系統(tǒng):CentOS x86_64 6.2最小化安裝
安裝httpd、php及編譯工具等基本軟件:
[root@nagiostest ~]# yum -y install php-mysql mysql perl mysql-server perl-DBI perl-DBD-MySQL httpd gcc glibc glibc-common gd gd-devel php openssl openssl-devel |
2、準(zhǔn)備軟件:
下載nagios-plugins
[root@nagiostest ~]#wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.16/nagios-plugins-1.4.16.tar.gz/download |
[root@nagiostest ~]# tar -zxvf nagios-plugins-1.4.16.tar.gzt |
[root@nagiostest ~]#wget http://sourceforge.net/projects/nagios-cn/files/sourcecode/zh_CN%203.2.3/nagios-cn-3.2.3.tar.bz2/download |
解壓:
[root@nagiostest ~]# tar -jxvf nagios-cn-3.2.3.tar.bz2 |
[root@nagiostest ~]# ls
anaconda-ks.cfg nagios-cn-3.2.3 nagios-plugins-1.4.16.tar.gz
install.log nagios-cn-3.2.3.tar.bz2 install.log.syslog nagios-plugins-1.4.16
|
[root@nagiostest ~]#groupadd nagcmd /*建立組nagcmd*/ [root@nagiostest ~]#usermod –G nagcmd apache /*添加用戶apache到組nagcmd*/ [root@nagiostest ~]#useradd -G nagcmd nagios /*新建用戶nagios并添加到組nagcmd*/ [root@nagiostest ~]#passwd nagios /*修改nagios密碼*/ |
[root@nagiostest ~]# cd nagios-cn-3.2.3 [root@nagiostest nagios-cn-3.2.3]# ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios --with-command-group=nagcmd [root@nagiostest nagios-cn-3.2.3]#make && make install [root@nagiostest nagios-cn-3.2.3]#make install-init [root@nagiostest nagios-cn-3.2.3]#make install-commandmode [root@nagiostest nagios-cn-3.2.3]#make install-config |
5、 編譯安裝nagios- plugins
[root@nagiostest ~]# cd nagios-plugins-1.4.16 [root@nagiostest nagios-plugins-1.4.16]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios [root@nagiostest nagios-plugins-1.4.16]# make && make install |
[root@nagiostest ~]#htpasswd -c /usr/local/nagios/etc/htpasswd nagiosadmin |
[root@nagiostest ~]#chkconfig --add nagios [root@nagiostest ~]#chkconfig nagios on [root@nagiostest ~]#chkconfig httpd on [root@nagiostest ~]#chkconfig mysqld on [root@nagiostest ~]#service httpd start [root@nagiostest ~]#service nagios start [root@nagiostest ~]#service mysqld start |
[root@nagiostest ~]#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg |
[root@nagiostest ~]# vi /root/.bashrc |
這樣以后只要輸入check就相當(dāng)于執(zhí)行上面的那一長(zhǎng)串命令。
執(zhí)行上述命令如果沒(méi)有錯(cuò),則出現(xiàn)如下圖:
如果有錯(cuò),則根據(jù)錯(cuò)誤提示進(jìn)行修改配置。
9、 登錄控制臺(tái):
現(xiàn)在就可以用http://serverip/nagios 方式訪問(wèn)nagios web訪問(wèn)控制臺(tái)了
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。