ja:documentation:pandorafms:monitoring:20_gis

GIS 監視

A GIS map is a visual representation of the location of the agents inside the Pandora FMS installation. With this map we can see the current position, as well as a small history of the agents positions.

GIS マップは、Pandora FMS のエージェントの場所を視覚的に表現したものです。このマップで、エージェントの現在の位置と、これまでの位置の履歴を見ることができます。

To be able to use the GIS maps, you must have configured the agents, the server and the console.

GIS マップを利用できるようにするには、エージェント、サーバ、コンソールの設定が必要です。

エージェント設定

Software agent pandora_agent.conf file contains parameters to configure the device's position:

ソフトウエアエージェントpandora_agent.conf ファイルには、デバイスの位置をするパラメータがあります。

  • Longitude.
  • Latitude.
  • Altitude.
  • Position description.
  • 経度
  • 緯度
  • 高度
  • 位置の説明

The gis_exec parameter can also be used to indicate the path of the script that returns the coordinates of a device by means of a string with the “latitude, logitude, altitude” format.

gis_exec で別途パラメータを設定するスクリプトを指定することもできます。これには、“緯度,経度,高度” というフォーマットの文字列を返すスクリプトのパスを指定します。

Example:

例:

# Agent position parameters
# Those parameters define the agent's geographical position.

# gis_exec: Calls a script that returns a string with '[latitude],[longitude],[altitude]'
# i.e.: 41.377,-5.105,2.365

#gis_exec /tmp/gis.sh

# latitude
latitude 42.70456
# longitude
longitude -3.897187
# altitude
altitude 600

# Position description
position_description Madrid, centro

サーバ設定

GIS features must also be enabled on the server, enabling the activate_gis parameter. If this flag is set to 1, the server will process all GIS information received from the agents.

GIS 機能は、サーバで有効にする必要があります。activate_gis フラグを 1 に設定することにより、サーバが、エージェントから受け取った GIS 情報を処理するようになります。

There is also the new feature of storing agent positions on Pandora FMS. But this data comes from a source that is not highly accurate and it can cause for an agent with no significant position changes to send location change information. To avoid this, the location_errorparameter fixes the distance which is considered to be the same location. This is an error tolerance pn the position threshold and while the agent location continues to be within that range, it is considered that there has been no position change.

位置情報により、Pandora FMS にエージェントの位置を保存することができます。しかし、このデータには高い正確性はありません。重要な違いを考慮することなく、近い位置の多くの異なるデータが保存されます。これを避けるために、location_error パラメータに 同じ位置であると認識する距離を設定します。これは位置が変わったと認識する閾値です。エージェントから新たに受け取った位置データが、この距離 (メートル単位) 内であれば同じ位置であると認識し、指定した距離よりも離れていれば、位置が変わったと認識します。

Discovery server and position information:

自動検出サーバと位置情報

By using a reverse geolocation algorithm and a database, containing the relation of IPs and positional information, the Discovery server is now able to 'calculate' the position of the discovered agents. It can use a file in **MaxMind GeoIP GeoLiteCity** format or a couple of tables on the database containing this particular information.

IP アドレスの位置情報データベースとその検索アルゴリズムを利用することにより、自動検出サーバは、検出したエージェントの位置を推測することができます。このために、MaxMind GeoIP GeoLiteCity フォーマットや、データベースのテーブルの組み合わせを利用します。

There are also two parameters which define this particular Discovery server performance. The recon_reverse_geolocation_fileis only used to point to the file which contains the reverse geolocation information by using the MaxMind GeoLiteCity.dat format and the recon_location_scatter_radius; parameter. The algorithm will calculate an approximated position for the agents and they will be randomly placed around the calculated positions, taking into account the indicated recon_location_scatter_radius radio.

自動検出サーバの動作を定義する、2つのパラメータがあります。recon_reverse_geolocation_file は、MaxMind GeoLiteCity.dat を用いた逆ジオロケーションを含むファイルを指し示すのみに使われます。recon_location_scatter_radius は、検出したエージェントを、逆ジオロケーションアルゴリズムおよび recon_location_scatter_radius のパラメータによって定義される範囲(メートル単位)に従い、指定された場所の周辺にランダムに配置するために利用されます。

You may also use the reverse geolocation provided by the Google API® and OpenStreetMaps®.

