My cool new Blog

Hello World! This is the most epic subtitle ever.
en de

Linux 底下極其詳細的System performace Monitor Dashboard - Netdata

2018-05-28
參考

https://www.digitalocean.com/community/tutorials/how-to-set-up-real-time-performance-monitoring-with-netdata-on-ubuntu-16-04

安裝

最後一個要注意,要安裝 netdata-all 才會安裝有DB的plugin (網路上都這樣說..)

curl -Ss 'https://raw.githubusercontent.com/firehol/netdata-demo-site/master/install-required-packages.sh' >/tmp/kickstart.sh && bash /tmp/kickstart.sh -i netdata-all

然後作 git clone

git clone https://github.com/firehol/netdata.git --depth=1 ~/netdata

接著就執行netdata提供的安裝script

sudo ./netdata-installer.sh

如果有少套件,就看缺什麼套件,裝上去就好了,或者一開始就先裝套件

sudo apt-get install zlib1g-dev uuid-dev libmnl-dev gcc make autoconf autoconf-archive autogen automake pkg-config curl

安裝完成後,預設會在 localhost:19999 運作 ,還頗炫的

每天自動更新
sudo ln -s /home/minion/netdata/netdata-updater.sh /etc/cron.daily/netdata-updater.sh
啟用 python.d plugin 目錄
sudo vim /etc/netdata/netdata.conf

找到 plugin ,取消 python.d 前面的 “#”

 [plugins]
     # PATH environment variable = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
     # PYTHONPATH environment variable = 
     # proc = yes
     diskspace = yes
     # cgroups = yes
     # tc = yes
     # idlejitter = yes
     enable running new plugins = yes
     check for new plugins every = 60
     # fping = yes
     # charts.d = yes
     python.d = yes                                                                                                                                            
     # node.d = yes
     # apps = yes

有很多東西可以設定,超細的…

修改 postgres.conf 的DB 設定
sudo vim /etc/netdata/python.d/postgres.conf

把不要的都註解掉,然後填入資料庫的設定 https://i.imgur.com/VQwlary.png

測試一下看能不能跑

sudo /usr/libexec/netdata/plugins.d/python.d.plugin debug 1 postgres

正常的話,應該會看到一些這樣的訊息 https://i.imgur.com/YMZtvdo.png

離開

重啟 netdata service,看看多到讓人眼花撩亂的圖表吧!

comments powered by Disqus