自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Cacti的庫表結(jié)構(gòu)-Data

運(yùn)維 系統(tǒng)運(yùn)維
Cacti的庫表結(jié)構(gòu)-Data:cacti是一套開源的網(wǎng)絡(luò)監(jiān)控工具,基于rrdtool的良好繪圖功能,可以完美的監(jiān)控主機(jī)的狀態(tài)和負(fù)載情況,添加相應(yīng)的模板后,可以用來監(jiān)控apache服務(wù)器和mysql服務(wù)器的運(yùn)行狀態(tài)。本文講述的是Cacti的庫表結(jié)構(gòu)-Data

  cacti 我們也用了很久了,但是它的表結(jié)構(gòu)一直都沒有去關(guān)心過,得空抽了半個(gè)晚上的時(shí)間,把它的庫表結(jié)構(gòu)大概看了下,某些字段的含義跟大家分享下:

  cacti 的數(shù)據(jù)都是存放在rrdtool 中的,數(shù)據(jù)庫存放的其實(shí)只是配置數(shù)據(jù),cacti 的邏輯對象主要分為三種,data (數(shù)據(jù))、graph (圖片)、host (設(shè)備),這在它的表設(shè)計(jì)中也能很容易的看出來。所以,就分三個(gè)大類來討論了

  二、 Data

  data 主要就是數(shù)據(jù)獲取,獲取數(shù)據(jù),然后存放到 rrd 文件中,這里存放的數(shù)據(jù),主要就是如何獲取數(shù)據(jù)、和如何存放數(shù)據(jù)這兩種。

  1 、 data_input 表

  數(shù)據(jù)獲取的方式,在 console 中的 data_input_method 里可以看到。

  id :數(shù)據(jù)獲取方式的 id

  hash :對應(yīng)的磁盤索引

  name :數(shù)據(jù)獲取方式的名字

  input_string :如果是腳本的話,那就是腳本的位置了

  type_id : type 一直沒找到對應(yīng)的表,可能是程序里寫死了,對應(yīng)的是 input_type ,有 6 個(gè)選項(xiàng),分別是: snmp 、 snmp query 、 script/command 、 script query 、 script – script server 、 script query – script server

  2 、 data_input_fields 表

  這張表是用來存放一些 data_input 方法中所需要的對象,比如 snmp 的 oid ,那就是一個(gè)對象, script 方式取硬盤時(shí)候,取回來值的名字,單位,都屬于它所定義的范疇。表內(nèi)容,主要是這些對象,和 data_input 的對應(yīng)。

  id : input_fields 的 id

  data_input_id :對應(yīng) data_input 表中的 id

  name 、 data_name :名字

  input_output :輸入還是輸出

  下面幾個(gè)字段我也不清楚了……

  3 、 data_input_data 表

  存放的是每個(gè) data 對象的 data_input_field 內(nèi)容。

  data_input_field_id : data_input_field 中的 id

  data_template_data_id : data_template_data 中的 id

  4 、 data_local 表

  存放數(shù)據(jù)對象,就是在 console 中的 data source 頁面看到的東東。不過這張表只是簡單的定義一個(gè)對象和對應(yīng)關(guān)系,對象的具體屬性在另外的表中。

  id : data 的 id

  data_template_id :采用了哪個(gè)數(shù)據(jù)模板,在 data_templates 模板中定義

  host_id :是哪個(gè)設(shè)備的數(shù)據(jù),在 host 中定義

  snmp_query_id :如果是通過 snmp_query 方式獲取的,那對應(yīng)的 snmp_query 的 id ,如果不是,則為 0

  snmp_index : snmp_query 方式獲取數(shù)據(jù)時(shí),獲取數(shù)組的前綴。例如,流量獲取中,端口的 index

  5 、 data_template 表

  數(shù)據(jù)模板,我們在 console 的 data templates 中看到的東東。

  id :數(shù)據(jù)模板的 id

  hash :索引

  name :名字

  6 、 data_template_data 表

  具體數(shù)據(jù)對象的信息,包含模板??梢哉J(rèn)為,每一個(gè)對象都代表一個(gè) rrd 文件。

  id : data 對象的 id

  local_data_template_data_id :如果使用了模板,那這個(gè)就是模板的 id ,定義的位置也是這個(gè)表

  local_data_id :對應(yīng)的數(shù)據(jù)對象,在 data_local 表中定義

  data_template_id : data_template ,數(shù)據(jù)模板,在 data_template 表中定義。

  data_input_id :數(shù)據(jù)獲取的方式,在 data_input 表中定義

  *name :名字,就是字面的意思

  data_source_path : rrd 文件的路徑

  active :是否被激活,可以通過 enable/disable 來控制

  rrd_step :步長,默認(rèn)是 300s ,就是 5 分鐘,也就是多長時(shí)間存一個(gè)數(shù)據(jù)( rrdcreate 的選項(xiàng))

  7 、 data_template_data_rra 表

  數(shù)據(jù)對象和 rra 的對應(yīng), rra 也是 rrdtool 中的概念,是一種數(shù)據(jù)歸檔壓縮的機(jī)制。

  data_template_data_id :上張表中定義的 id

  rra_id :對應(yīng)的 rra 的 id ,在 rra 表中定義

  8 、 data_template_rrd 表

  基本上也是 rrdtool 的配置選項(xiàng),一個(gè) rrd 文件可以存多列,叫做 ds ,每個(gè)列代表一組數(shù)據(jù)。這張表可以看成是對這個(gè)列的定義。

  id : ds 的 id

  local_data_template_rrd_id :如果使用了 ds 的模板,則這里定義模板的 id ,模板定義也在這張表中

  local_data_id :數(shù)據(jù) id ,在 data_local 表中定義

  data_template_id :采用的數(shù)據(jù)模板,在 data_template_data 中定義

  其余的都是 rrdtool 在創(chuàng)建 rrd 文件時(shí)候,對這個(gè) ds 的配置選項(xiàng),例如***值,名字等等。

  data 部分還是比較復(fù)雜的,如果和 host 連起來看,就更復(fù)雜了。拋開模板不談,一般來講是有以下的對應(yīng)關(guān)系:

  1 、每個(gè) host_id ,都有一組 local_data_id ,例如,一個(gè) cisco 交換機(jī)的 cpu 就是一個(gè) local_data_id ,它的一個(gè)端口—— te1/1 流量,也是一個(gè) local_data_id 。一個(gè) host_id 對應(yīng)多個(gè) local_data_id 。

  2 、每個(gè) local_data_id ,就是一個(gè)數(shù)據(jù)源,它必須有一個(gè) rrd 文件與他對應(yīng),所以每個(gè) local_data_id 在 data_template_data 中,必定對應(yīng)一行記錄,必定有一個(gè) rrd 文件。別看 data_template_data 中有那么多記錄,其中 local_data_id 為 0 的,或者 rrd 路徑為空的,那都是模板。

  3 、每個(gè) rrd 文件,必然至少有一個(gè) ds ,也就是在 data_template_rrd 中,至少有一條記錄,例如流量,還是 cisco 的交換機(jī),每個(gè)端口代表一個(gè) local_data_id ,有一個(gè) rrd 文件,有兩個(gè) ds ,流入和流出,那在 data_template_rrd 中就有兩條記錄。

  4 、 data_input 那幾張表,主要是數(shù)據(jù)獲取方式,數(shù)據(jù)獲取方式有 6 種,我們一般用的是三種:腳本直接取,就是 script 、 snmp ,給個(gè) oid 直接 get 、 snmp query ,就是 snmp 取回來一組數(shù)據(jù),然后分組。

