TShopping

 找回密碼
 註冊
搜索
查看: 227|回復: 0

[CentOS] Netdata監控Linux CPU network ram 資源

  [複製鏈接]
發表於 2018-9-17 23:37:16 | 顯示全部樓層 |閱讀模式
 
Push to Facebook Push to Plurk Push to Twitter 
下面介紹一種很炫酷的監控linux各種系統資源的方法,其實他是一個軟體,以web的可視化方式展示系統及應用程式的實時運行狀態(包括cpu、內存、硬碟輸入/輸出、網絡等linux性能的數據)。給管理員顯示出最細節的內容。
不得不說的是,這個東東,監控的項目很多,雖然有一些我都看不懂是啥意思,但是很酷啊
netdata0.jpg

介紹Netdata 是一個高度優化的Linux 守護進程,它為Linux 系統,應用程序,SNMP 服務等提供實時的性能監測。
環境
CentOS Linux release 7

準備
  1. yum install autoconf automake curl gcc git libmnl-devel libuuid-devel lm_sensors make MySQL-python nc pkgconfig python python-psycopg2 PyYAML zlib-devel
複製代碼

安裝
  1. git clone https://github.com/firehol/netdata.git --depth=1
  2. cd netdata
  3. ./netdata-installer.sh
  4. # 执行脚本成功后,netdata会立即启动。如果不希望立即启动,加入--dont-start-it
複製代碼


設置開機啟動
  1. # copy the netdata startup file to /etc/init.d
  2. cp system/netdata-init-d /etc/init.d/netdata
  3. # make sure it is executable
  4. chmod +x /etc/init.d/netdata
  5. # enable itchkconfig --add netdata
複製代碼


好的,這樣就應該安裝成功了,按照默認安裝的話,Netdata已經自動啟動了,監聽在19999端口,通過瀏覽器中輸入:http://你的IP地址:19999訪問。注意:記得把19999端口開放防火牆。


1.Netdata啟動:

  1. # /usr/sbin/netdata
複製代碼


2.Netdata關閉:
  1. # killall netdata
複製代碼


Netdata配置(CentOS):

配置文件在
  1. /etc/netdata/netdata.conf
複製代碼

介面預設是kilobits改成MB
編輯設定檔修改成如下
  1. [system.ipv4]
  2.         # history = 3600
  3.         # enabled = yes
  4.         # cache directory = /var/cache/netdata/system.ipv4
  5.         # chart type = area
  6.         # type = system
  7.         # family = network
  8.         # context = system.ipv4
  9.          units = MB/s
  10.         # units = kilobits/s
  11.         # priority = 500
  12.         # gap when lost iterations above = 1
  13.         # name = system.ipv4
  14.         # title = IPv4 Bandwidth (system.ipv4)
  15.         # dim received name = received
  16.         # dim received algorithm = incremental
  17.         # dim received multiplier = 8
  18.          dim received multiplier = 1
  19.         # dim received divisor = 1024
  20.          dim received divisor = 1048576
  21.         # dim sent name = sent
  22.         # dim sent algorithm = incremental
  23.         # dim sent multiplier = -8
  24.          dim sent multiplier = -1
  25.         # dim sent divisor = 1024
  26.          dim sent divisor = 1048576
複製代碼
  1. [net.enp4s0]
  2.         # history = 3600
  3.         # enabled = yes
  4.         # cache directory = /var/cache/netdata/net.enp4s0
  5.         # chart type = area
  6.         # type = net
  7.         # family = enp4s0
  8.         # context = net.net
  9.         # units = kilobits/s
  10.         units = Megabytes/s
  11.         # priority = 7000
  12.         # gap when lost iterations above = 1
  13.         # name = net.enp4s0
  14.         # title = Bandwidth (net.enp4s0)
  15.         # dim received name = received
  16.         # dim received algorithm = incremental
  17.         # dim received multiplier = 8
  18.          dim received multiplier = 1
  19.          dim received divisor = 1048576
  20.         # dim received divisor = 1024
  21.         # dim sent name = sent
  22.         # dim sent algorithm = incremental
  23.         # dim sent multiplier = -8
  24.          dim sent multiplier = -1
  25.          dim sent divisor = 1048576
  26.         # dim sent divisor = 1024
複製代碼
enp4s0是網卡代號
結果如下
netdata.png


文章出處

bootstrap, RWD, NetYea, 新竹網頁設計, 新竹網頁


 

臉書網友討論
您需要登錄後才可以回帖 登錄 | 註冊 |

本版積分規則



Archiver|手機版|小黑屋|免責聲明|TShopping

GMT+8, 2018-12-15 21:53 , Processed in 0.055401 second(s), 24 queries .

本論壇言論純屬發表者個人意見,與 TShopping綜合論壇 立場無關 如有意見侵犯了您的權益 請寫信聯絡我們。

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表