Molet

nagios监控网络服务器和网络服务安装篇

Molet 安全防护 2023-01-06 475浏览 0

nagios的安装比较简单,复杂的是设置和配置参数的设定。不过你要放松一点,毕竟我们要搞定它,不是吗?那就开始吧:

1:获得***的安装包

下载地址:http://www.nagios.org/download

2:以root身份登录服务器

目前***的版本是2.5:

1)nagios,版本2.5:

fetchhttp://superb-west.dl.sourceforge.net/sourceforge/nagios/nagios-2.5.tar.gz

or

wgethttp://superb-west.dl.sourceforge.net/sourceforge/nagios/nagios-2.5.tar.gz

2)获得nagios插件,版本1.4.3:

http://surfnet.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.3.tar.gz

3)获得图库文件:

http://dl.sf.net/nagios/imagepak-base.tar.gz

4)NRPE,版本2.5.2

http://ufpr.dl.sourceforge.net/sourceforge/nagios/nrpe-2.5.2.tar.gz

5)NSCA,版本2.6

http://kent.dl.sourceforge.net/sourceforge/nagios/nsca-2.6.tar.gz

3:切换到root用户

sudosu

4:解压缩

tarzxvfnagios-2.5.tar.gz

5:建立运行nagios的用户

addusernagios

6:建立安装nagios的文件夹

使这个文件夹的所有者为nagios:nagios

mkdir/usr/local/nagios

chownnagios.nagios/usr/local/nagios

7:确认web服务器的用户

可能会通过web接口执行一些命令,必须确定web服务器以哪个用户运行的,通常为:apache:

grep"^User"/usr/local/apache2/conf/httpd.conf

8:建立命令文件组

这个新的组会包括apache的用户和nagios的用户

pwgroupaddnagcmd 
pwusermodapache-Gnagcmd 
pwusermodnagios-Gnagcmd 
---------------------------------- 
cat/etc/group 
nagcmd:*:9007:apache,nagios 
----------------------------------

9:运行配置脚本并安装nagios

cdnagios-2.5 
./configure--prefix=/usr/local/nagios--with-gd-lib=/usr/local/lib--with-gd-inc=/usr/local/include 
--------------------------------- 
***Configurationsummaryfornagios2.507-13-2006***: 

GeneralOptions: 
------------------------- 
Nagiosexecutable:nagios 
Nagiosuser/group:nagios,nagios 
Commanduser/group:nagios,nagios 
EmbeddedPerl:no 
EventBroker:yes 
Install${prefix}:/usr/local/nagios 
Lockfile:${prefix}/var/nagios.lock 
Initdirectory:/usr/local/etc/rc.d 
HostOS:freebsd6.0 

WebInterfaceOptions: 
------------------------ 
HTMLURL:http://localhost/nagios/ 
CGIURL:http://localhost/nagios/cgi-bin/ 
Traceroute(usedbyWAP):/usr/sbin/traceroute 


Reviewtheoptionsaboveforaccuracy.Iftheylookokay, 
type'makeall'tocompilethemainprogramandCGIs. 
--------------------------------- 
makeall 
makeinstall 
makeinstall-init 
makeinstall-commandmode 
makeinstall-config

10:安装nagios-plugins

tarzxvfnagios-plugins-1.4.3.tar.gz 
cdnagios-plugins-1.4.3 
./configure--prefix=/usr/local/nagios-plugins 
makeall 
makeinstall

安装完成以后在/usr/local/nagios-plugins-plugins会产生一个libexec的目录,将该目录全部移动到/usr/local/nagios目录下即可。

mv/usr/local/nagios-plugins-plugins/libexec//usr/local/nagios/

11:imagepak-base.tar.gz的安装

tar–xvzfimagepak-base.tar.gz

解压以后是base目录

mvbase//usr/local/nagios/share/images/logos/

nagios的安装过程到这就结束了,您的操作一定要认真和准确,若果您对nagios还不是很熟悉,推荐您先看一下nagios监控网络服务器和网络服务概念篇做一个初步,这样会使得服务配置更顺利地进行。若果您的主机已经准备好以上工作,我们就开始配置nagios,参见:故障解决篇和配置篇

继续浏览有关 安全 的文章
发表评论