【編輯推薦】

修改Cacti中rrd文件大小

Redhat下怎樣安裝Cacti

用Linux上的cacti去監(jiān)控windows服務(wù)器(圖)

責(zé)任編輯:zhaolei 來源: csdn
相關(guān)推薦

2011-04-06 09:10:54

CactiHost

2011-04-06 08:54:32

CactiGraph

2011-03-31 15:41:51

Cacti數(shù)據(jù)表結(jié)構(gòu)

2011-03-29 12:45:28

Cacti

2011-03-31 14:34:46

cactimysql備份

2011-04-06 08:54:28

CactiRRD

2010-05-24 13:14:19

創(chuàng)建MySQL

2011-03-29 09:08:50

Linux

2011-03-31 10:41:37

Cacti架構(gòu)

2011-04-01 15:39:02

CactiNagios

2011-03-24 14:05:17

Cacti安裝

2011-09-01 14:00:11

SQL Server 存儲(chǔ)過程顯示表結(jié)構(gòu)

2011-03-24 14:05:17

Cacti監(jiān)控

2011-03-24 15:35:01

Cacti

2011-03-25 09:00:34

Cacti

2010-10-15 10:29:25

Mysql表結(jié)構(gòu)

2010-09-28 15:34:05

SQL表結(jié)構(gòu)

2010-09-26 15:23:24

SQL語句

2010-11-23 12:39:05

MySQL InnoD

2010-11-23 13:24:16

MySQL MyISA
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)