跳到正文
W Winse Blog
monitoring bigdata 2 min read

Ganglia页自定义视图

官网自带的页面指标太拥挤,同一个组各指标的顺序不能指定(默认好像是按名称排序的)不便于观察。通过页面的Views页签可以查看自定的图标。

在conf文件夹(由conf_default.php中views_dir指定)下面建立文件名以 view 开头的json文件。通过Views还可以聚合多个指标,在一个图中查看整体的变化趋势。配置聚合视图前可以先在 Aggregate Graphs 弄出来先瞧一瞧。

[root@cu2 ~]# cd /var/www/html/ganglia/
# 查看view放置的位置
[root@cu2 ganglia]# grep views_dir conf_default.php 
$conf['views_dir'] = $conf['gweb_confdir'] . '/conf';

# view配置目录
[root@cu2 conf]$ ll
......
-rw-rw-r-- 1 apache apache    58 Oct  2 04:38 view_default.json
-rw-r--r-- 1 root   root    2344 Feb 25 20:12 view_qbevery.json
-rw-r--r-- 1 root   root     241 Feb 25 18:59 view_qb.json

[root@cu2 conf]# cat view_qb.json 
{
"default_size" : "xlarge",
"view_name": "qb",
"items": [
{
"aggregate_graph": "true",
"graph_type": "stack", 
"host_regex":  [ { "regex" : "cu2" } ], 
"metric_regex": [ { "regex":  "qb_.*" } ],
"title": "qb"
}
],
"view_type": "standard"
}
[root@cu2 conf]# cat view_qbevery.json 
{
"default_size" : "medium",
"view_name": "qbevery",
"items": [
{ "hostname":"cu2","metric":"qb_520k_53d_9.82_120807"},
{ "hostname":"cu2","metric":"qb_500k_98d_7.81_116763"},
{ "hostname":"cu2","metric":"qb_400k_91d_7.67_116762"},
{ "hostname":"cu2","metric":"qb_350k_42d_9.08_120802"},
{ "hostname":"cu2","metric":"qb_350k_83d_7.40_116761"},
{ "hostname":"cu2","metric":"qb_300k_78d_7.12_116760"}
],
"view_type": "standard"
}

# 参考

–END

在 GitHub 上讨论

欢迎通过 GitHub Issue 留言或反馈。每条讨论都会关联到对应文章的源文件路径。

2016-02-25-ganglia-web-ui-views.md

Related posts