标签:down 认证 ping ORC lib 输入 login centos make
CentOS 下安装 nagios 详细攻略一、安装环境 1.CentOS 6.5 64 位 2.nagios-4.3.2 3.nagios-plugins-2.2.1
二、安装步骤
1.su root #切换到 root 用户
2.yum install -y gcc glibcglibc-common gd gd-devel xinetd openssl-devel httpd php unzip perl
4.建立用户和用户组
[root@Nagios-Server /]# useradd -s /sbin/nologin nagios
[root@Nagios-Server /]# mkdir /usr/local/nagios
[root@Nagios-Server /]# chown -R nagios.nagios /usr/local/nagios
并将 nagios 以及 apache 用户加入到 nagcmd 组中,确保 nagios 和 apache 有权限
5.下载并安装 Nagios
#wget https://assets.nagios.com/downloads/nagioscore/releases/nagios4.3.2.tar.gz
#./configure --prefix=/usr/local/nagios --with-command-group=nagcmd
6.使用 apache 来创建基本的 web 页认证方式
#回车后会提示输入两次密码, 看 到如下提示,说明账号设置成功(账号:admin,密码需牢记,页面登录需要用)
7.启动服务
[root@localhost nagios-4.3.2]# service httpd restart #启动 httpd 服务 Stopping httpd: [ OK ] Starting httpd: [ OK ]
[root@localhost nagios-4.3.2]# chkconfig --level 235 httpd on #设置开机启动
8.下载并安装 nagios-plugins 插件
[root@localhostnagios-4.3.2]#wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz
[root@localhost nagios-4.3.2]# tar -zxvf nagios-plugins-2.2.1.tar.gz
[root@localhost nagios-4.3.2]# cd nagios-plugins-2.2.1
[root@localhost nagios-plugins-2.2.1]# ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios
#make
#chkconfig --add nagios
#chkconfig nagios on //设置开机启动
9.检查配置文件的正确性
[root@localhost nagios-plugins-2.2.1]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/n agios.cfg
10.启动 nagios 服务
[root@localhost nagios-plugins-2.2.1]# service nagios start
[root@localhost nagios-plugins-2.2.1]# service httpd start
在浏览器输入 http://localhost/nagios 弹出窗口输入账号密码,即可打开主页
标签:down 认证 ping ORC lib 输入 login centos make
原文地址:http://blog.51cto.com/niming2008/2136404