#!/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. druid 配置监控界面和开启spring支持

    1.配置监控页面 <!-- JNDI方式配置数据源 --> <!-- <bean id="dataSource" class="org.sprin ...

  2. Linux-C网络编程之epoll函数

    上文中说到假设从100的不同的地方取外卖,那么epoll相当于一部手机,当外卖到达后,送货员能够通知你.从而达到每去必得,少走非常多路. 它是怎样实现这些作用的呢? epoll的功能 epoll是se ...

  3. http://www.cnblogs.com/monian/p/3822980.html

    http://www.cnblogs.com/monian/p/3822980.html

  4. vim删除文本文件中末行^M

    ^M字符的来历和作用:在DOS/Windows里,文本文件的换行符为\r\n,而在*nix系统里则为\n,所以DOS/Windows里编辑过的文本文件到了*nix里,每一行都多了个^M.所以^M只是一 ...

  5. [TypeScript] Dynamically initialize class properties using TypeScript decorators

    Decorators are a powerful feature of TypeScript that allow for efficient and readable abstractions w ...

  6. BEGINNING SHAREPOINT&#174; 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序 新的机器翻译服务

    BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第14章节--使用Office Services开发应用程序  新的机器翻译服务         机器翻译服务也是继Wor ...

  7. 【Swift】学习笔记(三)——字符和字符串

    基本了解了变量的创建和基础数据类型,但是在开发中用得最多的还是字符串.那什么是字符串呢? Swift 的String类型表示特定序列的Character(字符) 类型值的集合,它是值类型具有可变性 S ...

  8. 倍福TwinCAT(贝福Beckhoff)应用教程11.1 TwinCAT应用小程序1 贝福IO模块介绍

    EL1002,EL1004,EL1008都是数字输入模块(2个点,4个点,8个点),输入高的范围是15V到30V,低的范围是-3V到5V         EL2002,EL2004,EL2008都是数 ...

  9. MyISAM的key_buffer_size和InnoDB的innodb_buffer_pool_size

    一.MyISAM的key_buffer_size MyISAM的索引方式是非聚集索引,主索引和其他索引没有本质区别,在data域都是存储了具体记录行的地址.key_buffer_size规定了系统将多 ...

  10. $ gulp watch 运行出错解决方法

    $ gulp watch 运行出错解决方法   $ gulp watch     如果你出现了如下报错信息: gulp-notify: [Laravel Elixir] Browserify Fail ...