用SHELL脚本自动化安装Nagios服务器端和客户端的
来源:互联网 发布:投资项目经济评价软件 编辑:程序博客网 时间:2024/05/18 02:07
公司的一个项目网站,上线几天就因为磁盘暴满而出了问题,由于其服务器都集中在某一IDC机房内,所以考虑部署套Nagios监控报警系统,考虑到其它项目网站可能有类似需求,所以将其安装过程整理成脚本,方便以后的工作。Nagios服务器自动安装脚本,如下所示(此脚本在Centos5.5|5.6|5.8 x86_64下通过):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
yum -y
install
httpd gcc gcc-c++ glibc glibc-common gd gd-devel
useradd
nagios
groupadd nagcmd
usermod
-G nagcmd nagios
usermod
-G nagcmd apache
cd
/usr/local/src
wget http:
//nchc
.dl.sourceforge.net
/sourceforge/nagios/nagios-3
.0.6.
tar
.gz
wget http:
//nchc
.dl.sourceforge.net
/sourceforge/nagiosplug/nagios-plugins-1
.4.13.
tar
.gz
wget http:
//prdownloads
.sourceforge.net
/sourceforge/nagios/nrpe-2
.13.
tar
.gz
tar
zxvf nagios-3.0.6.
tar
.gz
cd
nagios-3.0.6
.
/configure
--with-
command
-group=nagcmd --prefix=
/usr/local/nagios
make
all
make
install
make
install
-init
make
install
-config
make
install
-commandmode
make
install
-webconf
cd
../
tar
zxvf nagios-plugins-1.4.13.
tar
.gz
cd
nagios-plugins-1.4.13
.
/configure
--prefix=
/usr/local/nagios
--with-nagios-user=nagios --with-nagios-group=nagios
make
&&
make
install
cd
../
tar
zxvf nrpe-2.13.
tar
.gz
cd
nrpe-2.13
.
/configure
make
all
make
install
-plugin
make
install
-daemon
make
install
-daemon-config
htpasswd -
bc
/usr/local/nagios/etc/htpasswd
.
users
nagiosadmin
nagiosadmin101
echo
"
alias
nagioscheck='
/usr/local/nagios/bin/nagios
-
v
/usr/local/nagios/etc/nagios
.cfg' " >>
/root/
.bashrc
source
/root/
.bashrc
chkconfig nagios on
chkconfig httpd on
service httpd start
service nagios start
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
useradd
nagios
cd
/usr/local/src
wget http:
//nchc
.dl.sourceforge.net
/sourceforge/nagiosplug/nagios-plugins-1
.4.13.
tar
.gz
wget http:
//prdownloads
.sourceforge.net
/sourceforge/nagios/nrpe-2
.13.
tar
.gz
tar
zxvf nagios-plugins-1.4.13.
tar
.gz
cd
nagios-plugins-1.4.13
.
/configure
make
make
install
chown
nagios:nagios
/usr/local/nagios
chown
-R nagios:nagios
/usr/local/nagios/libexec
cd
../
tar
zxvf nrpe-2.13.
tar
.gz
cd
nrpe-2.13
.
/configure
make
all
make
install
-plugin
make
install
-daemon
make
install
-daemon-config
sed
-i
's@allowed_hosts=127.0.0.1@allowed_hosts=114.112.11.11@'
/usr/local/nagios/etc/nrpe
.cfg
/usr/local/nagios/bin/nrpe
-c
/usr/local/nagios/etc/nrpe
.cfg -d
echo
"/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d"
>>
/etc/rc
.
local
0 0
- 用SHELL脚本自动化安装Nagios服务器端和客户端的
- nagios 流量监控和报警的shell脚本
- nagios windows客户端批处理安装脚本
- kickstart 自动化部署服务器端环境安装脚本
- Shell脚本实现自动化安装
- Hadoop自动化安装shell脚本
- CentOS 安装nagios 服务器端
- 服务器端脚本&&客户端脚本
- php memcache服务器端的安装和memcached客户端的安装。
- 自动化部署的shell脚本
- 网页中的服务器端和客户端脚本
- nagios系列(二)之nagios客户端的安装及配置
- sonar服务器端和客户端的安装和使用
- Nagios客户端执行oracle检查脚本和远程server端不一致的问题
- Nagios监控服务器与客户端的安装
- 基于Trixbox的HUDLite客户端和服务器端的安装
- portalAgent自动化安装以及shell脚本小结
- shell脚本自动化安装docker_install.sh
- 自定义View
- ELK日志套件安装与使用
- Android中path基本使用总结
- 搭建一个简单、易用的 Android 项目框架之 BaseAdapter(三)
- React Native之DrawerLayoutAndroid仿网易云音乐滑动菜单
- 用SHELL脚本自动化安装Nagios服务器端和客户端的
- 插入排序
- DelphiXE Ansi字符串UTF-8编码判断
- PAGE_ALIGN 详解 纯属原创 转载注明出处
- String三个注意事项
- 安卓解压zip文件,解压后多级目录显示
- Commit message 和 Change log 编写指南
- Android Dalvik虚拟机内存分配问题
- 支持向量机通俗导论(理解SVM的三层境界)