源代码编译安装Nagios

本文详细介绍了在Linux环境下,如何手动编译安装Nagios监控系统,包括安装Apache、PHP、GCC等先决条件,创建用户账户,编译安装Nagios,配置Web服务器接口,安装Nagios插件,以及启动Nagios服务的过程。最后,通过http://localhost/nagios/即可访问Nagios监控界面。

先决条件:

  • Apache
  • PHP
  • GCC
  • GD development libraries

安装方法:

yum install httpd php
yum install gcc glibc glibc-common
yum install gd gd-devel

1、创建运行nagios的用户账户并设置密码

useradd -m nagios
passwd nagios

创建组,并把nagios账户和apache账户加入该组

groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache

2、编译并安装Nagios

./configure --with-command-group=nagcmd

make all
make install
make install-init
make install-config
make install-commandmode

3、自定义配置

主配置文档:/usr/local/nagios/etc/nagios.cfg
联系人配置文档:/usr/local/nagios/etc/objects/contacts.cfg

4、配置web服务器接口:

make install-webconf

添加用户(Apache认证时用)
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Service httpd restart

5、安装Nagios插件:

./configure --with-nagios-user=nagios --with-nagios-group=nagios

make
make install

6、启动Nagios:

chkconfig nagios –add
chkconfig nagios on
service nagios s tart

7、通过网页登录:

http://localhost/nagios/

参考文档:

http://nagios.sourceforge.net/docs/3_0/quickstart-fedora.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值