nagiosgraph的配置调整

说明

  • nagiosgraph 工作目录 /usr/local/nagiosgraph
  • nagios 工作目录 /usr/local/nagios
  • httpd 的配置目录 /etc/httpd/
  • nagiosgraph 配置目录 /usr/local/nagiosgraph

1. map (/usr/local/nagiosgraph/etc/map)

map文件是设置性能数据保存rrd数据的格式

>

  • 跳过的数据,规则如下

/output:CHECK_NRPE: Socket timeout/
and return ('ignore');

/output:NRPE: Unable to read output/
and return ('ignore');

/output:CRITICAL - Socket timeout after/
and return ('ignore');

/output:CRITICAL - Plugin timed out after/
and return ('ignore');

/output:NTP CRITICAL: No response from NTP server/
and return ('ignore');
  • 自定义规则
# CPU 

(/output:CPU.*?: user=(\d+)\% system=(\d+)\% iowait=(\d+)\%/
and push @s ,['CPU',
                ['usage',GAUGE,($1+$2+$3)],
                ['user',GAUGE,$1],
                ['system',GAUGE,$2],
                ['iowait',GAUGE,$3]]);

2. nagiosgraph.conf (/usr/local/ngaiosgraph/nagiosgraph.conf)

nagiosgraph.conf 是配置图表展示的样式

  • 线条
 # Default line style (LINE1, LINE2, LINE3, AREA, TICK); see rrdgraph_graph
plotas = LINE2

位置:配置文件154、155行

从LINE1到LINE3依次是线条的粗细,一般选择LINE2(LINE1线条太细,看不清楚)

  • 颜色
 colors = 0000AA,00FF00,333333,6959CD,8B0000,912CEE,BDB76B,FF4500

颜色为rgb的颜色代码

依次是性能指标对应的颜色代码(不建议用官方的颜色,太不明显了,建议自己调整下颜色代码)

  • 时间
# Graphs to show in host-service page (hour, day, week, month, quarter, year)
timeall = hour,day,week,month,year
# Graphs to show in host page
timehost = hour,day,week,month
# Graphs to show in service page
timeservice = hour,day,week,month
# Graphs to show in group page
timegroup = hour,day,week,month

# Time periods that should default to expanded state.  If not specified here,
# the period will default to a collapsed state.
expand_timeall = hour,day,week,month,quarter,year
expand_timehost = week
expand_timeservice = week
expand_timegroup = day

# Formats for time and date.
timeformat_now = %H:%M:%S %d %b %Y %Z
timeformat_hour = %H:%M
timeformat_day = %H:%M %e %b
timeformat_week = %e %b
timeformat_month = Week %U
timeformat_quarter = Week %U
timeformat_year = %b %Y

3. nagiosgraph_${locale}.conf

locale语言包,目前缺少中文版,可以自行翻译。中文文件名为:nagiosgraph_zh.conf

如果强制指定语言(一般根据操作系统locale自行指定),需要在nagiosgraph.conf中指定:

#language = ${locale}
language = zh

Performance

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值