nagios 安装
#!/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 安装的更多相关文章
- Nagios安装部署和介绍(一)
一.软件版本下载 Nagios版本下载地址: http://prdownloads.sourceforge.net/sourceforge/nagios/ http://sourceforge.net ...
- nagios安装配置
http://www.codeweblog.com/nagios%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/ 上线的服务器有时会被人攻击,导致服务不可用,今天安装配置了 ...
- Nagios 安装及微信短信提醒
引言 Nagios 作为业界非常强大的一款开源监视系统. 监控网络服务(SMTP.POP3.HTTP.NNTP.PING 等): 监控主机资源(处理器负荷.磁盘利用率等): 简单地插件设计使得用户可以 ...
- 简易nagios安装
这段时间一直在进行nagios安装的实验,进行了很多的实验,现在也就是将这些进行一些基础的记录. 本篇主要讲述的是进行nagios的简易安装,在安装完成之后,能够在web页面上看到本地的监控图像, n ...
- nagios安装全过程
Nagios是一个用来监控主机.服务和网络的开放源码软件,可以在发生故障时发送报警短信和邮件,只要Nagios监控的对象发生故障,系统就会自动发送短信到手机上.所以应用十分广泛. Nagios is ...
- Nagios安装部署
p.MsoNormal,li.MsoNormal,div.MsoNormal { margin: 0cm; margin-bottom: .0001pt; line-height: 150%; fon ...
- Nagios安装、配置、问题记录
http://youyizhimen.blog.163.com/blog/static/170917267201201745523276/ 本文描述了我在使用Nagios的过程中遇到的一些问题.解决办 ...
- Nagios安装与配置
安装包获取 Nagios https://sourceforge.net/projects/nagios/files/ Nagios Plugins https://www.nagios.org/do ...
- 监控和安全运维 1.4 nagios安装
1. Nagios 简介是一个开源软件,可以监控网络设备网络流量.Linux/windows主机状态,甚至可以监控打印机它可以运行在Linux上或windows上基于浏览器的web界面方便运维人员查看 ...
- Ubuntu下nagios安装(来源官网)
Ubuntu下nagios安装(来源官网) https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/toc.html h ...
随机推荐
- zk client获取数据
获取数据 它返回znode的关联数据和指定znode的元数据.你将获得信息,例如上次修改数据的时间,修改的位置以及数据的相关信息.此CLI还用于分配监视器以显示数据相关的通知. 语法 get /pat ...
- ajax asynx:false
默认设置下,所有请求均为异步请求.如果需要发送同步请求,请将此选项设置为 false.注意,同步请求将锁住浏览器,用户其它操作必须等待请求完成才可以执行 (默认: true) 默认设置下,所有请求均为 ...
- Kubernetes Fluentd+Elasticsearch+Kibana统一日志管理平台搭建的填坑指南
在初步完成Kubernetes集群架构的建立后,通过搭建一些监控组件,我们已经能够实现 图形化的监控每个node,pod的状态信息和资源情况 通过scale进行replicateSet的扩展和伸缩 通 ...
- nginx+lua+redis
git clone --branch master https://github.com/openresty/lua-resty-redis.git yum install openssl opens ...
- 算法导论-求(Fibonacci)斐波那契数列算法对比
目录 1.斐波那契数列(Fibonacci)介绍 2.朴素递归算法(Naive recursive algorithm) 3.朴素递归平方算法(Naive recursive squaring) 4 ...
- Key-Value Observing (键值监測)
Key-Value Observing (键值监測) 简单介绍 KVO是一套当目标对象的属性值改变时观察者对象能够接受到通知的机制.必须先理解KVC才干更好的理解KVO,前者是后者的实现基础. 这种通 ...
- C# 中 in,out,ref 的作用与区别
In:过程不会改写In的内容 Out和out:传入的值不会被过程所读取,但过程可以写 ref:传入的值,过程会读,也会写 就象你把布料送到裁缝的一个收料箱(裁缝用这个区别是哪家客户) IN:这块布料, ...
- oracle data file header replace(測)
SQL> create tablespace rm_tbs datafile 'f1.dbf' size 10m; Tablespace created. SQL> select file ...
- 【C++基础 03】do...while(0)妙用
我的主题是,有时候知道一些细节会让你写出更好的代码. ============================================ 之前学coocs2d-x的时候,发现有非常多do...w ...
- ImageLoader使用
最近琢磨的网上的这些开源框架,imageLoader确实很好用,基本用法不记录了,参考网上的一些代码写了个ImageLoaderManager /** * Created by Lee on 2016 ...