32213211111 发表于 2016-12-8 08:58:47

nagios安装步骤

nagios安装步骤
1、安装前准备
1)创建nagios用户和用户组

1
2
3
useradd -s /usr/sbin/nologin nagios
mkdir /usr/local/nagios
chown -R nagios.nagios /usr/local/nagios




2)开启系统sendmail服务

1
/etc/init.d/sendmail start




2、编译安装nagios

1
2
3
4
5
6
7
8
tar -zxvf nagios-3.2.0.tar.gz
cd nagios-3.2.0
./configure --prefix=/usr/local/nagios
make all
make install
make install-init
make install-commandmode
make install-config




3、Nagios目录
bin
etc
sbin
Share
libexec外部插件所在的目录
var
var/archives
var/rw
4、安装Nagios插件

1
nagios-plugins-1.4.14




5、安装Nagios中文化插件

1
2
3
4
http://sourceforge.net/projects/nagios-cn/files/
./configure      不指定安装路径,默认为/usr/local
make all
make install




6、安装与配置apache和php
1)安装apache与php
2)配置apache

1
/usr/local/apache2/conf/httpd.conf




修改

1
2
User nobody
Group #-1




修改为

1
2
User nagios
Group nagios




然后找到

1
DirectoryIndex index.html index.html.var




修改为

1
DirectoryIndex index.html index.php




增加:

1
AddType application/x-httpd-php .php




在httpd.conf最后添加授权信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#setting for nagios
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
    AuthType Basic
    Options ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
    AuthName "Nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd
    Require valid-user
</Directory>
Alias /nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
    AuthType Basic
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
    AuthName "nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd
    Require valid-user
</Directory>




3)创建apache目录验证文件

1
2
3
4
/usr/local/apache2/bin/htpasswd -c /usr/local/nagios/etc/htpassed ixdba
启动服务
/usr/local/apache2/bin/apachectl start
http://ip/nagios/



页: [1]
查看完整版本: nagios安装步骤