#!/bin/sh
################################################
#this scripts is created by oldboy
#site:http://www.etiantian.org
#blog:http://oldboy.blog.51cto.com
################################################
NAGIOS_TOOLS_DIR=/home/oldboy/tools
NAGIOS_INSTALL_DIR=/usr/local/nagios echo "------ step 1: config yum ------"
cd /etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo echo "------ step 2: config profile------"
echo 'export LC_ALL=C'>> /etc/profile
source /etc/profile echo "------ step 3: stop iptables and selinux------"
/etc/init.d/iptables stop
/etc/init.d/iptables stop
chkconfig iptables off
setenforce
if [ -f /etc/selinux/config ]; then
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
setenforce
fi
echo "------ step 4: config time sync------"
/usr/sbin/ntpdate pool.ntp.org
echo '#time sync by oldboy at 2010-2-1'>>/var/spool/cron/root
echo '*/10 * * * * /usr/sbin/ntpdate pool.ntp.org >/dev/null 2>&1'>>/var/spool/cron/root
crontab -l echo "------ step 5: install gcc and lamp env etc------"
yum install gcc glibc glibc-common -y
yum install gd gd-devel -y
yum install httpd php php-gd -y
yum install mysql* -y echo "------ step 6: add nagios user and group------"
/usr/sbin/useradd -m nagios
#/usr/sbin/useradd apache
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -a -G nagcmd nagios
/usr/sbin/usermod -a -G nagcmd apache echo "------ step 7: download and install nagios------" [ ! -f oldboy_training_nagios_soft.zip ] && exit unzip oldboy_training_nagios_soft.zip tar xzf nagios-3.5..tar.gz cd nagios ./configure --with-command-group=nagcmd make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
cd ../ echo "------ step 8: config web auth------"
htpasswd -cb /usr/local/nagios/etc/htpasswd.users oldboy echo "------ step 9: install nagios-plugins------"
yum -y install perl-devel
tar zxf nagios-plugins-1.4..tar.gz
cd nagios-plugins-1.4.
./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios --enable-perl-modules
make && make install
cd ../
ls /usr/local/nagios/libexec/|wc -l echo "------ step 10: install nrpe------"
tar zxvf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
cd .. echo "------ step 11: startup service and check------"
/etc/init.d/nagios start
/etc/init.d/httpd start
echo -----------
lsof -i tcp:
echo ----------
ps -ef|grep nagios
echo "NAGIOS is successfully installed."
echo ok

nagios 安装的更多相关文章

  1. Nagios安装部署和介绍(一)

    一.软件版本下载 Nagios版本下载地址: http://prdownloads.sourceforge.net/sourceforge/nagios/ http://sourceforge.net ...

  2. nagios安装配置

     http://www.codeweblog.com/nagios%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/ 上线的服务器有时会被人攻击,导致服务不可用,今天安装配置了 ...

  3. Nagios 安装及微信短信提醒

    引言 Nagios 作为业界非常强大的一款开源监视系统. 监控网络服务(SMTP.POP3.HTTP.NNTP.PING 等): 监控主机资源(处理器负荷.磁盘利用率等): 简单地插件设计使得用户可以 ...

  4. 简易nagios安装

    这段时间一直在进行nagios安装的实验,进行了很多的实验,现在也就是将这些进行一些基础的记录. 本篇主要讲述的是进行nagios的简易安装,在安装完成之后,能够在web页面上看到本地的监控图像, n ...

  5. nagios安装全过程

    Nagios是一个用来监控主机.服务和网络的开放源码软件,可以在发生故障时发送报警短信和邮件,只要Nagios监控的对象发生故障,系统就会自动发送短信到手机上.所以应用十分广泛. Nagios is  ...

  6. Nagios安装部署

    p.MsoNormal,li.MsoNormal,div.MsoNormal { margin: 0cm; margin-bottom: .0001pt; line-height: 150%; fon ...

  7. Nagios安装、配置、问题记录

    http://youyizhimen.blog.163.com/blog/static/170917267201201745523276/ 本文描述了我在使用Nagios的过程中遇到的一些问题.解决办 ...

  8. Nagios安装与配置

    安装包获取 Nagios https://sourceforge.net/projects/nagios/files/ Nagios Plugins https://www.nagios.org/do ...

  9. 监控和安全运维 1.4 nagios安装

    1. Nagios 简介是一个开源软件,可以监控网络设备网络流量.Linux/windows主机状态,甚至可以监控打印机它可以运行在Linux上或windows上基于浏览器的web界面方便运维人员查看 ...

  10. Ubuntu下nagios安装(来源官网)

    Ubuntu下nagios安装(来源官网) https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/toc.html h ...

随机推荐

  1. Mongodb 学习笔记简介

    目录 1       准备工作... 5 1.1        相关网址... 6 1.1        下载安装... 6 1.1.1         下载:... 6 1.1.2         ...

  2. 使用CSS实现自定义input[checkbox]样式

    思路:使用label上的for熟悉,与checkbox上的id相对应来达到点击选中效果,在使用伪元素,或者其他元素,定位至checkbox上方,替代checkbox,并且隐藏checkbox,使用CS ...

  3. htc支持CSS3

    <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8&quo ...

  4. 解决Windows服务修改配置文件后必须重启的问题

      原文地址:http://www.cnblogs.com/jeffwongishandsome/archive/2011/04/24/2026381.html   解决方法:读取配置文件前先刷新文件 ...

  5. 可用性的维度(5E)

    可用性的维度 当我检查可用性文献时,我发现可用软件包含如用户友好.易学.可发现性.质量.有用的和阻止错误.在可用性工程中, Jakob Nielsen给出一个产品的五个属性:易学性.效率.可记忆性.容 ...

  6. python字符串转日期

    需要两步 为了从字符串中提取时间,并进行比较,因此有了这个问题,如何将字符串转换成datetime类型 1.字符串与time类型的转换 >>> import time>> ...

  7. VR开发者必看:4大最为值得关注的内容平台【转】

            时间 2016-01-19 14:12:57 原文  http://www.sfw.cn/xinwen/478369.html 主题 虚拟现实 Oculus 对很多有意涉及VR行业的内 ...

  8. grpc(3):使用 golang 开发 grpc 服务端和client

    1,关于grpc-go golang 能够能够做grpc的服务端和client. 官网的文档: http://www.grpc.io/docs/quickstart/go.html https://g ...

  9. 从C转到JAVA学习路之struct与class对比(转)

    转自:http://blog.csdn.net/andywxf01/article/details/53506549 JAVA里最牛B的最基本的就是类,而C语言中的struct也可以定义自己的数据结构 ...

  10. EffectiveJava(25)泛型和数组的使用取舍及规范

    泛型和数组 泛型:1.泛型是不可变的.对于任意两个不同类型Type1,type2;List既不是List的子类型,也不是List的超类型 2.泛型是通过擦除来实现的.故泛型只在编译时强化它们的信息,并 ...