Ngaios安装文档

Nagios安装文档

1.创建nagios和apache用户和nagcmd用户组

useradd -M -s /sbin/nologin nagios

groupadd nagcmd

usermod -G nagcmd nagios

usermod -G nagcmd apache

[[email protected] ~]# useradd -M -s /sbin/nologin nagios

[[email protected] ~]# groupadd nagcmd

[[email protected] ~]# usermod -G nagcmd nagios

[[email protected] ~]# usermod -G nagcmd apache

2.安装相关的软件包

yum install gcc gcc-c++ glibc glibc-common gd-devel gd -y

[[email protected] ~]# yum install gcc gcc-c++ glibc glibc-common gd-devel gd -y

3.安装Apache和php

yum install httpd php -y

[[email protected] ~]# yum install httpd php -y

4.下载nagios源码包。

5.解压nagios源码包并编译安装

tar xf nagios-4.0.8.tar.gz

cd nagios-4.0.8

./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-command-group=nagcmd

make all

make install

make install-init

make install-commandmode

make install-config

make install-webconf

[[email protected] ~]# tar xf nagios-4.0.8.tar.gz

[[email protected] ~]# cd nagios-4.0.8

[[email protected]nagios-4.0.8]#./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-command-group=nagcmd

[[email protected] nagios-4.0.8]# make all

[[email protected] nagios-4.0.8]# make install

[[email protected] nagios-4.0.8]# make install-init

[[email protected] nagios-4.0.8]# make install-commandmode

[[email protected] nagios-4.0.8]# make install-config

[[email protected] nagios-4.0.8]# make install-webconf

make install-webconf这命令有个提示:因为这条命令默认是把配置文件复制到/etc/httpd/conf.d/下边的,如果是编译安装的Apache就需要创建/etc/httpd/conf.d/这个目录,然后在httpd.conf配置文件中添加include /etc/httpd/conf.d/。用yum安装的httpd则不需要创建/etc/httpd/conf.d/目录。

sed -i ‘s/[email protected]/[email protected]/‘ /usr/local/nagios/etc/objects/contacts.cfg

[[email protected] nagios-4.0.8]#sed -i ‘s/[email protected]/[email protected]/‘ /usr/local/nagios/etc/objects/contacts.cfg

#必须开启sendmail、检查端口

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

[[email protected] nagios-4.0.8]#htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

#添加nagios管理用户、就是http://IP/nagios/所使用的用户。

#如果使用其他的用户名,请修改/usr/local/nagios/etc/cgi.cfg配置文件的参数

#我的建议是把nagiosadmin替换掉,因为nagiosadmin每个人都知道,这样不安全。

service nagios start

[[email protected] nagios-4.0.8]# service nagios start

#启动nagios服务

[[email protected] nagios-4.0.8]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

[[email protected] nagios-4.0.8]# /etc/init.d/nagios checkconfig

#检查配置文件语法

6.下载nagios-plugins插件包

7.解压nagios-plugins插件包并编译安装

tar xf nagios-plugins-2.0.3.tar.gz

cd nagios-plugins-2.0.3

./configure --with-nagios-user=nagios --with-nagios-group=nagios

make

make install

[[email protected] ~]# tar xf nagios-plugins-2.0.3.tar.gz

[[email protected] ~]# cd nagios-plugins-2.0.3

[[email protected]nagios-plugins-2.0.3]#./configure --with-nagios-user=nagios --with-nagios-group=nagios

[email protected] nagios-plugins-2.0.3]# make

#如果编译遇到make:***[all] Error 2则confiure加--with-mysql=/usr/local/mysql 解决

[email protected] nagios-plugins-2.0.3]# make install

[[email protected] nagios-plugins-2.0.3]# ls /usr/local/nagios/libexec/ | wc -l

58

#查看安装了多少个插件、我这里是58个。

8.下载nrpe插件包

9.解压nrpe插件包并编译安装

[[email protected] ~]# tar xf nrpe-2.15.tar.gz

[[email protected] ~]# cd nrpe-2.15

[[email protected] nrpe-2.15]# ./configure

