ganglia gweb Custom Composite Graphs

简介:
在讲gweb 自定义view时, 我们看到json文件里面对items主机配置时, 可以选择查看主机的graph还是metric,


# pwd
/data01/web/ganglia-web/conf
view_jira.json
{
  "view_name":"jira",   # 视图名称
  "items":[    # 视图里包含的东西, 配置为列表形式, 如下
    { "hostname":"web01.domain.com","graph":"cpu_report"},     # 图表1, 单台主机的单个graph. 在graph.d目录中定义具体内容
    { "hostname":"web03.domain.com","metric":"cpu_aidle"},    # 图表3, 单台主机的单个metric
...

metric很好理解, 使用gmond -m就能查看所有module支持的metric.
graph则是一些metric的组合, 在graph.d目录中配置.
例如 : 
[root@db-172-16-3-221 graph.d]# pwd
/data01/web/ganglia-web/graph.d
[root@db-172-16-3-221 graph.d]# ll
total 80
-rw-r--r-- 1 nobody 1000  578 Jan  6  2014 apache_report.json
-rw-r--r-- 1 nobody 1000  186 Jan  6  2014 apache_response_report.json
-rw-r--r-- 1 nobody 1000  426 Jan  6  2014 cpu_report.json
-rw-r--r-- 1 nobody 1000 9065 Jan  6  2014 cpu_report.php
-rw-r--r-- 1 nobody 1000  476 Jan  6  2014 load_all_report.json
-rw-r--r-- 1 nobody 1000  590 Jan  6  2014 load_report.json
-rw-r--r-- 1 nobody 1000  680 Jan  6  2014 mem_report.json
-rw-r--r-- 1 nobody 1000 8324 Aug  4 03:04 mem_report.php
-rw-r--r-- 1 nobody 1000 4973 Jan  6  2014 metric.php
-rw-r--r-- 1 nobody 1000  355 Jan  6  2014 network_report.json
-rw-r--r-- 1 nobody 1000 1616 Jan  6  2014 nfs_v3_client_report.json
-rw-r--r-- 1 nobody 1000  358 Jan  6  2014 packet_report.json
-rw-r--r-- 1 nobody 1000 6392 Jan  6  2014 sample_report.php
-rw-r--r-- 1 nobody 1000 3543 Jan  6  2014 varnish_report.php
[root@db-172-16-3-221 graph.d]# cat cpu_report.json 
{
   "report_name" : "cpu_report",
   "report_type" : "template",
   "title" : "CPU Report",
   "graphite"  : "target=alias(HOST_CLUSTER.cpu_user.sum,'User')&target=alias(HOST_CLUSTER.cpu_nice.sum%2C'Nice')&target=alias(HOST_CLUSTER.cpu_system.sum,'System')&target=alias(HOST_CLUSTER.cpu_wio.sum,'Wait')&target=alias(HOST_CLUSTER.cpu_idle.sum%2C'Idle')&areaMode=stacked&max=100&colorList=3333bb,ffea00,dd0000,ff8a60,e2e2f2"
}


[root@db-172-16-3-221 graph.d]# cat load_all_report.json 
{
   "report_name" : "load_all_report",
   "report_type" : "standard",
   "title" : "Load All Report",
   "vertical_label" : "load",
   "series" : [
      { "metric": "load_one", "color": "3333bb", "label": "Load 1", "line_width": "2", "type": "line" },
      { "metric": "load_five", "color": "ffea00", "label": "Load 5", "line_width": "2", "type": "line" },
      { "metric": "load_fifteen", "color": "dd0000", "label": "Load 15", "line_width": "2", "type": "line" }
   ]
}

graph的命名规则 : 
?_report.json
内容解释 : 
Graph configuration
Key: Value
report_name: Name of the report that web UI uses.
title: Title of the report to show on a graph.
vertical_label: Y-axis description (optional).
series: An array of metrics to use to compose a graph. 

Series options
Key: Value
metric: Name of a metric, such as load_one and cpu_system. If the metric doesn’t exist it will be skipped.
color: A 6 hex-decimal color code, such as 000000 for black.
label: Metric label, such as Load 1.
type: Item type. It can be either line or stack.
line_width: If type is set to line, this value will be used as a line width. If this value is not specified, it defaults to 2. If type is stack, it's ignored even if set.

通过配置?_report.json, 我们可以简化view的json配置.

[参考]
相关文章
|
存储 SQL Cloud Native
GalaxyEngine Overview
PolarDB-X 是由阿里巴巴自主研发的云原生分布式数据库,融合了分布式 SQL 引擎 GalaxySQL 和分布式存储引擎 GalaxyEngine,其中 GalaxyEngine 是新一代面向分布式场景的 MySQL 发行版本,作为官方 MySQL 版本的一个分支,除了吸收和跟进官方版本的持续改进以外,尤其在分布式场景下,实现了 Lizard 分布式事务和全局一致性解决方案、 Galaxy X-Protocol 交互协议 pipeline request、 X-Engine 存储引擎、 Galaxy X-Paxos Cluster 保证数据零丢失并持续可用,以及共享的 RDS MySQL
1102 0
GalaxyEngine Overview
Important table for launchpad Designer and configuration
Important table for launchpad Designer and configuration
107 0
Important table for launchpad Designer and configuration
Important table for Fiori launchpad Designer and configuration
Important table for Fiori launchpad Designer and configuration
Important table for Fiori launchpad Designer and configuration
Fiori Elements - get annotation implementation in backend
Fiori Elements - get annotation implementation in backend
Fiori Elements - get annotation implementation in backend
SAP CRM Application Extension Tool的Custom Behavior
SAP CRM Application Extension Tool的Custom Behavior
116 0
SAP CRM Application Extension Tool的Custom Behavior
|
Serverless Python
Deploy a flexible and highly available image processing service within 10 minutes
Alibaba Cloud Function Compute is an event-driven and fully-managed compute service. With Function Compute, you can quickly build any type of applicat.
1440 0
|
应用服务中间件 nginx
How to Quickly Implement Nginx-based Website Monitoring
A small internet startup James works with has been running its application on a domestic cloud A. The application adopts the common distributed Nginx
2275 0