nagios的搭建及配置----(上)-创新互联

首先说下自己的搭建环境。RedHat6.4系统 nagios-4.0.7。关闭selinux和iptables服务

为赤坎等地区用户提供了全套网页设计制作服务,及赤坎网站建设行业解决方案。主营业务为成都网站建设、成都做网站、赤坎网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!

1,准备工作,安装好nagios所需要的软件

    Apache
   PHP
   GCC compiler

   GD development libraries

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

2,创建nagios使用的账号和组,首先要切换成管理员账号

    [root@localhost ~]useradd -m nagios

    [root@localhost ~]echo nagios |passwd --stdin nagios

    [root@localhost ~]# groupadd nagcmd

    [root@localhost ~]# usermod -aG nagcmd nagios
    [root@localhost ~]# usermod -aG nagcmd apache

3,下载nagios和nagio-plugin

[root@localhost ~]#wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.3.tar.gz

[root@localhost ~]#wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz

4,编译安装(Install binaries, init script, sample config files and set permissions on the external command directory.)

[root@localhost ~]#./configure --with-command-group=nagcmd
[root@localhost ~]#make all
[root@localhost ~]#make install
[root@localhost ~]#make install-init
[root@localhost ~]#make install-config
[root@localhost ~]#make install-commandmodes
[root@localhost ~]#make install-commandmode

5,自定义配置文件

[root@localhost ~]#vim /usr/local/nagios/etc/objects/contacts.cfg

nagios的搭建及配置----(上)

配置管理员的邮箱地址,当监控到有问题时会发送邮件到管理员邮箱
6,配置web界面管理接口,并创建登陆到nagios管理界面的账号密码,然后重启Apache服务,使配置文件生效
[root@localhost ~]#make install-webconf
[root@localhost ~]#htpasswd -c /usr/local/nagios/etc/htpasswd.users  nagiosadmin  
//htpasswd.users的文件名称一定要写正确
[root@localhost ~]#service httpd restart
7,编译安装nagios-plugin
[root@localhost ~]#tar -zxvf nagios-plugins-2.0.3.tar.gz -C /usr/src/
[root@localhost ~]#cd /usr/src/nagios-plugins-2.0.3/
[root@localhost ~]#ls 
[root@localhost ~]#./configure --with-nagios-user=nagios --with-nagios-group=nagios
[root@localhost ~]#make 
[root@localhost ~]#make install 
[root@localhost ~]#cd 
[root@localhost ~]#chkconfig --add nagios
[root@localhost ~]#chkconfig nagios on
[root@localhost ~]#service nagios start 
[root@localhost ~]#service nagios restart 
[root@localhost ~]#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg 
        //检查配置文件是否有错误或者警告,如果没有的话启动nagios服务
[root@localhost ~]#service nagios start
7,现在我们就可以测试nagios监控本机localhost的情况了,登陆 server ip/nagios 
进去之后会让你输入方才htpasswd创建的用户名和密码(蓝色边框)

我擦,图片怎么上传不了呀?上传不了图片就算了。

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


当前题目:nagios的搭建及配置----(上)-创新互联
文章位置:http://lszwz.com/article/pgspc.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款