Nagios是一个系统监控工具,把不易检测的主机参数以页面的形式展现出来,这个配置耗费了我很久的时间!平台:红帽RHEL 5.4本次安装需要的软件nagios-3.2.3.tar.gz(nagios的core)nagios-plugins-1.4.15.tar.gz(功能插件)nagios-cn-3.2.3.tar.bz2(中文插件)其中中文插件的选择必须和core高度一致本次安装需要开启的服务apache和sendmail另外还需以rpm或者yum的方式来安装php的功能模块当然这两个软件也可以用源码编译的方式来安装,这里采用是系统默认安装的套件1、安装前的准备关闭selinux和清除防火墙规则(为了不影响测试)[root@localhost ~]# useradd nagios
[root@localhost ~]# passwd nagios2、安装nagios的core[root@localhost ~]# ls nagios-3.2.3.tar.gz
nagios-3.2.3.tar.gz
[root@localhost ~]# tar zxvf nagios-3.2.3.tar.gz [root@localhost ~]# cd nagios-3.2.3
[root@localhost nagios-3.2.3]# ./configure(环境的设置)[root@localhost nagios-3.2.3]# make(编译)
[root@localhost nagios-3.2.3]# make install(安装)
[root@localhost nagios-3.2.3]# make install-init(制作/etc/rc.d/ini.d/的启动方式)
[root@localhost nagios-3.2.3]# make install-commandmode(对目录权限的限制)
[root@localhost nagios-3.2.3]# make install-config(检测变量的设置,主要在目录/usr/local/nagios/etc中)
[root@localhost nagios-3.2.3]# make install-webconf(解决和apache的融合)3、安装nagios的功能插件[root@localhost ~]# ls nagios-plugins-1.4.15.tar.gz
nagios-plugins-1.4.15.tar.gz
[root@localhost ~]# tar zxvf nagios-plugins-1.4.15.tar.gz
[root@localhost nagios-plugins-1.4.15]# ./configure [root@localhost nagios-plugins-1.4.15]# make;make install
4、安装中文插件[root@localhost ~]# ls nagios-cn-3.2.3.tar.bz2
nagios-cn-3.2.3.tar.bz2[root@localhost ~]# tar jxvf nagios-cn-3.2.3.tar.bz2
[root@localhost nagios-cn-3.2.3]# ./configure [root@localhost nagios-cn-3.2.3]# make all
[root@localhost nagios-cn-3.2.3]# make install5、一些基本的配置[root@localhost ~]# cd /etc/httpd/conf
[root@localhost conf]# vi httpd.conf (加上下边那句话,php的支持)AddType applicatio/x-httpd-php .php[root@localhost ~]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin(设置管理用户)New password:
Re-type new password:
Adding password for user nagiosadmin
[root@localhost ~]# cd /usr/local/nagios/etc/
[root@localhost etc]# chown nagios:nagios htpasswd.users [root@localhost etc]# chmod g+w htpasswd.users
[root@localhost etc]# cat htpasswd.users
nagiosadmin:QfW0M.KNWetv2
6、测试[root@localhost ~]# /etc/init.d/nagios restart
[root@localhost ~]# /etc/init.d/httpd restart
[root@localhost ~]# /etc/init.d/sendmail restart
在IE地址栏里输入http://ip/nagios 出现提示登录界面,输入nagiosadmin 和刚才设置的密码 登录即可下边说下调试过程中出现的问题初次安装nagios用源码的方式安装所有所需套件,一直出现莫名的错误,只好放弃以后再研究,后来决定试试用系统自带的apache和sendmail和以yum的方式来安装php,只用源码的方式安装配置nagios的套件,这样的设置在安装nagios的core的过程中由于没make install-webconf,所以一直出现权限的问题(Nagios 请检查HTTP服务器关于该CGI的访问权限设置),在网上搜寻说是htpasswd.users的权限的问题可是照做了之后仍然不行,后来就查看/usr/local/nagios/etc/cgi.cfg 中关于管理员用户的限定,后来发现里边限定的是nagiosadmin这个用户,于是就 htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin,直接设置成这个用户,再次重启服务之后刷新页面,上述的错位就没了,由于是新手,在安装这个套件的过程中一直重复,一直尝试,得来的结果是进一步了解了它的原理,这里介绍的只是安装,下边要学习的配置才是重点(见 http://www.linuxidc.com/Linux/2011-11/47909.htm ),至于安装就说到这里! 28 个必备的 Linux 命令行工具VMware Linux下Nagios的基本配置相关资讯 Nagios
- Linux下Nagios+PNP4Nagios的安装与 (今 08:25)
- CentOS7安装Nagios并配置出图详解 (12/02/2015 19:36:58)
- Nagios Core 4.1.0rc2 发布下载, (07/18/2015 09:18:42)
| - Nagios 监控 SNMP 温度计 (08月21日)
- CentOS 6.7 安装Nagios教程 (11/23/2015 10:36:49)
- Nagios插件之登陆防火墙实现 (07/09/2015 19:58:25)
|
本文评论 查看全部评论 (0)