公司的一个项目网站,上线几天就因为磁盘暴满而出了问题,由于其服务器都集中在某一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-develuseradd nagiosgroupadd
nagcmdusermod -G
nagcmd nagiosusermod -G
nagcmd apachecd /usr/local/srcwget
http://nchc.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.6.tar.gzwget
http://nchc.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gzwget
http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.13.tar.gztar zxvf
nagios-3.0.6.tar.gzcd nagios-3.0.6./configure --with-command-group=nagcmd
--prefix=/usr/local/nagiosmake allmake installmake install-initmake install-configmake install-commandmodemake install-webconfcd ../tar zxvf
nagios-plugins-1.4.13.tar.gzcd nagios-plugins-1.4.13./configure --prefix=/usr/local/nagios --with-nagios-user=nagios
--with-nagios-group=nagiosmake && make installcd ../tar zxvf
nrpe-2.13.tar.gzcd nrpe-2.13./configuremake allmake install-pluginmake install-daemonmake install-daemon-confightpasswd
-bc /usr/local/nagios/etc/htpasswd.users nagiosadminnagiosadmin101echo "alias nagioscheck='/usr/local/nagios/bin/nagios -v/usr/local/nagios/etc/nagios.cfg'
" >> /root/.bashrcsource /root/.bashrcchkconfig
nagios onchkconfig
httpd onservice
httpd startservice
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 nagioscd /usr/local/srcwget
http://nchc.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gzwget
http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.13.tar.gztar zxvf
nagios-plugins-1.4.13.tar.gzcd nagios-plugins-1.4.13./configuremakemake installchown nagios:nagios /usr/local/nagioschown -R
nagios:nagios /usr/local/nagios/libexeccd ../tar zxvf
nrpe-2.13.tar.gzcd nrpe-2.13./configuremake allmake install-pluginmake install-daemonmake install-daemon-configsed -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
-decho "/usr/local/nagios/bin/nrpe
-c /usr/local/nagios/etc/nrpe.cfg -d" >> /etc/rc.local |
Nagios监控系统部署
本文详细介绍了一种在CentOS 5.5至5.8 x86_64平台上自动部署Nagios监控系统的脚本,包括服务器端和客户端的安装配置过程,并提供了具体的步骤与注意事项。
169

被折叠的 条评论
为什么被折叠?



