【树莓派4B测评】+ 实时状态监控网站服务器搭建
<div class='showpostmsg'><p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">树莓派的强大性能让树莓派能运行</font>linux<font face="宋体">系统,而</font><font face="Calibri">linux</font><font face="宋体">系统可以提供软硬件的实时状态信息给使用者查看。包括</font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri">CPU<font face="宋体">、内存、缓存、</font><font face="Calibri">SWAP</font><font face="宋体">分区</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">、</font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri"><font face="宋体">负载</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">、</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">进程数、</font>IP<font face="宋体">等一系列相关信息,每一项都有相应的指令来查看。但是逐个查看太繁琐了,最好是查询后统一在一个页面上显示。</font></span></span></span></span></p><p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">在</font>github<font face="宋体">上就有这样一个开源的项目,叫</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体">Pi Dashboard</span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">。这是一个基于</font>PHP<font face="宋体">的</font><font face="Calibri">WEBUI</font><font face="宋体">。要使用</font>Pi Dashboard<font face="宋体">需要有</font><font face="Calibri">WEB</font><font face="宋体">服务器及</font><font face="Calibri">PHP</font><font face="宋体">软件包支持。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体">WEB<font face="宋体">服务器搭建参看我之前的帖子。我使用的是</font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri">Nginx</span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">。</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体">(</span></span><a href="https://bbs.eeworld.com.cn/thread-1139992-1-1.html"><span style="font-size:10.5000pt"><span style="font-family:Calibri">https://bbs.eeworld.com.cn/thread-1139992-1-1.html</span></span></a><span style="font-size:10.5000pt"><span style="font-family:宋体">)</span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">安装</font>PHP<font face="宋体">软件包。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">udo apt-get install php7.3-fpm php7.3-cli php7.3-curl php7.3-gd php7.3-cgi</span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">系统会安装</font>php7.3<font face="宋体">及其依赖的相关库,安装的包比较多,时间略长。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">安装完后配置</font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri">Nginx</span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">,</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">将</font>php<font face="宋体">关联进去。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">sudo nano /etc/nginx/sites-available/default</span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">在上图位置添加</font>index.php<font face="宋体">(注释部分的说明也很清楚,哈哈)。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">再修改</font>PHP<font face="宋体">部分的配置。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">Ctrl + O <font face="宋体">保存再 </font><font face="Calibri">Ctrl + X </font><font face="宋体">退出。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">重启</font>nginx<font face="宋体">,是配置生效</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体">sudo service nginx restart</span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">安装</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体">Pi Dashboard</span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">首先从</font></span></span><a href="https://github.com/spoonysonny/pi-dashboard"><span style="font-size:10.5000pt"><span style="font-family:Calibri">https://github.com/spoonysonny/pi-dashboard</span></span></a><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">下载软件包,可以通过在树莓派上直接</font>git<font face="宋体">下载,或则在</font><font face="Calibri">PC</font><font face="宋体">上下载好,通过</font><font face="Calibri">FTP</font><font face="宋体">上传到树莓派上。没有搭建</font><font face="Calibri">FTP</font><font face="宋体">的话,也可以用</font><font face="Calibri">U</font><font face="宋体">盘直接拷贝。</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">(</font>FTP<font face="宋体">服务器搭建参看我之前的帖子</font></span></span><a href="https://bbs.eeworld.com.cn/thread-1139964-1-1.html"><span style="font-size:10.5000pt"><span style="font-family:Calibri">https://bbs.eeworld.com.cn/thread-1139964-1-1.html</span></span></a><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">)</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">下载完成后进入文件压缩包所在目录,解压缩文件到</font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri">Nginx</span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">的</font>html<font face="宋体">目录下。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:Calibri">sudo unzip pi-dashboard-master.zip -d /var/www/html</span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">在</font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri">/var/www/html</span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">目录下可以看到</font>pi-dashboard-master<font face="宋体">文件夹。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">现在通过浏览器</font>http://<font face="宋体">树莓派</font><font face="Calibri">IP/pi-dashboard-master</font><font face="宋体">就可以打开监控网页了。如果嫌网址中</font><font face="Calibri">pi-dashboard-master</font><font face="宋体">太长,只要更改</font><font face="Calibri">pi-dashboard</font><font face="宋体">所在的文件夹名字即可。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">状态数据实时更新,非常赞。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"> </p>
</div><script> var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;" style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
if(parseInt(discuz_uid)==0){
(function($){
var postHeight = getTextHeight(400);
$(".showpostmsg").html($(".showpostmsg").html());
$(".showpostmsg").after(loginstr);
$(".showpostmsg").css({height:postHeight,overflow:"hidden"});
})(jQuery);
} </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script> <p><a href="https://bbs.eeworld.com.cn/thread-1137107-1-1.html" target="_blank">树莓派4B测评</a></p>
<p>汇总:<a href="https://bbs.eeworld.com.cn/thread-1137107-1-1.html">https://bbs.eeworld.com.cn/thread-1137107-1-1.html</a></p>
<p>树莓派的优势就是强在生态方面</p>
<p>不错的帖子,但有2方面。</p>
<p>1,这个实时监控占用树莓派多少资源,楼主有空可以测试一下,我估计会占用很多。</p>
<p>2,可以用闲置的手机设置成屏幕常亮来做实时监视的显示器。</p>
宋元浩 发表于 2020-9-14 09:44
树莓派的优势就是强在生态方面
<p>是啊,很强大,资源非常丰富</p>
tagetage 发表于 2020-9-14 10:43
不错的帖子,但有2方面。
1,这个实时监控占用树莓派多少资源,楼主有空可以测试一下,我估计会占用很多 ...
<p>网页查看实时状态监控网站时,大概3秒左右跳一下10+%,平时基本都是1%以下,占的资源还不多。</p>
<p>添加了这个服务后,我正计划把dlna、ftp、aria2的资源占用情况测试下,后面会上评测。</p>
<p>这个极简界面好花哨</p>
freebsder 发表于 2020-9-15 16:07
这个极简界面好花哨
<p>界面简洁,花哨在信息量丰富上</p>
页:
[1]