また、Google API® および OpenStreetMaps® により提供される位置情報変換 (リバースジオロケーション) を利用することもできます。

  • You may activate Google® reverse geolocation by setting the parameter named google_maps_description to 1.
  • You may activate Openstreet Maps® inverse geolocation by setting the parameter openstreetmaps_description to 1.
  • Be careful when using this feature, because it considerably decreases the Pandora FMS server's performance.
  • Please keep in mind that you're required to have a direct connection to the Internet to use Google® API and Openstreet Maps®. It also heavily depends on the service provider's availability.
  • Google® のジオロケーションを有効にするには、google_maps_description1 に設定します。
  • Openstreet Maps® のリバースジオロケーションを有効にするには、openstreetmaps_description1 に設定します。
  • この機能を利用する場合は、十分注意してください。なぜなら、Pandora FMS サーバのパフォーマンスを低下させるためです。
  • Google® API および Openstreet Maps® を利用するためには、インターネットへ直接接続している必要があることに注意してください。もちろん、それらのサービスが動作している必要もあります。

Configuration Example:

設定例:

 # Flag to activate GIS (positional information for agents and maps). It's deactivated by default.
 activate_gis 1

 # Radius of the Error in meters to consider two GIS locations as the same location.
 location_error 10

 # Recon reverse geolocation file (databases containing the reverse geolocation information using
 # the 'MaxMind GPL GeoLiteCity.dat' format).
 # Comment it to disable the IP geolocation on agent creation.

 recon_reverse_geolocation_file /usr/local/share/GeoIP/GeoLiteCity.dat

 # Radius (in meters) of the circle in which the agents will be place randomly when found by a recon task.
 # The center of the cycle is guessed by geolocating the IP.
 recon_location_scatter_radius 1000

 # This enables real time reverse geocoding using the Google Maps public API.
 # This requires internet access and could have performance penalties because of having to process GIS
 # information due the connection required to resolve all GIS input.

 google_maps_description 1

 # This enables real time reverse geocoding using OpenStreetMaps public API.
 # This requires internet access and could have performance penalties because of having to process GIS
 # information due the connection required to resolve all GIS input.
 # You may alter the code to use a local or your own OpenStreetMaps server.

 openstreetmaps_description 1

There is a plugin that recalculates agent GIS localization. The plugin path is /usr/share/pandora_server/util/agent_gis_update.pl by default, but it can be place wherever the user prefers.

エージェントの GIS 位置情報を再計算するプラグインがあります。 プラグインのパスは、デフォルトで /usr/share/pandora_server/util/agent_gis_update.pl ですが、任意の場所に置きなおすことができます。

Example:

例:

/usr/share/pandora_server/util/agent_gis_update.pl /etc/pandora/pandora_server.conf

コンソール設定

In the console, to use GIS features, they must have been previously activated in the main setup in Pandora FMS console. Go to menu Setup > Setup > General Setup:

コンソールで GIS 機能を利用するには、最初にメインの設定で有効にする必要があります。セットアップ(Setup) > セットアップ(Setup) > 基本設定(General Setup) へ行きます。

Click Enable GIS features and then click Update. Then some new sections from the user interface will be available.

GIS 機能を有効化し更新をクリックします。すると、ユーザインタフェースに新たなメニューが追加されます。

In Setup > Setup > GIS map connection, it will define the connections that can be used with map servers to provide maps for GIS features.

セットアップ(Setup) > 利用 GIS マップ(GIS map connection) にて、GIS で利用するマップを提供する地図サーバへの接続を定義する必要があります。

基本設定

接続はいくつかの基本的なパラメータで設定します。

  • 利用マップ名(Connection name) は、マップ設定画面で利用マップを選択する時の名前です。
  • グループ(group) は所属するグループです。GIS 接続マップを作成しようとしているユーザが明示的に “すべて” グループに属していない場合でも、接続として"すべて"グループを割り当てることができます。
  • 選択可能な拡大率の数(number of zoom levels) はマップ上で定義します。
  • デフォルト拡大レベル(default zoom level) は、必須パラメータで、マップを開いたときの拡大レベルを指定します。(マップ上で再定義できます)

基本パラメータを設定したら、利用マップのタイプを選択する必要があります。タイプによりオプションが異なります。以下に、それぞれのタイプとオプションを示します。

Open Street マップ