[[email protected] nrpe-2.15]# make all

[[email protected] nrpe-2.15]# make install-plugin

[[email protected] nrpe-2.15]# make install-daemon

[[email protected] nrpe-2.15]# make install-daemon-config

[[email protected] nrpe-2.15]# /usr/sbin/ntpdate pool.ntp.org

[[email protected] nrpe-2.15]# echo ‘*/10 * * * * /usr/sbin/ntpdate pool.ntp.org >/dev/null 2>&1‘ >>/var/spool/cron/root

#同步时间并定义计划任务

[[email protected] nrpe-2.15]# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

[[email protected] nrpe-2.15]# netstat -lnpt | grep 5666

#启动nrpe服务

[[email protected] nrpe-2.15]# pkill nrpe

#关闭nrpe服务

10.客户端安装nagios-plugins和nrpe插件

useradd -M -s /sbin/nologin nagios

tar xf nagios-plugins-2.0.3.tar.gz

cd nagios-pligins-2.0.3

./configure --with-nagios-user=nagios --with-nagios-group=nagios

make

make install

[[email protected] ~]# useradd -M -s /sbin/nologin nagios

[[email protected] ~]# tar xf nagios-plugins-2.0.3.tar.gz

[[email protected] ~]# cd nagios-pligins-2.0.3

[[email protected] nagios-plugins-2.0.3]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios

[[email protected] nagios-plugins-2.0.3]# make

[[email protected] nagios-plugins-2.0.3]# make install

[[email protected] ~]# tar xf nrpe-2.15.tar.gz

[[email protected] ~]# cd nrpe-2.15

[[email protected] nrpe-2.15]# ./configure

#出现这个错误是因为缺少openssl-devel软件包,使用yum install openssl-devel -y 即可

[[email protected] nrpe-2.15]# make all

[[email protected] nrpe-2.15]# make install-plugin

[[email protected] nrpe-2.15]# make install-daemon

[[email protected] nrpe-2.15]# make install-daemon-config

[[email protected] ~]# sed -i ‘s/allowed_hosts=127.0.0.1/allowed_hosts=192.168.0.148/‘ /usr/local/nagios/etc/nrpe.cfg

#允许192.168.0.148的主机来监控本主机

[[email protected] ~]# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

[[email protected] ~]# netstat -lnpt | grep 5666

[[email protected] ~]# lsof -i tcp:5666

#启动nrpe服务、关闭nrpe服务的命令是pkill nrpe

11.服务器配置

#hosts.cfg的配置

define host{

use                     linux-server

host_name               lamp-1

alias                   lamp-1

address                 192.168.1.114

check_command           check-host-alive

}

#某些参数请看模板文件,templates.cfg

define hostgroup{

hostgroup_name  linux-servers

alias           Linux Servers

members         lamp-1

}

#services.cfg配置

define service{

use                     generic-service

host_name               lamp-1

service_description     DISK

check_command           check_disk!20%!10%!/

}

define service{

use                      generic-service

host_name                lamp-1

service_description      LOAD

check_command            check_load!15,10,5!30,25,20

}

12.客户端配置

#编辑/usr/local/nagios/etc/nrpe.cfg,添加一下内容

#启动nrpe服务

[[email protected] ~]# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

[[email protected] ~]# netstat -lnpt | grep 5666

时间: 2024-08-04 06:51:26

Ngaios安装文档的相关文章

mysql安装文档(Linux 官网yum安装版)

mysql安装文档(官网yum安装Linx版) 创建时间:2016-12-20 文档目的 在Linux下安装mysql服务端应用. (注:本文档采用yum库安装方式安装mysql应用,本文假设您的系统中没有安装第三方发布的rpm包,如果您已经安装了第三方rpm包,请参考文中"替换第三方发布mysql"的内容) 系统环境 操作系统:centos 7 (3.10.0-229.el7.x86_64) mysql版本:mysql57-community-release-el7-9.noarch

ORACLE LINUX 6.3 + ORACLE 11.2.0.3 RAC + VBOX安装文档

