您好,登錄后才能下訂單哦!
1、操作系統準備:
系統: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、準備軟件:
下載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就相當于執行上面的那一長串命令。
執行上述命令如果沒有錯,則出現如下圖:
如果有錯,則根據錯誤提示進行修改配置。
9、 登錄控制臺:
現在就可以用http://serverip/nagios 方式訪問nagios web訪問控制臺了
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。