Pandora FMS のデフォルトインストール状態では、Open Street マップ を利用するようになっています。これを使って直接 GIS 機能を確認することができます。

マップに、Open Street マップを利用するには、以下に示すように、画像サーバの URL のみをパラメータとして設定する必要があります。

Examples:

例:

http://tiles.example.com/${z}/${x}/${y}.png

http://tile.example.com/${z}/${x}/${y}.png

You may check an official server list in OpenStreetMap® website, read and follow carefully the instructiond for naming and identification.

OpenStreetMap® の公式サーバ一覧サイトを確認し、名前と識別に関して確認し、それに従ってください。

Google マップ

Pandora FMS also includes connection to Google Maps®. therefore it is necessary to obtain a valid password from Google® (see Google Maps API policy) and to be placed in the corresponding field in connection's definition.

Pandora FMS はまた、Google Maps® もサポートしています。これを利用するには、Pandora コンソールで利用する正しい password を Google から取得し、入力フィールドに設定する必要があります。(詳細は、Google マップ API ポリシー を参照)

With this password it is possible to define several connections using different types od base maps: Hybrid, Physical or Satelite.

このパスワードで、ベースのマップの種類 (航空写真地形地図) を設定することができます。

このキーは、取得してから利用できるまでに数分かかる場合があります。

静的画像

ほかには、マップとして静的画像の利用をサポートしています。この種類のマップを利用するには、画像ファイルは、EPSG:4326 である必要があります。

マップの定義に必要なパラメータは、画像の URL高さ および、マップ画像の位置情報 (経度緯度) と座標 () です。

WMS サーバ

Pandora FMS サーバが直接インターネットに接続されていない場所にある場合、オンラインマップサービスを使用することはできません。また、その他の場合においても、ユーザは独自のマップサーバを使用して柔軟性を高めたり、作業を高速化したり、独自のモザイクタイプを定義したい場合があります。

From version 723, it is possible to add connections to WMS (Web Map Service) server, such as GeoServer. For that it is necessary to enter the address where the service is provided and the name or names of the layers to be obtained from it.

バージョン 723 から、GeoServer のような WMS サーバ(Web マップサービス)への接続を追加できるようになりました。それには、サービスが提供されているアドレスを入力し、そこから取得したいレイヤの名前を入力する必要があります。

GeoServer サーバの最小限のインストールと設定は、こちら を参照してください。

マップの中心とデフォルトの位置

マップ接続の最後は、位置情報を持っていないエージェントに対するマップの中心とデフォルトの位置の定義です。それらを定義するには、マップをプレビューし、マップをクリックして、'Change in the Map' セレクタで選択されているパラメータに応じて、このパラメータを設定します。

In this preview map, it is possible to move around using the green arrows at the top left, change the zoom level with icons + or - or use the zoom in option.

このプレビューマップでは、左上の緑色の矢印を使用して移動したり、+ または - アイコンでズームレベルを変更したり、ズームインオプションを使用したりすることができます。

It is also possible to fix the position by entering the values in their corresponding entry cells (the decimal separator is the dot).

入力ボックスに値(小数点はドットです)を入れることによって、位置を設定することもできます。

すべての接続パラメータを設定したら、'保存(Save)' ボタンをクリックすることにより、マップビルダから利用できるように接続を保存できます。

GIS マップ

接続の設定を行うと、GIS マップ(GIS Map) で利用することができるようになります。

The menu takes the user to a screen with defined maps, where it is possible to edit a map, view the map, fix the default map or delete a map.

定義済のマップを含む画面が表示されます。ここでは、マップの編集、マップの表示、デフォルトマップの定義、マップの削除ができます。

Sample layer:

サンプルレイヤ:

There is also a button to create new maps (Create button).

新たなマップを作成するボタン(作成(Create)ボタン)もあります。

Set a default map, that will be used in the agent view to show its position.

デフォルトマップ を設定します。これは、エージェント表示でその位置を表示するために使用されます。

GIS マップの作成

Once on the map creation page, the first thing to do is to add a map name and a map connection from the ones available. You may add more than one, which will be available later on as base layers (only one of them can be active at once).

マップ作成ページで最初に行うことは、マップ名 の設定と、定義されている 利用マップの指定 (後述するベースのレイヤとして、一つ以上を設定することができますが、同時には一つのみが有効です) です。

