一.安装环境的配置

1.关闭防火墙。

[root@Nagios ~]# service iptables stop

2.关闭SELinux

[root@Nagios ~]# vim /etc/selinux/config

将SELINUX=disabled

二.安装必要软件

[root@Nagios ~]# yum -y install wget make openssl openssl-devel httpd php gcc glibc glibc-common gd gd-devel net-snmp mysql mysql-server mysql-devel perl perl-devel gnutls gnutls-devel

1.Nagios账户及组的添加

useradd nagios

groupadd nagios

usermod -a -G nagios nagios

usermod -a -G nagios apache

2..编译与安装nagios

wget http://jaist.dl.sourceforge.net/project/nagios/nagios-4.x/nagios-4.0.8/nagios-4.0.8.tar.gz

tar jxvf nagios-4.0.8 -C /usr/src/

cd /usr/src/nagios-4.0.8

./configure --prefix=/usr/local/nagios --with-command-group=nagios --with-nagios-user=nagios --with-nagios-group=nagios

make all

make clean

make all

make install

make install-init    //服务启动文件

make install-commandmode    //命令文件

make install-config //配置

make install-webconf //apache配置

/usr/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin  //输入nagios的web管理密码

[root@Nagios nagios]# cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/

[root@Nagios nagios]# chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers/

测试nagios的配置文件

[root@Nagios nagios]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg(最好做成一个脚本文件 随时检查nagios配置)

如果最后出现

Total Warnings: 0

Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check

就证明nagios配置无误可正常启动!

Nagios plugin的安装

yum -y install gd gd-devel *openssl*

wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz

[root@Nagios nagios]# tar zxvf nagios-plugins-2.0.3.tar.gz-C /usr/src/

[root@Nagios nagios]#cd /usr/src/nagios-plugins-2.0.3

[root@Nagios nagios-plugins-2.0.3]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios --enable-extra-opts --enable-perl-modules --enable-libtap

编译成功后,会出现如下信息:

--with-apt-get-command:

--with-ping6-command: /bin/ping6 -n -U -w %d -c %d %s

--with-ping-command: /bin/ping -n -U -w %d -c %d %s

--with-ipv6: yes

--with-mysql: /usr/bin/mysql_config

--with-openssl: yes

--with-gnutls: no

--enable-extra-opts: yes

--with-perl: /usr/bin/perl

--enable-perl-modules: yes

--with-cgiurl: /nagios/cgi-bin

--with-trusted-path: /bin:/sbin:/usr/bin:/usr/sbin

--enable-libtap: yes

[root@Nagios nagios-plugins-2.0.3]# make

[root@Nagios nagios-plugins-2.0.3]# make install

将nagios及httpd加入启动项,并自动启动

[root@Nagios nagios-plugins-2.0.3]# chkconfig --add nagios

[root@Nagios nagios-plugins-2.0.3]# chkconfig --level 35 nagios on

[root@Nagios nagios-plugins-2.0.3]# chkconfig --add httpd

[root@Nagios nagios-plugins-2.0.3]# chkconfig --level 35 httpd on

安装完毕!

转载于:https://blog.51cto.com/skykws8023/1338257

centos6.4安装nagios—4.0.8相关推荐

  1. centos6.5安装配置zabbix3.0.3

    1.首先要准备LAMP环境. (1)安装php Zabbix 3.0对PHP的要求最低为5.4,而CentOS6默认为5.3.3,完全不满足要求,故需要利用第三方源,将PHP升级到5.4以上 rpm ...

  2. python3.6.0安装教程-centos6.9安装python3.6.0和模块

    1.安装依赖包yum -y install wget zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline- ...

  3. centos6.6安装hadoop-2.5.0(四、hadoop HA安装)

    操作系统:centos6.6 环境:selinux disabled:iptables off:java 1.8.0_131 安装包:hadoop-2.5.0.tar.gz HA模式下的HADOOP完 ...

  4. centos6.5 mysql下载_Centos6.5在线安装mysql 8.0详细教程

    Centos6.5在线安装mysql 8.0的顺序如下,希望大家可以顺利进行安装. Mysql卸载从下往上顺序 [root@localhost /]# rpm -e --nodeps qt-MySQL ...

  5. centos6.5安装mysql8_Centos6.5在线安装mysql 8.0详细教程

    Centos6.5在线安装mysql 8.0的顺序如下,希望大家可以顺利进行安装. Mysql卸载从下往上顺序 ?[root@localhost /]# rpm -e --nodeps qt-MySQ ...

  6. CentOS6下Xen 4.1的安装(编译linux3.0内核)

    一.    准备工作 a)    一台计算机(是否支持intel-VT或AMD-V均可) 注:支持intel-VT或AMD-V技术可以实现全虚拟化(full virtualization),不支持的话 ...

  7. U盘安装CentOS 7.0图文详解教程

    背景: 阅读新闻 [日期:2014-10-14] 来源:Linux社区 作者:Linux [字体:大 中 小] 记录下U盘安装CentOS 7.0安装过程,供Linux新手参考.U盘安装Linux简单 ...

  8. centos6一键安装vsftpd脚本

    centos6一键安装vsftpd脚本 手动安装vsftpd参考教程:Centos下安装Vsftpd的图文教程 vsftpd脚本功能: 1.安装 (命令执行:sh xxx.sh)2.添加ftp用户 ( ...

  9. linux卸载hadoop版本,centos6.5 安装hadoop1.2.1的教程详解【亲测版】

    本篇只简单介绍安装步骤 1. 角色分配 10.11.84.4 web-crawler--1.novalocal master/slave 10.11.84.5 web-crawler--2.noval ...

最新文章

  1. java mysql安装教_大学java教案之MySQL安装图解
  2. 数据结构复习:单链表
  3. android studio 打开github开源代码
  4. scrapy-splash抓取动态数据例子六
  5. Mysql(3)——mysql数据类型
  6. Mysql 允许所有IP访问
  7. vue-cli多环境配置
  8. 方舟进入服务器显示未知错误,服务器点进去后出错求解!急!
  9. 辽源a货翡翠,张掖a货翡翠
  10. nacos 下线接口_《掌门教育微服务体系 Solar | 阿里巴巴 Nacos 企业级落地中篇》...
  11. 关键2招提升软件开发项目的利润
  12. C++中使用GSoap
  13. 在VC中使用SendInput函数实现中文的自动输入
  14. 越看越爽,此后统计学习不再是路人!
  15. 非参数分析-符号秩和检验法
  16. 从输入URL到页面加载的过程?由一道题完善自己的前端知识体系!
  17. 无线AP和无线路由器区别 wifi热点
  18. Asp.Net MVC中身份认证和授权
  19. 创新型中小企业认定评定标准
  20. RTX2080Ti不能正常安装ubuntu/xubuntu的解决方法 安装显卡驱动/cuda/cudnn的正确方法 USBboot黑屏

热门文章

  1. 1067. [SCOI2007]降雨量【线段树】
  2. 全方位讲解硬件防火墙的选择
  3. GCC中同时使用动态和静态库链接的编译
  4. 是技术还是态度,网易的视频Title
  5. 软件使用说明书模板_想要快速定制表单模板?请收下这份浩辰3D设计攻略
  6. vuex实践之路——笔记本应用(三)
  7. 借助JRebel使Tomcat支持热部署
  8. [Objective-C] Copy 和 MutableCopy
  9. UVA10010 Where's Waldorf?
  10. Linux下同步工具inotify+rsync使用详解