Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1233143
  • 博文数量: 135
  • 博客积分: 10576
  • 博客等级: 上将
  • 技术积分: 1670
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-11 20:49
个人简介

不疯魔,不成活! --疯魔老杨(Crazy.LaoYang) http://www.inotes.cn/

文章分类

全部博文(135)

文章存档

2014年(4)

2012年(13)

2011年(5)

2010年(30)

2009年(56)

2008年(27)

分类: LINUX

2011-04-06 14:12:06

[原创]个人笔记:关于Cacti的Hash值的说明
源自:杨志刚博客 (http://yangzhigang.cublog.cn/),如转载请注明来源。

前言:
在Cacti的模板以及数据库中,都可以见到有Hash值,这些值的设计用什么做什么的呢?这些值有什么限定的规则和意义?数据库中不同表之间的hash值有什么关联呢?

正文:
下面先以一个简单的XML文件来说明(文件下载见附件)。
此文件是一个通过snmpv2的MIB OID来取得系统uptime的模板文件,下面解析一下此文件:
 
Line1:  
- line2:  <hash_0000050a7928571d7330f5e9156ad05b24f1d4>
  line3:  <name>SNMPv2-MIB - sysUpTimename>
- line4:  <graph>
  line5:  <t_title>ont_title>
  line6:  <title>|host_hostname| - Uptimetitle>
  line7:  <t_image_format_id />
  line8:  <image_format_id>1image_format_id>
  line9:  <t_height />
  line10: <height>120height>
  line11: <t_width />
  line12: <width>500width>
  line13: <t_auto_scale />
  line14: <auto_scale>onauto_scale>
  line15: <t_auto_scale_opts />
  line16: <auto_scale_opts>2auto_scale_opts>
  line17: <t_auto_scale_log />
  line18: <auto_scale_log />
llline19: <t_auto_scale_rigid />
liline20: <auto_scale_rigid />
liline21: <t_auto_padding />
  line22: <auto_padding>onauto_padding>
  line23: <t_export />
  line24: <export>onexport>
  line25: <t_upper_limit />
  line26: <upper_limit>0upper_limit>
  line27: <t_lower_limit />
  line28: <lower_limit>0lower_limit>
  line29: <t_base_value />
  line30: <base_value>1000base_value>
  line31: <t_unit_value />
  line32: <unit_value />
  line33: <t_unit_exponent_value />
  line34: <unit_exponent_value />
  line35: <t_vertical_label />
  line36: <vertical_label>Daysvertical_label>
line37:  graph>
- <items>
- <hash_100005983796b725494b16f67d739082e8f9d5>
  <task_item_id>hash_0800053f765eaeaf380c6762cf01e44442e53etask_item_id>
  <color_id>7EE600color_id>
  <graph_type_id>7graph_type_id>
  <consolidation_function_id>1consolidation_function_id>
  <cdef_id>hash_050005caababff166448da7a0fb2c2dba04e7ecdef_id>
  <value />
  <gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751gprint_id>
  <text_format />
  <hard_return />
  <sequence>1sequence>
  hash_100005983796b725494b16f67d739082e8f9d5>
- <hash_1000055e0267f848d7663c9a55acf4e0f23051>
  <task_item_id>hash_0800053f765eaeaf380c6762cf01e44442e53etask_item_id>
  <color_id>0color_id>
  <graph_type_id>9graph_type_id>
  <consolidation_function_id>4consolidation_function_id>
  <cdef_id>hash_050005caababff166448da7a0fb2c2dba04e7ecdef_id>
  <value />
  <gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751gprint_id>
  <text_format>Current:text_format>
  <hard_return />
  <sequence>2sequence>
  hash_1000055e0267f848d7663c9a55acf4e0f23051>
- <hash_100005fe14380f543ce0950e9fade5f5dee2f2>
  <task_item_id>hash_0800053f765eaeaf380c6762cf01e44442e53etask_item_id>
  <color_id>0color_id>
  <graph_type_id>9graph_type_id>
  <consolidation_function_id>3consolidation_function_id>
  <cdef_id>hash_050005caababff166448da7a0fb2c2dba04e7ecdef_id>
  <value />
  <gprint_id>hash_060005e9c43831e54eca8069317a2ce8c6f751gprint_id>
  <text_format>Maximum:text_format>
  <hard_return>onhard_return>
  <sequence>4sequence>
  hash_100005fe14380f543ce0950e9fade5f5dee2f2>
  items>
- <inputs>
- <hash_0900054a961dc5e60993470e67bbef5ce40312>
  <name>Data Source [sysUpTime]name>
  <description />
  <column_name>task_item_idcolumn_name>
  <items>hash_000005983796b725494b16f67d739082e8f9d5|hash_0000055e0267f848d7663c9a55acf4e0f23051|hash_000005fe14380f543ce0950e9fade5f5dee2f2items>
  hash_0900054a961dc5e60993470e67bbef5ce40312>
  inputs>
  hash_0000050a7928571d7330f5e9156ad05b24f1d4>
- <hash_0100050f3b291f75c0bf4a0ef094f967e6b143>
  <name>SNMPv2-MIB - sysUpTimename>
- <ds>
  <t_name />
  <name>|host_hostname| - Uptimename>
  <data_input_id>hash_0300053eb92bb845b9660a7445cf9740726522data_input_id>
  <t_rra_id />
  <t_rrd_step />
  <rrd_step>300rrd_step>
  <t_active>ont_active>
  <active>onactive>
  <rra_items>hash_150005c21df5178e5c955013591239eb0afd46|hash_1500050d9c0af8b8acdc7807943937b3208e29|hash_1500056fc2d038fb42950138b0ce3e9874cc60|hash_150005e36f3adb9f152adfa5dc50fd2b23337erra_items>
  ds>
- <items>
- <hash_0800053f765eaeaf380c6762cf01e44442e53e>
  <t_data_source_name />
  <data_source_name>sysUpTimedata_source_name>
  <t_rrd_minimum />
  <rrd_minimum>0rrd_minimum>
  <t_rrd_maximum />
  <rrd_maximum>0rrd_maximum>
  <t_data_source_type_id />
  <data_source_type_id>1data_source_type_id>
  <t_rrd_heartbeat />
  <rrd_heartbeat>600rrd_heartbeat>
  <t_data_input_field_id />
  <data_input_field_id>0data_input_field_id>
  hash_0800053f765eaeaf380c6762cf01e44442e53e>
  items>
- <data>
- <item_000>
  <data_input_field_id>hash_0700054276a5ec6e3fe33995129041b1909762data_input_field_id>
  <t_value />
  <value>.1.3.6.1.2.1.1.3.0value>
  item_000>
- <item_001>
  <data_input_field_id>hash_070005012ccb1d3687d3edb29c002ea66e72dadata_input_field_id>
  <t_value />
  <value />
  item_001>
- <item_002>
  <data_input_field_id>hash_0700059c55a74bd571b4f00a96fd4b793278c6data_input_field_id>
  <t_value />
  <value />
  item_002>
- <item_003>
  <data_input_field_id>hash_070005ad14ac90641aed388139f6ba86a2e48bdata_input_field_id>
  <t_value />
  <value />
  item_003>
- <item_004>
  <data_input_field_id>hash_07000532285d5bf16e56c478f5e83f32cda9efdata_input_field_id>
  <t_value />
  <value />
  item_004>
- <item_005>
  <data_input_field_id>hash_07000592f5906c8dc0f964b41f4253df582c38data_input_field_id>
  <t_value />
  <value />
  item_005>
  data>
  hash_0100050f3b291f75c0bf4a0ef094f967e6b143>
- <hash_0300053eb92bb845b9660a7445cf9740726522>
  <name>Get SNMP Dataname>
  <type_id>2type_id>
  <input_string />
- <fields>
- <hash_07000592f5906c8dc0f964b41f4253df582c38>
  <name>SNMP IP Addressname>
  <update_rra />
  <regexp_match />
  <allow_nulls />
  <type_code>hostnametype_code>
  <input_output>ininput_output>
  <data_name>management_ipdata_name>
  hash_07000592f5906c8dc0f964b41f4253df582c38>
- <hash_07000532285d5bf16e56c478f5e83f32cda9ef>
  <name>SNMP Communityname>
  <update_rra />
  <regexp_match />
  <allow_nulls />
  <type_code>snmp_communitytype_code>
  <input_output>ininput_output>
  <data_name>snmp_communitydata_name>
  hash_07000532285d5bf16e56c478f5e83f32cda9ef>
- <hash_070005ad14ac90641aed388139f6ba86a2e48b>
  <name>SNMP Usernamename>
  <update_rra />
  <regexp_match />
  <allow_nulls>onallow_nulls>
  <type_code>snmp_usernametype_code>
  <input_output>ininput_output>
  <data_name>snmp_usernamedata_name>
  hash_070005ad14ac90641aed388139f6ba86a2e48b>
- <hash_0700059c55a74bd571b4f00a96fd4b793278c6>
  <name>SNMP Passwordname>
  <update_rra />
  <regexp_match />
  <allow_nulls>onallow_nulls>
  <type_code>snmp_passwordtype_code>
  <input_output>ininput_output>
  <data_name>snmp_passworddata_name>
  hash_0700059c55a74bd571b4f00a96fd4b793278c6>
- <hash_070005012ccb1d3687d3edb29c002ea66e72da>
  <name>SNMP Version (1, 2, or 3)name>
  <update_rra />
  <regexp_match />
  <allow_nulls>onallow_nulls>
  <type_code>snmp_versiontype_code>
  <input_output>ininput_output>
  <data_name>snmp_versiondata_name>
  hash_070005012ccb1d3687d3edb29c002ea66e72da>
- <hash_0700054276a5ec6e3fe33995129041b1909762>
  <name>OIDname>
  <update_rra />
  <regexp_match />
  <allow_nulls />
  <type_code>snmp_oidtype_code>
  <input_output>ininput_output>
  <data_name>oiddata_name>
  hash_0700054276a5ec6e3fe33995129041b1909762>
  fields>
  hash_0300053eb92bb845b9660a7445cf9740726522>
- <hash_150005c21df5178e5c955013591239eb0afd46>
  <name>Daily (5 Minute Average)name>
  <x_files_factor>0.5x_files_factor>
  <steps>1steps>
  <rows>600rows>
  <timespan>86400timespan>
  <cf_items>1|3cf_items>
  hash_150005c21df5178e5c955013591239eb0afd46>
- <hash_1500050d9c0af8b8acdc7807943937b3208e29>
  <name>Weekly (30 Minute Average)name>
  <x_files_factor>0.5x_files_factor>
  <steps>6steps>
  <rows>700rows>
  <timespan>604800timespan>
  <cf_items>1|3cf_items>
  hash_1500050d9c0af8b8acdc7807943937b3208e29>
- <hash_1500056fc2d038fb42950138b0ce3e9874cc60>
  <name>Monthly (2 Hour Average)name>
  <x_files_factor>0.5x_files_factor>
  <steps>24steps>
  <rows>775rows>
  <timespan>2678400timespan>
  <cf_items>1|3cf_items>
  hash_1500056fc2d038fb42950138b0ce3e9874cc60>
- <hash_150005e36f3adb9f152adfa5dc50fd2b23337e>
  <name>Yearly (1 Day Average)name>
  <x_files_factor>0.5x_files_factor>
  <steps>288steps>
  <rows>797rows>
  <timespan>33053184timespan>
  <cf_items>1|3cf_items>
  hash_150005e36f3adb9f152adfa5dc50fd2b23337e>
- <hash_050005caababff166448da7a0fb2c2dba04e7e>
  <name>Miliseconds to Daysname>
- <items>
- <hash_140005c6c097cf4569c485db2014c88dbec532>
  <sequence>1sequence>
  <type>4type>
  <value>CURRENT_DATA_SOURCEvalue>
  hash_140005c6c097cf4569c485db2014c88dbec532>
- <hash_140005ee32895cfa811896443c4e39e2399d99>
  <sequence>2sequence>
  <type>6type>
  <value>8640000value>
  hash_140005ee32895cfa811896443c4e39e2399d99>
- <hash_1400055aaf0f8f02ab04aaa2e56d3b0217c42c>
  <sequence>3sequence>
  <type>2type>
  <value>4value>
  hash_1400055aaf0f8f02ab04aaa2e56d3b0217c42c>
  items>
  hash_050005caababff166448da7a0fb2c2dba04e7e>
- <hash_060005e9c43831e54eca8069317a2ce8c6f751>
  <name>Normalname>
  <gprint_text>%8.2lf%sgprint_text>
  hash_060005e9c43831e54eca8069317a2ce8c6f751>
  cacti>



文件: cacti_graph_template_snmpv2mib_sysuptime.rar
大小: 2KB
下载: 下载

阅读(2409) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~