When the connection is selected, or if the default connection for the map is changed, the Pandora FMS Console will ask whether you intend to use the default data from the connection for the map. If the answer is 'Accept', the console will fill out or update all positional data with the ones defined in the connection, and the user will just set the default zoom in level. If use of the default values is denied, no changes will be made and the connection will just be added.

利用マップを選択すると (デフォルトのマップを変更すると) 、Pandora FMS コンソールが、利用マップのデフォルトデータを利用したいかどうかを尋ねてきます。それを'受け入れる'と、コンソールは全ての位置データを利用マップに設定されている値に設定 (更新) します。ユーザは デフォルトの拡大率 のみ設定する必要があります。キャンセルすると、これらのフィールドの変更は行われず、利用マップの設定のみが追加されます。

Layer definition

レイヤ定義

Once the basic map parameters are set, it is time to define the map's layers used to select which elements are shown on the map - except if it is the default map - on which there is no need to define any layer, because it will be used to display the agent's position in the agent view.

基本的なマップのパラメータを設定したら、どのエレメントをマップに表示するかを選択するためのマップのレイヤを定義します。(ただし、デフォルトマップではレイヤを定義する必要がありません。なぜならエージェントビューにおいて、エージェントの位置を表示するのに利用されるためです。)

Each map has one or more layers to display agents. Each layer was designed to display the group agents, a list of agents and/or a group with an agent as a sample. That way, it is easy to define the agents shown on each layer.

それぞれのマップは、エージェントを表示するための 一つ以上のレイヤ を持っています。それぞれのレイヤは、グループに属するエージェント や、エージェント一覧 を表示することができます。これにより、それぞれのレイヤに表示するエージェントの設定は簡単です。

Layers can be defined as visible or hidden and it is possible to:

レイヤは、'表示' または '非表示' を定義できます。

  • Choose the group with the selector to add agents.
  • Add agents with the cell individually.
  • Add a group with only one agents as sample.
  • エージェント追加のためにグループを選択します。
  • または、エージェントを手動で追加します。
  • または、一つのエージェントのみを表現するグループを追加します。

Once you have created a group in a layer with its representative agent, you cannot generate the same group with another agent.

代表エージェントを持つレイヤにグループを作成したら、他のエージェントで同じグループは生成できません。

Once the layer is defined (it is not completely saved until the complete map is, by clicking Save map), it will be moved to the left column of defined layers, where it is possible to arrange (move them up or down), delete or edit them again.

レイヤが定義されると(マップの保存をクリックまで、完全には保存されません)、定義されたレイヤーの左の列に移動し、レイヤの削除、または編集が再度可能になります。 レイヤはマップ全体が保存されるまで完全に保存されません。

Once the map layer definition is complete, it is saved by clicking on the Save Map button (Update Map button in case the map was edited instead).

マップのレイヤ定義が完了したら、マップの保存(Save Map) ボタンにて全てを保存することができます。マップを編集する場合は、マップの更新(Update Map) ボタンが表示されます。

少なくとも一つのマップを定義すると、GIS 機能を使い始めることができます。

GIS マップ

GIS マップメニューは、すべての定義済マップを表示します。それぞれマップに定義されたパラメータでマップを表示できます。

マップの移動

The controls for the map include four green arrows on the top left corner which allow to move around on the map. The '+' and '-' icons are intended to increase and decrease the zoom level. There is also a 'zoom bar', designed to directly select the desired zoom level.

左上にマップ操作のための、4つの緑の矢印があります。それぞれの方向の矢印をクリックすることにより、マップを動かすことができます。'+' と '-' は、拡大率を増減させるアイコンです。また、'ズームバー' で直接設定したい拡大率を選択することができます。

マップをドラッグすることによっても、動かすことができます。

マップ上に表示されているエージェントをクリックすると、そのエージェントに関する詳細情報を表示できます。追加情報画面が表示され、エージェントの名前はエージェント表示へのリンクになっています。

レイヤ

The white '+' icon at the right opens the layer's controls. It displays a green box in which it is possible to select the base layer (the connection to the map's server, if there were more than one are defined for that map) and see which layers are visible.

右側の緑の背景に白の '+' をクリックすると、レイヤの操作パネルが開きます。緑色のボックスが表示され、ベースのレイヤ (利用マップが一つ以上定義されている場合) および、表示するレイヤを選択することができます。

