LoginSignup
0
0

More than 5 years have passed since last update.

ubuntu16へのsmokepingインストール

Posted at

smokepingとは、fpingで定期的にネットワーク品質を測定してデータをrrdファイルに格納し、Web UIで可視化するまでやってくれる古いツール。
今回はubuntuで。smokeping自体はcentos/redhatでも稼働するけど設定ファイルの構造が全くちがうので注意。
個人的に日本と中国の間の通信を追っているので今回はAlibaba Cloudの仮想サーバ(ECS)を使うけど、AWSでも、もちろんオンプレサーバでもubuntuなら問題なく動くはずだ。

hosts設定

IPアドレスを覚えるのめんどくさいのでhostsに書き込む
shanghai_cenのあどれすが10.1.0.1、shanghaiのアドレスが139.xxx.xx.xxである場合、下記2行を追記する。

$ vi /etc/hosts 
10.1.0.1        shanghai_cen
139.xxx.xx.xx   shanghai

ubuntu準備

とりあえずubuntuのECS(仮想サーバ) instanceを立ち上げてsmokepingをインストールする。ECS無料じゃないけど1時間1〜2円ぐらいで買えるし、普通にアカウント作れば3万円分のクーポンもらえるはずなので、まあタイトルに偽りなし、ということでよろしく。
デフォルトではubuntuのapache2のcgiモジュールは無効になっているので、有効にするためにa2enmodを使う。

smokeping install

$sudo apt update
$sudo apt install smokeping 
$sudo a2enmod cgid

smokeping設定ファイル追記

設定ファイル、いろいろ設定できるけど、今回はping対象のターゲットを追記するのみの設定を追記。

$sudo cat /etc/smokeping/config.d/Targets 
*** Targets ***

probe = FPing

menu = Top
title = Network Latency Grapher
remark = Welcome to the SmokePing website of xxx Company. \
         Here you will learn all about the latency of our network.

+ Local

menu = Local
title = Local Network
#parents = owner:/Test/James location:/

++ LocalMachine

menu = Local Machine
title = This host
host = localhost
#alerts = someloss


############ ここから下を追記 ############
++ internet
menu = shanghai internet  
title = shanghai inernet
host = shanghai

++ cen
menu = shanghai CEN
title = shanghai CEN
host = shanghai_cen

## マルチラインな比較グラフの設定
++ compare
menu = Internet vs CEN
title = Internet vs CEN
host = /Local/internet /Local/cen

雑に説明すると、+Localや`++internetはpingの結果のrrdファイルが格納されるディレクトリで、smokepingのhome(/var/lib/smokeping)以下に配置される。
hostはIPアドレスか、名前解決可能なホスト名またはFQDNを設定する方法と、別の設定によってすでにrrdファイルが格納されているディレクトリを設定する方法があり、後者は複数のホストを一つのグラフにまとめて表現するときに使用する。

smokeping 起動

$sudo service apache2 start 
$sudo service smokeping start

smokeping確認

自分の環境からのwebアクセスができるようにTCP 80portをセキュリティグループの設定で解放し、以下のURLへアクセス。正しく設定されて入れば品質比較の結果が表示されるはず。

http://[東京のECSのEIP]/smokeping/smokeping.cgi?target=Local
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0