安装配置nagios-创新互联

一、安装nagios前的准备工作

渭源ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为创新互联建站的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:18982081108(备注:SSL证书合作)期待与您的合作!

1.解决安装Nagios的依赖关系:Nagios基本组件的运行依赖于httpd、gcc和gd

2. 所需要安装组件:

服务端所用的安装包为 nagios nagios-plugins

linux客户端 nrpe

windows客户端 NSClient++

二.下载需求软件

nagios主程序:wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz

nagios插件程序:wget http://down1.chinaunix.net/distfiles/nagios-plugins-1.4.13.tar.gz

apache程序:wget http://autosetup1.googlecode.com/files/httpd-2.2.11.tar.gz

php程序:wget http://museum.php.net/php5/php-5.3.0.tar.gz

三.编译安装nagios

1.tar zxf nagios-3.1.2.tar.gz

[root@localhost nagios-3.1.2]#  cd nagios-3.1.2

[root@localhost nagios-3.1.2]#./configure --enable-event-broker--prefix=/usr/local/nagios

[root@localhost nagios-3.1.2]#make all

[root@localhost nagios-3.1.2]#make install

[root@localhost nagios-3.1.2]#make install-init

[root@localhost nagios-3.1.2]#make install-config

[root@localhost nagios-3.1.2]#make install-commandmode

在httpd的配置文件目录(conf.d)中创建Nagios的Web程序配置文件:

 [root@localhost nagios-3.1.2]# make install-webconf

创建一个登录nagiosweb程序的用户,这个用户帐号在以后通过web登录nagios认证时所用:

# htpasswd -c/var/www/nagios/etc/htpasswd.users nagiosadmin

2.编译安装nagios-plugins

nagios的所有监控工作都是通过插件完成的,因此,在启动nagios之前还需要为其安装官方提供的插件。

tar zxf nagios-plugins-1.4.13.tar.gz

[root@localhost nagios-plugins-1.4.13]#cd nagios-plugins-1.4.13

[root@localhost nagios-plugins-1.4.13]#./configure --with-nagios-user=nagios --with-[root@localhost nagios-plugins-1.4.13]#nagios-group=nagios -with-mysql

[root@localhost nagios-plugins-1.4.13]#make

[root@localhost nagios-plugins-1.4.13]#make install

4.配置并启动Nagios

/etc/init.d/nagios start

注:如果启动时会报错

Error: Cannot open main configuration file '/root/nagios-plugins-1.4.13/start' for reading!

Nagios 3.1.2 starting... (PID=14327)

Local time is Fri Feb 28 02:52:22 CST 2014

Bailing out due to one or more errors encountered in the configuration files. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=14327)

使用: /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg检查配置文件没有发现错误

可使用:/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg 尝试启动

启动成功之后 可以使用top命令查看是否有nagios进程(有nagios进程说明启动成功)

注: service nagios restart 启动时再次失败

Running configuration check...done.

Stopping nagios: done.

Starting nagios:su: warning: cannot change directory to /home/nagios: No such file or directory

This account is currently not available.

done.

可以使用: mkdir /home/nagios 解决

service nagios restart 如果启动时仍然失败 但错误提示是:

Running configuration check...done.

Stopping nagios: done.

Starting nagios:This account is currently not available.

done.

可以在:vi  /etc/passwd

找到此行:nagios:x:500:500::/home/nagios:/sbin/nologin(注意红色字体),把此行改成如下一行

    nagios:x:500:500::/home/nagios:/bin/bash

修改后再次重启 ,启动成功

[root@localhost nagios-3.1.2]# service nagios restart

Running configuration check...done.

Stopping nagios: done.

Starting nagios: done.

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。

网页题目:安装配置nagios-创新互联
标题路径:https://www.cdcxhl.com/article44/dojgee.html

成都网站建设公司_创新互联,为您提供网站导航网页设计公司Google关键词优化移动网站建设手机网站建设

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

手机网站建设