我們大概了解了怎么對台主機進行監控,主要步驟設計到添加主機,並且為主機添加監控項,這里主要為item,然后在item的基礎上對item進行繪圖並且通過screen的方式把不同的監控圖像匯總到一張screen上。通過對quick章節我們認識到item監控項在zabbix中是非常重要的,而item的監控是通過key來定義的,key又分為系統預定義好的key和自定義的key組成,這一節,我們通過對zabbix預定義的內存key來了解一下key到底是怎么組成和怎么使用的。
Key
|
參數
|
類型
|
單位
|
舉例
|
vm.memory.size[<mode>]
|
total (default), active,anon,
buffers, cached, exec, file, free, inactive
pinned, shared, wired, used, pused, available, pavailable
|
Numeric (unsigned)
Decimal
|
B
|
vm.memory.size[total]
vm.memory.size[total]
vm.memory.size[total]
vm.memory.size[total]
|
system.swap.in[<device>,<type>]
|
Type:count,
sectors
pages
|
Numeric (unsigned)
Decimal
|
B
|
system.swap.in[,pages]
|
system.swap.out[<device>,<type>]
|
Type:count,
sectors
pages
|
Numeric (unsigned)
Decimal
|
B
|
system.swap.out[,pages]
|
通過圖表和截圖我們可以很方便的看出來相關的對應關系。截圖中的key:vm.memory.size[total] 中的對應圖表中的key vm.memory.size[<mode>]而中括號中的mode這對應圖表中的參數,這里為total,當然了大家也可以根據需要填寫,比如監控內存以及使用的大小,這可以寫成vm.memory.size[used] 。截圖中的單位對應圖表中的單位B,等等對應關系很容易看出來,這里就不多說了。然后大家按照quick章節中的實例為item繪圖然后加入到screen里就可以了。
Key
|
參數
|
類型
|
單位
|
舉例
|
net.if.in[if,<mode>]
|
Bytes
,packets
errors,dropped
|
Numeric (unsigned)
Decimal
|
Bps
|
net.if.in[eth0,errors] net.if.in[eth0]
|
net.if.out[if,<mode>]
|
Bytes
,packets
errors,dropped
|
Numeric (unsigned)
Decimal
|
Bps
|
net.if.out[eth0,errors] net.if.out[eth0]
|
net.if.total[if,<mode>]
|
Bytes
,packets
errors,dropped
|
Numeric (unsigned)
Decimal
|
Bps
|
net.if.total[eth0,errors] net.if.total[eth0]
|
Key
|
參數
|
類型
|
單位
|
舉例
|
system.cpu.load[<cpu>,<mode>]
|
Cpu:all ,percpu
Avg1,avg5,avg15
|
Numeric (float)
|
無
|
system.cpu.load[,avg5]
|
system.cpu.num[<type>]
|
Online,max
|
Numeric (unsigned)
Decimal
|
無
|
system.cpu.num
|
system.cpu.switches
|
無
|
Numeric (float)
|
無
|
system.cpu.switches
|
system.cpu.util[<cpu>,<type>,<mode>]
|
Cpu:all,number
Type:
idle,
nice,
user,iowait,
interrupt,
softirq,
steal
Mode:avg1,av5,avg15
|
Numeric (float)
|
%
|
system.cpu.util[0,user,avg5]
|
Key
|
參數
|
類型
|
單位
|
舉例
|
vfs.fs.size[fs,<mode>]
|
fs:文件系統
mode:total(默認)
free,used,pfree,pused
|
Numeric (unsigned)
Decimal
|
B
%
|
vfs.fs.size[/tmp,free]
|
vfs.file.size[file]
|
文件路徑
|
Numeric (unsigned)
Decimal
|
B
|
vfs.file.size[/var/log/syslog]
|
選擇change后添加想要加入的graph,下圖為添加內存圖形(3.1中創建)到screen中,選中后雙擊保存按鈕就行保存
輸入創建模板的名字和所在的組,然后保存即可。這時大家會發現多了一個名為test_linux但是里面的數據位空的
http://nanwangting.blog.51cto.com/608135/1118799