首页 > 代码库 > nagios的概述和安装

nagios的概述和安装


nagios的功能:使用web网页进行监控其他服务器状态的工具

组成:
nagios Core ,即核心模块,不做具体的监视工作
Plugins, 与核心模块进行组合,进而实现对某个具体的对象监控
     
     
工作对象:
1、主机,交换机,路由器,虚拟机
2、服务/资源
3、联系人
4、时段
5、命令


安装:
# yum -y install httpd gcc glibc glibc-common gd gd-devel php php-mysql mysql mysql-server mysql-devel
创建组和用户
# groupadd -r nagcmd
# useradd -G nagcmd -r -s /sbin/nologin nagios
# echo ‘redhat‘ | passwd --stdin nagios &> /dev/null
# usermod -a -G nagcmd apache

# tar zxf nagios-3.3.1.tar.gz
# cd nagios
编译安装:
# ./configure --sysconfdir=/etc/nagios --with-command-group=nagcmd --enable-event-broker --prefix=/usr/local/nagios
# make all
# make install
# make install-init
# make install-commandmode
# make install-config
# make install-webconf

修改 nagios 的默认联系人;(如果监控的服务器坏掉了要找的人)
# vim /etc/nagios/objects/contacts.cfg
email nagios@localhost

创建 nagios 监控服务的 web 接口的管理员;
# htpasswd -c /etc/nagios/htpasswd.users nagiosadmin
# cat /etc/httpd/conf.d/nagios.conf

# tar axf nagios-plugins-1.4.15.tar.gz
# cd nagios-plugins-1.4.15

编译安装选项:
# ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-mysql
# make && make install

# chown -R nagios.nagcmd /etc/nagios
# chown -R apache.nagcmd /etc/httpd
# chown -R nagios.nagcmd /usr/local/nagios
# chkconfig --add nagios
# chkconfig nagios on
# service nagios start
#service httpd start

关闭setenforce和context值:
# setenforce 0
# chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin
# chcon -R -t httpd_sys_content_t /usr/local/nagios/share




本文出自 “12415761” 博客,请务必保留此出处http://12425761.blog.51cto.com/12415761/1883798

nagios的概述和安装