TORIPIYO DIARY

recent events, IoT, programming, security topics

raspberry pi 3のリソース利用状態をmonitorixでグラフ表示する

rasbperry pi 3 のリソース利用状態の推移を監視したかったので、monitorixというツールを入れました。

f:id:ha107chan:20170622231339p:plain

インストール方法 (rootユーザで実行)

1. パッケージのインデックス情報を更新する

apt-get update


2. monitorixに必要な関連パッケージをインストールする

apt-get install rrdtool perl libwww-perl \
libmailtools-perl libmime-lite-perl librrds-perl \
libdbi-perl libxml-simple-perl libhttp-server-simple-perl \
libconfig-general-perl libio-socket-ssl-perl

3. monitorixのdeb パッケージをインストールする

cd /usr/local/src
wget http://www.monitorix.org/monitorix_3.9.0-izzy1_all.deb
openssl sha1 monitorix*.deb # compare sha1 value with http://www.monitorix.org/downloads.html
dpkg -i monitorix*.deb
apt-get -f install # fix broken dependency if exists

4. browserから raspberry pi 3のサーバにアクセスする
http://(raspberry pi 3のipアドレス):8080/index.html


minitorixウェブページのポート番号を変更する方法
僕の動かしているraspberry pi 3ではすでに別のプロセスが8080ポートを利用しているので、ポート番号を8080 => 8081に変更しました。

1. monitorix.confの設定ファイルの変更をする

vi /etc/monitorix/monitorix.conf

----------------------------------------------------------------------------------------------
@@ -30 +30 @@
-       port = 8080
+       port = 8081
----------------------------------------------------------------------------------------------

2. monitorixを再起動

systemctl restart monitorix