Nagios服务器端安装部署详解

网络监控器Nagios全攻略

Nagios搭建与配置详解

Nginx环境下构建Nagios监控平台

在RHEL5.3上配置基本的Nagios系统(使用Nagios-3.1.2)

CentOS 5.5+Nginx+Nagios监控端和被控端安装配置指南

Ubuntu 13.10 Server 安装 Nagios Core 网络监控运用

1 开始下载:
wget ?use_mirror=jaist
如下图所示,下载free版本的。

Nagios服务器端安装部署详解

安装前准备工作,安装一些lib包

[root@cache-2 root]# yum -y install httpd gcc glibc glibc-common

# yum install -y gcc glibc glibc-common gd gd-devel xinetd openssl-devel 

2 进行selinux设置,或者关闭selinux

查看SELinux状态:

(1)/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态

SELinux status: enabled

(2)getenforce ##也可以用这个命令检查

关闭SELinux:

(3)临时关闭(不用重启机器):

setenforce 0 ##设置SELinux 成为permissive模式

##setenforce 1 设置SELinux 成为enforcing模式

(4)修改配置文件需要重启机器:

修改/etc/selinux/config 文件

将SELINUX=enforcing改为SELINUX=disabled

重启机器即可 

3 开始准备nagios安装环境

(1) 添加nagios运行所需要的用户和组:

groupadd nagcmd

useradd -m nagios

usermod -a -G nagcmd nagios 

把apache加入到nagcmd组,以便于在通过web Interface操作nagios时能够具有足够的权限:

# usermod -a -G nagcmd apache 

4 编译安装准备

./configure --with-command-group=nagios --prefix=/opt/app/nagios --enable-embedded-perl --with-httpd-conf=/usr/local/apache2/conf

[root@cache-2 nagios-4.0.6]# ./configure --with-command-group=nagios --prefix=/opt/app/nagios --enable-embedded-perl --with-httpd-conf=/usr/local/apache2/conf

checking for a BSD-compatible install... /usr/bin/install -c

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking for gcc... gcc

checking for C compiler default output file name... a.out

checking whether the C compiler works... yes

checking whether we are cross compiling... no

.............................

HTML URL: http://localhost/nagios/

CGI URL: http://localhost/nagios/cgi-bin/

Traceroute (used by WAP): /bin/traceroute

Review the options above for accuracy. If they look okay,

type 'make all' to compile the main program and CGIs.

[root@cache-2 nagios-4.0.6]# ./configure --with-command-group=nagios --prefix=/opt/app/nagios --enable-embedded-perl --with-httpd-conf=/usr/local/apache2/conf checking for a BSD-compatible install... /usr/bin/install -c checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no ............................. HTML URL: CGI URL: Traceroute (used by WAP): /bin/traceroute Review the options above for accuracy. If they look okay, type 'make all' to compile the main program and CGIs.


5 开始make安装
5.1 make all

[root@cache-2 nagios-4.0.6]# make all

cd ./base && make

make[1]: Entering directory `/root/nagios-4.0.6/base'

gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE -c -o nagios.o nagios.c

gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE -c -o broker.o broker.c

gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE -c -o nebmods.o nebmods

.........................

For more information on obtaining support for Nagios, visit:

http://support.nagios.com

*************************************************************

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/9051f5f12db7f8e900eff5a4a9612958.html