Nagios监控平台之一:安装
                                            最近在学习使用Nagios监控全网络,目前已经完成监控服务器的基本配置,主要参考了网上一些教程,但安装配置下来遇到了很多这样那样的问题,现在总结一下:
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 | 
下载中文版Nagios
| [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 | 
完成后ls如下:
| [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 | 
3、建立nagios账户:
        
| [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密码*/ | 
4、编译安装nagios-cn-3.2.3
        
安装完毕后返回root用户主目录:cd  ~
| [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访问控制台了
 

本文标题:Nagios监控平台之一:安装
URL网址:http://www.scyingshan.cn/article/jissod.html

 建站
建站
 咨询
咨询 售后
售后
 建站咨询
建站咨询 
 