nagiosgraph的配置调整
程序员文章站
2022-05-16 20:32:46
...
说明
- 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
下一篇: Test...
推荐阅读