最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
linux系统中Nagios Nagiosgraph配置方法
时间:2014-04-21 编辑:简简单单 来源:一聚教程网
原理:
使用service_perfdata_file_processing_command指令,将nagios监控到的每个服务数据,传递给 /usr/local/nagiosgraph/bin/insert.pl脚本处理,生产rrd文件。
下面来说说Nagiosgraph的配置:
1. 获取组件
代码如下 | 复制代码 |
# wget http://downloads.sourceforge.net/project/nagiosgraph/nagiosgraph/1.4.4/nagiosgraph-1.4.4.tar.gz # tar -xzf nagiosgraph-1.4.4.tar.gz # cd nagiosgraph-1.4.4 |
2. 检测环境要求
代码如下 | 复制代码 |
# ./install.pl --check-prereq checking required PERL modules Carp...1.04 CGI...3.15 Data::Dumper...2.121_08 File::Basename...2.74 File::Find...1.10 MIME::Base64...3.07 POSIX...1.09 RRDs...1.2027 Time::HiRes...1.9717 checking optional PERL modules GD...2.35 checking nagios installation found nagios at /usr/local/nagios/bin/nagios checking web server installation found apache at /usr/sbin/httpd |
缺少哪些perl模块,就安装那些模块,同时还要注意版本的要求。
3. 安装
代码如下 | 复制代码 |
./install.pl --install |
一路按回车键。
4. 编辑nagios.cfg文件
在nagios.conf文件下,添加以下内容
代码如下 | 复制代码 |
# process nagios performance data using nagiosgraph process_performance_data=1 service_perfdata_file=/tmp/perfdata.log service_perfdata_file_template=$LASTSERVICECHECK$||$HOSTNAME$||$SERVICEDESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$ service_perfdata_file_mode=a service_perfdata_file_processing_interval=30 service_perfdata_file_processing_command=process-service-perfdata-for-nagiosgraph |
5. 编辑commands.cfg文件
添加以下内容
代码如下 | 复制代码 |
######################################### # # nagiosgraph # # command to process nagios performance data for nagiosgraph define command { command_name process-service-perfdata-for-nagiosgraph command_line /usr/local/nagiosgraph/bin/insert.pl } |
6. 修改httpd.conf文件
添加以下内容
代码如下 | 复制代码 |
Include /usr/local/nagiosgraph/etc/nagiosgraph-apache.conf |
7. 重新启动服务
代码如下 | 复制代码 |
# /etc/init.d/httpd restart # /etc/init.d/nagios restart |
8. 查看nagiosgraph配置信息
在浏览器输入:http://10.0.100.125/nagiosgraph/cgi-bin/showconfig.cgi网址查看。
define service { |
name nagiosgraph |
action_url /nagiosgraph/cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$ |
register 0 |
} |
define service { |
use MongoDB,nagiosgraph |
hostgroup_name MongoDB_Servers |
service_description Mongo Memory Usage |
check_command check_mongodb!12345! '' ! '' !memory!130!260 |
servicegroups Mongodbservices |
} |
322279:hostname:X.X.X.X
322299-servicedesc:Mongo Free Connections
322334-output:OK – 6 percent (52 of 819 connections) used
322385-perfdata:
map如何自定义正则表达式下节再说,请关注。
原文来自:ttlsa.com
相关文章
- Linux 配置 DHCP 服务器 简明教程详解 09-08
- linux中srs 身份认证配置例子 08-17
- linux/ubuntu服务器安全问题配置 06-22
- linux中smokeping告警配置教程详解 06-04
- Linux下防御DDOS攻击工具(DDoS deflate)配置使用详解 05-31
- Linux下Storm集群搭建配置教程 04-10