一、安装nagios前的准备工作

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.

转载于:https://blog.51cto.com/fodaa/1373396

安装配置nagios相关推荐

  1. 安装配置nagios+nrpe+nconf

    安装配置nagios+nrpe+nconf Nagios是一个功能非常强大的开源的系统网络监测程序,通过访问http://www.nagios.org可以了解其基本特性.Nagios不但能够实现对系统 ...

  2. Nagios+pnp4nagios+rrdtool 安装配置nagios(一)

    基于的软件版本 Apache-2.0.63  php-5.3.2 nagios-3.2.3  nagios-plugins-1.4.15  rrdtool-1.4.5 nrpe-2.12 pnp4na ...

  3. 【集群监控——Cacti、Nagios、Zabbix安装配置过程】

    常见三大集群监控软件 常见监控平台 Cacti 组件说明 1)SNMP 2)RRDtool Cacti监控组件安装配置 Nagios 老牌监控服务器 Cacti – Nagios 对比 Nagios ...

  4. 在LNMP下用nginx 1.4.7配置nagios监控

    因为网上的教程nginx的版本比较old,所以用新版本的nginx配置教程多数有错误,下面整理,希望能帮到你 LNMP环境已经搭建好,nginx版本是1.4.7,php版本是5.3.17, 1 2 c ...

  5. Centos 7安装与配置nagios监控(一)

    目  录 序言(必备知识) 一.安装规划 1.1系统环境 1.2所需软件包 二.配置安装环境 2.1同步时间 2.2禁用SElinux 2.3 xftp上传软件包 2.4安装邮件服务 三.监控主机安装 ...

  6. CentOS6.5下的Nagios安装配置详解(图文)

    最近因为,科研需要,接触上了Nagios,这里,我将安装笔记做个详解.为自己后续需要和博友们学习! VMware workstation 11 的下载 VMWare Workstation 11的安装 ...

  7. 尚观第15天nagios安装配置

    添加帐户和组: useradd nagios groupadd nagcmd usermod -G nagcmd nagios usermod -G nagcmd apache nagios安装: t ...

  8. Nagios安装配置

    知识目标: 掌握Nagios监控 技能目标: 掌握Nagios监控服务的搭建和配置 实训环境: 静态网络地址的配置 主机名配置 配置本地yum源 关闭selinux服务,关闭防火墙 Nagios-se ...

  9. Ubuntu 11.10搭建和配置Nagios

    安装ubuntu 11.10 Desktop 32bit 安装 apache2.php5.openssl.libssl-dev.gcc编译器与开发库.gd开发库.php.php-apache.php相 ...

最新文章

  1. python 字典 的pop 方法
  2. Linux操作系统及平台虚拟化技术漫谈
  3. spring 基本配置学习
  4. NDK 交叉编译常用变量
  5. OpenCV放大视频Upscaling video
  6. centos上使用高版本gcc、g++
  7. diy实现spring依赖注入
  8. python实现sha1加密算法
  9. Qt/C++ 网易云api 在线播放音乐
  10. CAD制图初学入门:CAD图案填充之图案加洞
  11. 被黑多年的WPS上市,背后:雷军拒绝收购,死磕微软 31 年
  12. 随机出题在线考试系统php_随机出题在线考试系统
  13. vivo X80Pro和iQOO 9Pro哪个值得入手 两者配置对比
  14. ODrive应用 #3 odrive_gui入门指南
  15. 开源项目-绩效管理系统pms
  16. 高通Camera数字成像系统简介
  17. java多线程设计模式详解[推荐]
  18. js的event详解
  19. 倍加福PVS58N-011AGR0BN-0013编码器
  20. 目标检测之R-CNN

热门文章

  1. ELK6.0日志从收集到处理完整版教程(二)
  2. Android DataBinding 从入门到进阶
  3. Elon Mask又搞大事情:新公司要将人脑与机器连接,给大脑上传想法不再是科幻...
  4. MySQL必知必会笔记(六)存储过程 游标 触发器
  5. 第一课.axis配置和写法入门
  6. Virtual Box创建共享目录
  7. 如何用相机拍出天空漂亮的云朵
  8. 无线网络安全认证[AD+Radius+CA]配置
  9. 大数据可视化有什么作用
  10. 通俗易懂的MonteCarlo积分方法(五)