Nagios在Ubuntu server上的安装配置
首先我参看的是Nagios的官方文档,Nagios – Installing Nagios Core From Source——The Industry Standard in IT Infrastructure Monitoring,但是文档写的不够详细,对于安装的部分写的过于简略,缺少了几个步骤。
下面我将叙述详细步骤。
#首先安装必要的软件包:
sudo apt-get install wget build-essential apache2 php5-gd libgd2-xpm libgd2-xpm-dev libapache2-mod-php5
#下载软件包
cd /tmp
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.1.tar.gz
wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz
#添加组和用户
useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
#解压缩
tar zxvf nagios-3.4.1.tar.gz
tar zxvf nagios-plugins-1.4.15.tar.gz
cd nagios
./configure --with-nagios-group=nagios --with-command-group=nagcmd -–with-mail=/usr/bin/sendmail
cd /tmp/nagios-plugins-1.4.15
./configure --with-nagios-user=nagios --with-nagios-group=nagios
#安装
make all
# 使用make install来安装主程序,CGI和HTML文件
make install
# 使用make install-init在/etc/rc.d/init.d安装启动脚本
make install-init
# 使用make install-cofig来安装示例配置文件,安装的路径是/usr/local/nagios/etc.
make install-config
# 使用make install-commandmode来配置目录权限
make install-commandmode
Nagios目录功能的简要说明:
- bin Nagios执行程序所在目录,nagios文件即为主程序
- etc Nagios配置文件位置
- sbin Nagios Cgi文件所在目录,也就是执行外部命令所需文件所在的目录
- Share Nagios网页文件所在的目录
- var Nagios日志文件、spid 等文件所在的目录
- var/archives 日志归档目录
- var/rw 用来存放外部命令文件
#配置apache
将下面的行加入apache配置文件/etc/apache2/httpd.conf的alias模块<IfModule alias_module>,因为我的httpd.conf文件为空,因此自行创建了该模块。
<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://localhost/bar #
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path. #
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
Alias /nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
</IfModule>
# 创建apache目录验证文件
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password: (输入密码)
Re-type new password: (再输入一次密码)
Adding password for user nagiosadmin
# 重启apache:
service apache2 restart
# 检查Nagios配置文件
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
# 启动Nagios
service nagios start
在浏览器中打开http://<your.nagios.server.ip>/nagios。
Nagios主界面如下图:
登录时要求输入用户名密码,用户名是nagiosadmin,密码即为上面你自己设置的密码。
安装完成。
参考:
http://bbs.chinaunix.net/thread-1394907-1-1.html 【Nagios3.0.5在CentOS5.2中安装(一) 】
http://blog.163.com/jackswu@yeah/blog/static/140629123201091675325673/ 【Apache项目路径重定位】
http://www.ibm.com/developerworks/cn/linux/l-ganglia-nagios-2/ 【Ganglia 和 Nagios,第 2 部分: 使用 Nagios 监视企业集群】
Nagios在Ubuntu server上的安装配置的更多相关文章
- Ubuntu Server 13.10 安装配置图解教程
一.Ubuntu Server 13.10系统安装 Ubuntu分为桌面版(desktop)和服务器版(Server),下面为大家介绍服务器版本Ubuntu Server 13.10的详细安装过程. ...
- Ubuntu Server 上在安装Nginx时执行./confgiure后提示:C compiler cc is not found
场景 Ubuntu Server 16.04 LTS上怎样安装下载安装Nginx并启动: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/detai ...
- Ubuntu Server上的LVM配置
在安装Linux的时候,通常遇到的一个比较头痛的问题就是分区,到底每个区该分多少,用了一段时间之后,某个分区又不够用了,该怎么办?如果是普通的服务器,那一切都好说,大不了就关机重新划分分区嘛,但是对于 ...
- 在Ubuntu Server上源码安装OpenERP 8.0,并配置wsgi和nginx运行环境
原文: How to install OpenERP 8.0 Alpha on a fresh Debian / Ubuntu server. OpenERP的安装,可以有多种方式,通过添加源,到 h ...
- 一台Ubuntu server上安装多实例MySQL
受环境所迫,在一台Ubuntu server上安装多个实例MySQL. 手动安装MySQL 环境:Ubuntu server 11.10 64bit + mysql-5.5.17-linux2.6-x ...
- Docker-Compose简介与Ubuntu Server 上安装Compose
Compose简介 Compose是Docker官方的开源项目,负责对Docker容器集群的快速编排. Compose是定义和运行多个Docker容器的应用. 举例来说: 一个项目除了Tomcat容器 ...
- Ubuntu Server 12.04安装图解教程
Ubuntu S ...
- ubuntu14.04 server ftp 服务安装配置详解
ubuntu14.04 server ftp 服务安装配置详解 cheungmine 2016-01-27 http://wiki.ubuntu.com.cn/Vsftpd 0 安装好vsftpd服务 ...
- Ubuntu Server 上使用Docker Compose 部署Nexus(图文教程)
场景 Docker-Compose简介与Ubuntu Server 上安装Compose: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/deta ...
随机推荐
- 值班问题:insert语句插入了两条数据?
上周值班,碰到这样的一个客户问题,表结构简化如下: CREATE TABLE `aa` (`c1` int(10) unsigned NOT NULL AUTO_INCREMENT,`c2` int( ...
- [转] error LNK2026: 模块对于 SAFESEH 映像是不安全的
原文 今天使用VS2012遇到一个问题:"链接器工具错误 LNK2026 XXX模块对于 SAFESEH 映像是不安全的" 解决方法: 1.打开该项目的“属性页”对话框. 2.单击 ...
- 【LeetCode 221】Maximal Square
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and ret ...
- 【和我一起学python吧】Python 启航
话说万张高楼平地起,不会走之前先学会爬吧.尤其对于我等的小菜同学来说更是这样,不管怎么先code first吧,等我等小菜们翅膀硬了才test first吧. 1, 怎么运行python? 先到pyt ...
- 机器学习中的数学(1)-回归(regression)、梯度下降(gradient descent)
版权声明: 本文由LeftNotEasy所有,发布于http://leftnoteasy.cnblogs.com.如果转载,请注明出处,在未经作者同意下将本文用于商业用途,将追究其法律责任. 前言: ...
- git常用命令[持续更新]
git commit -am "abc" 提交已经删除过的文件 git reset --hard HEAD 用于清除跟踪文件的修改
- Base64编解码(C++版)
#include <string> using namespace std; class ZBase64 { public: /*编码 DataByte [ ...
- homework-06
围棋问题 关于代码的阅读,写注释,我的代码阅读量和阅读能力都有限,而且是关于没有基础的围棋问题,JAVA和C#混合的程序.不免参考了其他同学的思路,忘老师见谅. 1.playPrev(GoMove) ...
- NSLog说明
%@ 对象 %d,%i 整型 (%i的老写法) %hd 短整型 %ld , %lld 长整型 %u 无符整型 %f 浮点型和double型 %0.2f 精度浮点数,只保留两位小数 %x,%X 二进制整 ...
- DBMS_ERRLOG记录DML错误日志(二)
上一篇简单介绍了DML记录语句的限制,虽然所有的例子都是利用INSERT语句,但是LOG ERRORS语句并没有这个限制,UPDATE.DELETE和MERGE都可以使用这个语句.下面要说的就是这篇的 ...