Большинство самоделкиных (уж не люблю я использовать буржуйские слова если можно писать по русски, по буржуйски это будет DIY) предпочитают RaspberryPi для своих проектов из-за того, что она имеет огромное сообщество разработчиков и огромное количество исходного кода для поддержки различных устройств, однако я всё таки остановился на OrangePiPC стоимостью в 15 долларов. Ниже инструкция как установить на OrangePi RPi Monitor
У меня на апельсинке живет Armbian, на неё и будем устанавливать RPi Monitor, в принципе сложности не столько в установке, сколько в настройке конфигурации
Устанавливаем RPi Monitor
1 2 3 4 |
sudo apt-get update sudo apt-get install rpimonitor sudo /etc/init.d/rpimonitor update /usr/share/rpimonitor/scripts/updatePackagesStatus.pl |
Останавливаем RPi Monitor
systemctl stop rpimonitor
Делаем /etc/rpimonitor/template/Allwinner_H3.conf следующего содержания
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
dynamic.1.name=cpu_frequency dynamic.1.source=/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq dynamic.1.regexp=(.*) dynamic.1.postprocess=sprintf("%.3f", $1/1000000) dynamic.1.rrd=GAUGE dynamic.2.name=load1,load5,load15 dynamic.2.source=/proc/loadavg dynamic.2.regexp=^(\S+)\s(\S+)\s(\S+) dynamic.2.postprocess= dynamic.2.rrd=GAUGE dynamic.3.name=scaling_governor dynamic.3.source=/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor dynamic.3.regexp=(.*) dynamic.3.postprocess= dynamic.3.rrd= dynamic.4.name=cpu_count dynamic.4.source=/usr/bin/expr 1 + `/usr/bin/awk -F": " '/^processor/ {print $2}' < /proc/cpuinfo | /usr/bin/tail -n1` dynamic.4.regexp=(.*) dynamic.4.postprocess= dynamic.4.rrd=GAUGE dynamic.5.name=dram_frequency dynamic.5.source=/sys/devices/platform/sunxi-ddrfreq/devfreq/sunxi-ddrfreq/cur_freq dynamic.5.regexp=(.*) dynamic.5.postprocess=sprintf("%.3f", $1/1000000) dynamic.5.rrd=GAUGE dynamic.6.name=soctemp dynamic.6.source=/sys/class/thermal/thermal_zone1/temp dynamic.6.regexp=(.*) #dynamic.6.postprocess=sprintf("%.1f", $1/1000) dynamic.6.postprocess= dynamic.6.rrd=GAUGE dynamic.7.name=DropThis,UserStat,NiceStat,SystemStat,IdleStat,IOWaitStat,IrqStat,SoftIrqStat dynamic.7.source=/proc/stat dynamic.7.regexp=^cpu(\S+)\s(\S+)\s(\S+)(\S+)\s(\S+)\s(\S+)\s(\S+)\s(\S+) dynamic.7.postprocess= dynamic.7.rrd=DERIVE web.status.1.content.1.name=CPU web.status.1.content.1.icon=cpu.png web.status.1.content.1.line.1=JustGageBar("Load", "1min", 0, data.load1, 3, 100, 80)+" "+JustGageBar("Load", "5min", 0, data.load5, 3, 100, 80)+" "+JustGageBar("Load", "15min", 0, data.load15, 3, 100, 80) web.status.1.content.1.line.2="CPU frequency: <b>" + data.cpu_frequency + "GHz</b> DRAM frequency: <b>" + data.dram_frequency + "GHz</b>" web.status.1.content.1.line.3="Governor: <b>" + data.scaling_governor + "</b> Active CPU cores: <b>" + data.cpu_count + "</b>" web.status.1.content.3.name=Temperature web.status.1.content.3.icon=cpu_temp.png web.status.1.content.3.line.1=JustGageBar("SoC", "°C",0, data.soctemp , 100,100,80,percentColors,50,70) web.statistics.1.content.1.name=Load / Clockspeeds / Temperature web.statistics.1.content.1.graph.1=load1 web.statistics.1.content.1.graph.2=load5 web.statistics.1.content.1.graph.3=load15 web.statistics.1.content.1.graph.4=cpu_frequency web.statistics.1.content.1.graph.5=dram_frequency web.statistics.1.content.1.graph.6=cpu_count web.statistics.1.content.1.graph.7=soctemp web.statistics.1.content.1.ds_graph_options.load1.label=Load 1 min web.statistics.1.content.1.ds_graph_options.load5.label=Load 5 min web.statistics.1.content.1.ds_graph_options.load15.label=Load 15 min web.statistics.1.content.1.ds_graph_options.cpu_frequency.label=CPU Clock speed (GHz) web.statistics.1.content.1.ds_graph_options.cpu_frequency.yaxis=2 web.statistics.1.content.1.ds_graph_options.dram_frequency.label=DRAM Clock speed (GHz) web.statistics.1.content.1.ds_graph_options.dram_frequency.yaxis=2 web.statistics.1.content.1.ds_graph_options.cpu_count.label=Active CPUs web.statistics.1.content.1.ds_graph_options.cpu_count.yaxis=2 web.statistics.1.content.1.ds_graph_options.soctemp.label=SoC temp web.statistics.1.content.1.graph_options.y2axis={ position: "right" } |
файл /etc/rpimonitor/template/sdcard.conf следующего содержания
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
static.7.name=sdcard_root_total static.7.source=df / static.7.regexp=\S+\s+(\d+).*\/$ static.7.postprocess=$1/1024 dynamic.6.name=sdcard_root_used dynamic.6.source=df / dynamic.6.regexp=\S+\s+\d+\s+(\d+).*\/$ dynamic.6.postprocess=$1/1024 dynamic.6.rrd=GAUGE web.status.1.content.7.name=SD card web.status.1.content.7.icon=sd.png web.status.1.content.7.line.1="<b>/</b> Used: <b>"+KMG(data.sdcard_root_used,'M') + "</b> (<b>" + Percent(data.sdcard_root_used,data.sdcard_root_total,'M')+"</b>) Free: <b>"+KMG(data.sdcard_root_total-data.sdcard_root_used,'M')+ "</b> T$ web.status.1.content.7.line.2=ProgressBar(data.sdcard_root_used,data.sdcard_root_total,60,80) web.statistics.1.content.4.name=Disks - root web.statistics.1.content.4.graph.1=sdcard_root_total web.statistics.1.content.4.graph.2=sdcard_root_used web.statistics.1.content.4.ds_graph_options.sdcard_root_total.label=Size of / (MB) web.statistics.1.content.4.ds_graph_options.sdcard_root_total.color="#FF7777" web.statistics.1.content.4.ds_graph_options.sdcard_root_used.label=Used on / (MB) web.statistics.1.content.4.ds_graph_options.sdcard_root_used.lines={ fill: true } web.statistics.1.content.4.ds_graph_options.sdcard_root_used.color="#7777FF" |
файл /etc/rpimonitor/template/memory.conf следующего содержания
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
static.5.name=memory_total static.5.source=/proc/meminfo static.5.regexp=MemTotal:\s+(\d+) static.5.postprocess=$1/1024 dynamic.9.name=memory_free dynamic.9.source=/proc/meminfo dynamic.9.regexp=MemFree:\s+(\d+) dynamic.9.postprocess=$1/1024 dynamic.9.rrd=GAUGE dynamic.15.name=memory_available dynamic.15.source=/proc/meminfo dynamic.15.regexp=^Cached:\s+(\d+) dynamic.15.postprocess=$1/1024 dynamic.15.rrd=GAUGE web.status.1.content.5.name=Memory web.status.1.content.5.icon=memory.png web.status.1.content.5.line.1="Used: <b>" + KMG(data.memory_total-data.memory_available-data.memory_free,'M') + "</b> (<b>" + Percent(data.memory_total-data.memory_available-data.memory_free,data.memory_total,'M') + "</b>) Available: <b$ web.status.1.content.5.line.2=ProgressBar(data.memory_total-data.memory_available-data.memory_free,data.memory_total) web.statistics.1.content.6.name=Memory web.statistics.1.content.6.graph.1=memory_total web.statistics.1.content.6.graph.2=memory_free web.statistics.1.content.6.graph.3=memory_available web.statistics.1.content.6.ds_graph_options.memory_total.label=Total Memory(MB) web.statistics.1.content.6.ds_graph_options.memory_free.label=Free Memory (MB) web.statistics.1.content.6.ds_graph_options.memory_free.color="#7777FF" web.statistics.1.content.6.ds_graph_options.memory_available.label=Available Memory (MB) web.statistics.1.content.6.ds_graph_options.memory_available.color="#77FF77" |
файл /etc/rpimonitor/template/network.conf следующего содержания
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
dynamic.10.name=net_received dynamic.10.source=/sys/class/net/eth0/statistics/rx_bytes dynamic.10.regexp=(.*) dynamic.10.postprocess=$1*-1 dynamic.10.rrd=DERIVE dynamic.10.max=0 dynamic.11.name=net_send dynamic.11.source=/sys/class/net/eth0/statistics/tx_bytes dynamic.11.regexp=(.*) dynamic.11.postprocess= dynamic.11.rrd=DERIVE dynamic.11.min=0 web.status.1.content.8.name=Network web.status.1.content.8.icon=network.png web.status.1.content.8.line.1="Ethernet Sent: <b>"+KMG(data.net_send)+"<i class='icon-arrow-up'></i></b> Received: <b>"+KMG(Math.abs(data.net_received)) + "<i class='icon-arrow-down'></i></b>" web.statistics.1.content.2.name=Network web.statistics.1.content.2.graph.1=net_send web.statistics.1.content.2.graph.2=net_received web.statistics.1.content.2.graph_options.yaxis={ tickFormatter: function (v) { if (Math.abs(v) > 1048576) return (Math.round(v*10/1024/1024)/10) + " MiB/s" ; if (Math.abs(v) > 1024) return (Math.round(v*10/1024)/10) + " KiB/s" ; else re$ web.statistics.1.content.2.ds_graph_options.net_send.label=Upload bandwidth (bytes) web.statistics.1.content.2.ds_graph_options.net_send.lines={ fill: true } web.statistics.1.content.2.ds_graph_options.net_send.color="#FF7777" web.statistics.1.content.2.ds_graph_options.net_received.label=Download bandwidth (bytes) web.statistics.1.content.2.ds_graph_options.net_received.lines={ fill: true } web.statistics.1.content.2.7ds_graph_options.net_received.color="#77FF77" |
файл /etc/rpimonitor/template/OrangePi_H3.conf следующего содержания
1 2 3 4 5 6 7 8 9 10 11 12 |
web.page.icon='img/logo.png' web.page.menutitle='OPi-Monitor <sub>('+data.hostname+')</sub>' web.page.pagetitle='OPi-Monitor ('+data.hostname+')' web.status.1.name=Orange Pi web.statistics.1.name=Orange Pi include=/etc/rpimonitor/template/version.conf include=/etc/rpimonitor/template/uptime.conf include=/etc/rpimonitor/template/Allwinner_H3.conf include=/etc/rpimonitor/template/memory.conf include=/etc/rpimonitor/template/swap.conf include=/etc/rpimonitor/template/sdcard.conf include=/etc/rpimonitor/template/network.conf |
На этом конфигурирование закончено, делаем симлинк на наш конфиг
ln -sf /etc/rpimonitor/template/OrangePi_H3.conf /etc/rpimonitor/data.conf
запускаем RPi Monitor
systemctl start rpimonitor
заходим на страницу RPi Monitor http://адрес_апельсинки:8888
Поделиться в соц. сетях
Понравилась статья? Подпишитесь на RSS .