Raspberry Pi學習筆記(八):Pi Dashboard監控樹莓派硬體

Image for post
Image for post
Pi Dashboard監控樹莓派硬體

可監測

CPU 基本訊息、狀態和使用率等即時數據記憶體及緩衝區、SWAP分區使用的即時數據SD卡的使用情况即時的負載數據執行程序數據網路實時數據樹莓派的IP、運行時間、操作系統、HOST 等基本資訊
sudo apt-get updatesudo apt-get install nginx php7.0-fpm php7.0-cli php7.0-curl php7.0-gd php7.0-mcrypt php7.0-cgi

啟動 Nginx 和 php

sudo service nginx start
sudo service php7.0-fpm restart

修改nginx的設定

#讓 Nginx 能處理 PHPsudo nano /etc/nginx/sites-available/default#將檔案內的以下內容
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
#修改成
location / {
index index.html index.htm index.php default.html default.htm default.php;
}

location ~\.php$ {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
(須將#location ~\.php$前方的#去掉)Ctrl+O 存檔
Ctrl+X 離開

重新啟動 nginx 服務

sudo service nginx restart

下載安裝 Pi Dashboard主程式

cd /var/www/html
sudo git clone https://github.com/spoonysonny/pi-dashboard.git

開啟Pi Dashboard網站

http://樹莓派IP/pi-dashboard#樹莓派IP可透過VNC連線取得

Written by

Machine Learning / Deep Learning / Python / Flutter cakeresume.com/yanwei-liu

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store