Nagios的安装与配置(1)
本帖最后由 monicazhang 于 2015-10-30 21:42 编辑20151030淡然
Nagios的安装与配置安装环境... 2nagios的安装... 2创建nagios用户... 2安装apache和php. 2安装Nagios. 3
Nagios目录介绍... 3安装plugins插件... 3安装nrpe. 3安装pnp4nagios-0.6.6插件... 4 nagios安装
Nagios的配置... 6配置apache. 6创建apache目录验证文件... 7配置nagios. 7
修改cgi.cfg. 7修改nagios.cfg. 7修改commands.cfg. 7修改contacts.cfg. 8修改contactgroups.cfg. 8添加被监控机... 8监控机配置... 8修改hosts.cfg. 8修改services.cfg. 9被监控机配置... 9被监控机安装plugin. 9被监控机安装nrpe. 10
配置... 10nagios事件自动处理... 11报警通知... 13邮件报警通知... 13安装配置sendmail 13nagios邮件报警配置... 14短信报警通知... 16安装飞信机器人... 16Nagios短信报警配置... 17 开源监控软件故障排除... 18邮件和短信分时报警... 18
安装环境 环境说明:监控机centos6.2 x86_64ip为172.26.188.201被监控机centos6.2 x86_64ip为 172.26.188.202
所用软件包:nagios-3.4.1.tar.gznagios-plugins-1.4.16.tar.gznrpe-2.13.tar.gzpnp4nagios-0.6.19.tar.gznagios的安装创建nagios用户 #useradd nagios#mkdir /usr/local/nagios#chown –R nagios.nagios /usr/local/nagios
安装apache和php #yum install httpd#yum install php php-mysql php-mbstringphp-gd* nagios配置
安装Nagios # tar -zxvf nagios-3.4.1.tar.gz# cd nagios#./configure --prefix=/usr/local/nagios#make all#make install#make install-init#make install-commandmode#make install-configNagios目录介绍 Nagios安装完成后,各个目录结构以及功能说明如下表所示:
安装plugins插件 这里下载的版本是nagios-plugins-1.4.16。注意:插件版本与nagios版本的关联并不大。#tar –zxvf nagios-plugins-1.4.16.tar.gz#cd nagios-plugins-1.4.16#./configure --prefix=/usr/local/nagios# make # make install安装完成,在/usr/local/nagios下的libexec目录下,生成很多可执行文件,这些正是nagios所需要的插件。
安装nrpe #tar -zxvf nrpe-2.13.tar.gz#cd nrpe-2.13#./configure --prefix=/usr/local/nagios#make all#make install-plugin
安装pnp4nagios-0.6.6插件#tar -zxvf pnp4nagios-0.6.19.tar.gz 监控软件
#cd pnp4nagios-0.6.19
# ./configure --with-nagios-user=nagios --with-nagios-group=nagios#make all
#make install# make install-webconf# make install-config# make install-init 创建配置文件#cd /usr/local/pnp4nagios/etc#cp misccommands.cfg-samplemisccommands.cfg#cp nagios.cfg-samplenagios.cfg#cp rra.cfg-sample rra.cfg#cd pages#cp web_traffic.cfg-sample web_traffic.cfg# cd ../check_commands#cp check_all_local_disks.cfg-samplecheck_all_local_disks.cfg#cp check_nrpe.cfg-samplecheck_nrpe.cfg#cp check_nwstat.cfg-samplecheck_nwstat.cfg 重启服务#/etc/init.d/npcd restart 修改 nagios 的配置文件.打开performance_data#vi /usr/local/nagios/etc/nagios.cfg打开注释 nagios实施 项:process_performance_data=1host_perfdata_command=process-host-perfdataservice_perfdata_command=process-service-perfdata修改 commands.cfg#vi /usr/local/nagios/etc/objects/commands.cfg##添加# 'process-host-perfdata' command definitiondefine command{ command_name process-host-perfdata command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl }# 'process-service-perfdata' command definitiondefine command{ command_name process-service-perfdata command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl nagios培训
待续:http://ITIL-foundation.cn/thread-53043-1-1.html
本帖关键字:Nagios
页:
[1]