There is also a special system-defined layer called Agent Hierarchy. If this layer is visible, it will display some red dashed lines, connecting an agent to its parent element (if both of them are visible).

エージェントの階層(Hierarchy of Agents) と呼ばれる特別なシステム定義レイヤもあります。 このレイヤーが表示されている場合は、赤い点線が表示され、両方が表示されている場合はエージェントがその親要素に接続されます。

フィルタ

マップ上には、エージェントの状態のフィルタオプションがあります。

  • 正常(Ok)
  • 障害(Critical)
  • 警告(Warning)
  • その他(Other)

マップの更新

フィルタボタンの隣に、マップの更新間隔を設定する 更新(Refresh) というコンボボックスがあります。マップは、指定した間隔でエージェントを更新するために、http://ja.wikipedia.org/wiki/AJAX AJAX を呼び出します。

補助ボタン

The last three buttons at the top of the map are:

マップの上にある残りの 3つのボタンは次の通りです。

  • A public link to the Visual Console
  • A button to see the Full screen map.
  • A button to access again the GIS map list.
  • ビジュアルコンソールへのリンク
  • 全画面 マップ表示ボタン
  • GIS マップ一覧へのボタン

エージェントビュー

The Pandora FMS console agent view also comes with new GIS features. The main view now displays the agent location in terms pf longitude, latitude and altitude.

Pandora FMS コンソールのエージェント表示にもまた GIS 機能があります。メイン画面でエージェントの 経度緯度高度 を表示します。

GIS 履歴表示

トップバーに、エージェントの GISビュー を表示するためのボタンがあります。(GIS が有効な場合)

ここで、デフォルトマップでのエージェントの現在の位置が表示されます。また、エージェントの過去の位置の履歴およびマップ上に位置のパスが表示されます。

マップにおけるそれぞれの位置は、ドット で表現されます(現在の位置は、エージェントアイコンもしくは、エージェントのアイコンが定義されていない場合はグループアイコンで表されます)。ドットをクリックすることによって、その位置にあった時の情報を表示することができます。また、エージェントアイコンをクリックすると、エージェントの現在の情報が表示されます。以下の画像では、Android デバイス向け Pandora FMS エージェントによって通知されたパスを表示しています。

また、エージェントから通知された全ての情報を表形式で表示することができます。位置情報変換 (reverse geolocation) システムにより、Pandora FMS エージェントがいる場所が、国、都市、通りの名前と共に表示されます。

エージェントの GIS 設定

エージェント管理メニューの中に、新たにエージェントの位置を手動で設定する項目があります。また、GIS 機能に関連するいくつかのパラメータがあります。

GIS データの無視

On the agent manage tab, there is a new switch called Update new GIS data. If this switch is activated, the server will ignore all positional information received from the agent and use the last valid values for it. This is useful in case an agent reports a wrong position or it gets its own fixed place.

エージェント管理 メニューに、新たな GIS データを更新(Update new GIS data) という選択があります。これを無効にすると、エージェントから受け取る位置情報をサーバが無視し、最後に設定された位置を維持するようになります。エージェントが間違った位置情報を送信してくる場合や、位置が固定されている場合に便利です。

エージェントの手動での位置決め

デフォルトのマップで、クリックすることによりエージェントの新たな位置を設定することができます。また、位置情報を入力ボックスから入力することもできます。

Defining the agent's position will activate the Ignore GIS Data option that will later take the opposite value in the option Update new GIS data in order to avoid the agent's next positional information data package to reset the agent's position again.

If this is not the desired performance, we recommend deactivating the Ignore GIS Data option before clicking Update.

エージェントの位置を定義すると、新たな GIS データを更新(Update new GIS data) と逆にGISデータを無視オプションが有効になります。このオプションは、エージェントから次の位置情報データが来ても、エージェントの位置情報を再度リセットします。

これが望む動作でない場合は、更新(Update) をクリックする前に GISデータを無視する オプションを無効にすることをお勧めします。

以下に、独自のマップサーバの設定および、現在のコードの機能をより理解するために参考になるリンクを示します。

OpenLayers

OpenStreetMap

OS Geo

Geo Server

PostgreSQL

Blogs

  • ja/documentation/pandorafms/monitoring/20_gis.txt
  • 最終更新: 2023/11/15 03:35
  • by 127.0.0.1