FreeBSD 下用nagios来监控网络服务器和网络服务(2)

 

3)获得图库文件:

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

 

4)NRPE,版本2.5.2

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

 

5)NSCA,版本2.6

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

 

3:切换到root用户:

sudo su

 

4:解压缩

tar zxvf nagios-2.5.tar.gz

 

5:建立运行nagios的用户:

adduser nagios

 

6:建立安装nagios的文件夹,并使这个文件夹的所有者为nagios:nagios

mkdir /usr/local/nagios

chown nagios.nagios /usr/local/nagios

 

7:确认web服务器的用户

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

grep “^User” /usr/local/apache2/conf/httpd.conf

 

8:建立命令文件组

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

pw groupadd nagcmd

pw usermod apache -G nagcmd

pw usermod nagios -G nagcmd

———————————-

cat /etc/group

nagcmd:*:9007:apache,nagios

———————————-

 

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

cd nagios-2.5

./configure –prefix=/usr/local/nagios –with-gd-lib=/usr/local/lib –with-gd-inc=/usr/local/include

———————————

*** Configuration summary for nagios 2.5 07-13-2006 ***:

 

General Options:

————————-

Nagios executable: nagios

Nagios user/group: nagios,nagios

Command user/group: nagios,nagios

Embedded Perl: no

Event Broker: yes

Install ${prefix}: /usr/local/nagios

Lock file: ${prefix}/var/nagios.lock

Init directory: /usr/local/etc/rc.d

Host OS: freebsd6.0

 

Web Interface Options:

————————

HTML URL: ]http://localhost/nagios/[/url]

CGI URL: ]http://localhost/nagios/cgi-bin/[/url]

Traceroute (used by WAP): /usr/sbin/traceroute

 

 

Review the options above for accuracy. If they look okay,

type ‘make all’ to compile the main program and CGIs.

———————————

make all

make install

make install-init

make install-commandmode

make install-config

 

9:安装nagios-plugins

tar zxvf nagios-plugins-1.4.3.tar.gz

cd nagios-plugins-1.4.3

./configure –prefix=/usr/local/nagios-plugins

make all

make install

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

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

 

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

tar –xvzf imagepak-base.tar.gz

解压以后是base目录

mv base/ /usr/local/nagios/share/images/logos/

 

———————————————————————-

以下文章点击率最高

Loading…

发表评论