ORACLE LINUX 6.3 + ORACLE 11.2.0.3 RAC + VBOX安装文档 2015-10-21 12:51 525人阅读 评论(0) 收藏 举报  分类: Oracle RAC 版权声明:本文为博主原创文章,未经博主允许不得转载. VBOX + Oracle Linux 6U3 + ORACLE 11.2.0.3.0 RAC 安装 环境: 虚拟机          VIRTUAL BOX OS                ORACLE LINUX 6.3_X86_64

Oracle、pl/sql安装文档

oracle10g.pl/sql安装文档 Oracle在各种管理系统项目中是不可或缺到,pl/sql也是非常好用的图形化管理工具.初学者(我自己就是证明了)经常在这两个工具上消磨宝贵到时间.趁今天有闲,整理下oracle和plsql到安装方式(后附oracle和plsql到安装包),以备后用及方便他人.个人笔记本是win7 64位,实测win8可用. 下载并解压oracle安装包如下图: 右键单击setup.exe,在菜单中选择兼容性疑难解答,弹出新窗口. 选择尝试建议到设置,在跳转到页面中启动

OEM12C安装文档

OEM12C安装文档 环境:OEM12.1.0.5 操作系统:CENTOS6.7 ORACLE:11.2.0.3 1.硬件要求 2.软件包要求 ----RHEL6.X OEL6.X版本 for oms make-3.81 binutils-2.20.51.0.2-5.11 gcc-4.4.4 libaio-0.3.107 glibc-common-2.12-1 libstdc++-4.4.4 libXtst-1.0.99.2-3.el6.x86_ 64.rpm sysstat-9.0.4 gli

基于adt bundle for windows-的AndroidOpenCV安装文档说明

基于adt bundle for windows-的AndroidOpenCV安装文档说明 任薛纪 说明:本文档是基于快速搭建android开发平台adt bundle for windows软件的AndroidOpenCV运行环境搭建,主要参考OpenCV官方文档: http://docs.opencv.org/trunk/doc/tutorials/introduction/android_binary_package/android_dev_intro.html,如手动安装eclipse.

Visual studio 2010不能安装文档

问题:visual studio 2010重新安装过程中不能安装文档,显示无权限获得文档: 点击ok后,冲本地磁盘或者联网安装帮助文档,会出现灰色不可选的安装路径 解决: 通过修改Helplibmanager的配置文件HelpLibManager.exe.config,该文件在目录系统盘下C:\Program Files\Microsoft Help Viewer\v1.0 编辑配置文件 HelpLibManager.exe.config, 修改<add key="FirstTimeRun

_00024 尼娜抹微笑伊拉克_云计算ClouderaManager以及CHD5.1.0群集部署安装文档V1.0

笔者博文:妳那伊抹微笑 itdog8 地址链接 : http://www.itdog8.com(个人链接) 博客地址:http://blog.csdn.net/u012185296 博文标题:_00024 妳那伊抹微笑_云计算之ClouderaManager以及CHD5.1.0集群部署安装文档V1.0 个性签名:世界上最遥远的距离不是天涯,也不是海角.而是我站在妳的面前.妳却感觉不到我的存在 技术方向:Flume+Kafka+Storm+Redis/Hbase+Hadoop+Hive+Mahou

Nginx 安装文档 (二)PHP

下载.编译安装 wget http://cn2.php.net/distributions/php-5.4.7.tar.gz tar zvxf php-5.4.7.tar.gz cd php-5.4.7 ./configure --prefix=/usr/local/php  --enable-fpm --with-mcrypt --enable-mbstring --disable-pdo --with-curl --disable-debug  --disable-rpath --enabl

Nginx 安装文档

一.下载软件 wget http://nginx.org/download/nginx-1.6.0.tar.gz 安装 用于 RedHat 系发行版 (RHEL, CentOS, Fedora). 本维基站点的服务器就是以此选项编译. 首先安装需求包: yum install gccopenssl-devel pcre-devel zlib-devel 添加用户 useradd –d /usr/local/nginx -s /sbin/nologin nginx tar zxvf nginx-1