安装nagios4.0.8

nagios监控,其中包括以下几个组件

core:核心组件,包括基础的web介绍和监控引擎

plugins:监控插件,可以用来监控主机、设备、数据库等

addons:功能组件,用于扩展nagios功能,比如生成趋势图等

Fontends:前台展示,可以用来修改nagios的主界面,类似于皮肤

安装环境是redhat5.7,过程参照官方文档

软件下载:

https://www.nagios.org/downloads/

需要安装的软件包有:

rpm -ivh httpd-2.2.3-53.0.1.el5.x86_64.rpm
rpm -ivh apr-devel-1.2.7-11.el5_6.5.x86_64.rpm 
rpm -ivh apr-util-devel-1.2.7-11.el5_5.2.x86_64.rpm
rpm -ivh httpd-devel-2.2.3-53.0.1.el5.x86_64.rpm 
rpm -ivh libXpm-devel-3.5.5-3.x86_64.rpm 
rpm -ivh gd-2.0.33-9.4.el5_4.2.x86_64.rpm
rpm -ivh gd-devel-2.0.33-9.4.el5_4.2.x86_64.rpm 
rpm -ivh php-common-5.1.6-27.el5_5.3.x86_64.rpm
rpm -ivh php-cli-5.1.6-27.el5_5.3.x86_64.rpm
rpm -ivh php-5.1.6-27.el5_5.3.x86_64.rpm
rpm -ivh php-devel-5.1.6-27.el5_5.3.x86_64.rpm
rpm -ivh net-snmp-5.3.2.2-14.0.1.el5.x86_64.rpm

添加用户和组:

[root@mysql1 Server]# groupadd nagios
[root@mysql1 Server]# useradd -g nagios nagios
[root@mysql1 Server]# passwd nagios
[root@mysql1 Server]# tar zxvf nagios-4.0.8.tar.gz
安装nagios core:
[root@mysql1 nagios-4.0.8]#./configure --prefix=/usr/local/nagios

make all
make install 
make install-init 
make install-config 
make install-commandmode 
make install-webconf 
cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios start
/etc/init.d/httpd start

创建一个web登录的用户
[root@mysql1 nagios-4.0.8]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagios
New password: 
Re-type new password: 
Adding password for user nagios

解压缩plugins,并且安装:

[root@mysql1 nagios-plugins-2.1.1]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
make 
make install
chkconfig --add nagios
chkconfig --level 35 nagios on
chkconfig --add httpd
chkconfig --level 35 httpd on
</pre><pre name="code" class="sql">启动和关闭分别是:
[root@mysql1 nagios-4.0.8]# service nagios start
[root@mysql1 nagios-4.0.8]# service httpd start

[root@mysql1 nagios-4.0.8]# service httpd stop
[root@mysql1 nagios-4.0.8]# service nagios stop


 
 


安装完成之后就可以通过web界面http://<your.nagios.server.ip>/nagios登录,用户名和密码就是

[root@mysql1 nagios-4.0.8]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagios

这里的nagios和设置的密码。


你可能感兴趣的:(nagios安装)