Pandora: Documentation en: GIS
- 1 The Pandora GIS
- 1.1 Introduction
- 1.2 Setup
- 1.2.1 Agent configuration
- 1.2.2 Server configuration
- 1.2.3 Console setup
- 1.3 Operation
- 1.3.1 The GIS Maps
- 1.3.2 The Agent View
- 1.3.3 The Agent's GIS Setup
- 1.4 Useful Links
1 The Pandora 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.
To be able to use the GIS maps, you must have configured the agents, the server and the console.
1.2.1 Agent configuration
The software agent pandora_agent.conf file contains parameters to configure the device's position: longitude, latitude, altitude and position description. The 'gis_exec' parameter can also be used, where the path of the script that returns the coordinates of a device by means of a string with the "latitude, logitude, altitude" format must be indicated.
This is an 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
1.2.2 Server configuration
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.
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_error' parameter 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.
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.
There are also two parameters which define this particular Discovery server performance. The recon_reverse_geolocation_file is only used to point to the file which contains the reverse geolocation information by using the 'MaxMind GPL 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.
You may also use the reverse geolocation provided by the Google API and OpenStreetMaps. You may activate Google's reverse geolocation by setting the parameter named 'google_maps_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's API and Openstreet Maps. It also heavily depends on the service provider's availability.
# 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.
The default path of the plugin is /usr/share/pandora_server/util/agent_gis_update.pl, but you can locate it wherever you want.
1.2.3 Console setup
To use GIS features, they must have been previously activated in the main setup in Pandora FMS console.
Once activated, the following new user interface sections become available:
In Setup -> GIS map connection, define the connections that can be used with map servers to provide maps for GIS features.
184.108.40.206 GIS Connections
220.127.116.11.1 Basic Configuration
The connection comes with several basic parameters:
- A name for the configuration, so it can be recognized when selecting a connection on the map definition screen.
- The group the connection belongs to.
- The number of zoom levels defined on the map.
- The default zoom level recommended for the map (this can be redefined on the map) and it is the zoom in level used when the map is open.
Once the basic parameters are set, the administrator is required to select a connection type. Depending on the type, there will be different options, and so are the types of connections and their options.
18.104.22.168.2 OpenStreet Maps
The default Pandora FMS installation comes with a predefined connection with OpenStreetMaps so the users are able to directly see and test the GIS features.
In order to use an Open Street Maps type of map, the only parameter required is the URL of the title server, as shown on the image below.
This could be something similar to:
22.214.171.124.3 Google Maps
Pandora FMS also supports the connection to Google Maps. For that purpose, obtain a valid password for Pandora FMS Console server from Google (see Google Maps API Policy) and place it on the corresponding field of the connection definition.
By means of this password, it is possible to define several connections using different base map types, e.g. 'Hybrid', 'Physical' or 'Satellite'.
126.96.36.199.4 Static Image
Another type of supported connection is to use a Static Image as a map. In order to use this type of map, the image is required to be as a EPSG:4326.
In this case, the parameters required for defining the map are the image URL, the image's height and width and the positional limits ('longitude' and 'latitude') of the image's edges ('right', 'left', 'top' and 'bottom').
188.8.131.52.5 WMS Server
Sometimes Pandora FMS server is located somewhere without direct Internet connection, so it is not possible to use an online map service. Some other times, the user might prefer their own map server to achiever higher flexibility, work faster, or define his own mosaic types. From version 7.0 Build 723 onwards, it is possible to add connections to WMS servers (Web Map Service), like GeoServer. To do this, enter the address where the service is provided and the name or names of the layers you wish to get from it.
For a minimum Geoserver server installation and configuration, see this annex.
184.108.40.206.6 Map center and default position
The last thing to define for a map connection is the map center and the default position for agents without any positional data. In order to define them, it is possible to preview the map and click on it to set this parameters, depending on which parameter is selected by the 'Change in the Map' selector.
Within this preview map, it is possible to move around by using the green arrows on the top left, change the zoom level with the '+' and '-' icons or use the 'magnifier' to use zoom in.
Of course, it is also possible to set the position by inserting the values into the corresponding input boxes.
Once all connection parameters are set, it is possible to save the connection in order to use it on the map builder by clicking on the 'Save' button.
220.127.116.11 GIS Maps
Once the connections are defined, they may be used to define the maps within the GIS Maps .
The menu takes the user to a screen with defined maps, where it is possible to edit a map, visualize the map, set the map as default or delete a map.
There is also a button to create new maps.
The Administrator is required to establish a default map which is going to be used for the agent's view in order to display the agent's position.
18.104.22.168.1 Creating a GIS Map
Once on the map's creation page, the first thing to do is to allocate a map name and to add a map connection from the available ones. It's possible to add more than one, which are going to be available later on as base layers. This means that only one can be active at a time. When the connection is selected or if the default connection for the map is changed, the Pandora FMS Console asks if you intend to use the default data from the connection for the map. If the answer is 'Accept', the console is going to insert or update all positional data ('center longitude', 'center latitude', 'center altitude', 'default longitude', 'default latitude' and 'default altitude') from the ones defined within the connection. The user is only required to set the default zoom level. If the answer is e.g. 'Cancel', no changes will be made within those fields and merely the connection is added.
22.214.171.124.2 The Layer's Definition
Once the basic map parameters are set, it's time to define the map's layers used to select which elements are shown on the map, except if it's the default map - on which you have no need to define any layer, because it's going to be used to display the agent's position in the agent view.
Each map has one or more layers to display the agents. Each layer was designed to display the agents of a group and a list of agents. In this way, it's easy to define the agents shown on each layer.
The layers can be defined as 'visible' or 'hidden'.
- Choose the group with the selector to add their agents.
- Or add manually each agent.
- Or add a group with only one agents as its representation.
Once you have created a group in a layer with its representative agent, you can not generate the same group with another agent.
Once the layer is defined, it will be moved to the left column of defined layers, in which it's possible to arrange, delete or edit them again. The layer is not going to be entirely saved until the whole map is.
Once the definition of the layers of the map is completed, it may be saved by clicking on the 'Save Map' button. The 'Update Map' button is only going to be displayed in case of editing any map.
Once there is at least one map defined, it's possible to start the operation containing the GIS features.
1.3.1 The GIS Maps
The GIS map menu displays all defined maps. Each one can be visualized by displaying the map with the parameters defined in the map.
126.96.36.199 Moving around on the Map
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 favored zoom level.
It's also possible to move around by dragging the map to its favored position.
The agents shown on the map are able to be clicked on in order to display more information about the agent. Once the bubble containing the extra info is displayed, the agent's name consists of a link to the agent's view.
188.8.131.52 Hide, Show and Select Layers
The white '+' icon on the green background on the right is going to open the layer's controls. If you click on it, it's going to display a green box in which it's possible to select the base layer (it's the connection to the map's server, if more than one are defined for the map) and to determine which layers are visible.
There is also a special system-defined layer called 'Hierarchy of Agents'. If this layer is visible, it's going to display some red dashed lines, connecting an agent to its parent element if both of them are visible.
Above the map there are filtering options for the state of the agents:
184.108.40.206 Map Refresh
Next to the filter buttons, there is a combo box named 'Refresh' to select the update rate for the map. The map utilizes [AJAX Calls] to refresh the agents on the map by using the defined period.
220.127.116.11 Map Edit and Full Screen
The last three buttons on the map's top right is a link to the Public Visual Console, a GIS Map Builder link, intended for editing the map and a full-screen button to see the map in full-screen mode.
1.3.2 The Agent View
The Pandora FMS console's agent view also comes with new GIS features.
The main view now displays the longitude, latitude and altitude values of the agent.
18.104.22.168 The Historical GIS View
There is a new button on the top bar in order to display the agent's GIS view (if GIS is activated).
This view displays the agent's current position on the default map. It contains a table which displays the history of the agent's previous positions and a path of them on the map.
Each position on the map is represented by a dot, except the current one which is represented by the agent's or group's icon if the agent doesn't have one. It's possible to click on any of these dots in order to obtain position-related information. It's also possible to click on the agent's icon in order to display the agent's current information.
You're also able to display a table which contains all the agent's reported information, including a reverse geolocation system which was designed to display the agent's address including the street, city and country in which the Pandora FMS agent is located.
1.3.3 The Agent's GIS Setup
Among the agent's administration tabs, there is a new tag to manually set the agent's position. The 'agent manage' tab also has some parameters which are going to affect the GIS features.
22.214.171.124 Ignoring GIS Data
On the 'agent manage' tab, there is a new switch called 'Ignore GIS data'. If this switch is activated, the server is going to ignore all positional information received from the agent and uses the last valid values for it. This is useful in case an agent is reporting a wrong position or it's desired to place it on a fixed place.
126.96.36.199 Manual Position of the Agent
The 'GIS Data' view displays the default map on which it's possible to click on the agent in order to determine the agent's new position. It's also possible to determine the position by using the input boxes below the map.
Defining the agent's position is going to activate the 'Ignore GIS Data' switch 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 behavior, we recommend to deactivate the 'Ignore GIS Data' switch before clicking on the 'Update' button.
1.4 Useful Links
This is a collection of interesting links which are quite useful if you intend to implement your own tile server and expand the current code's features.
- Wikipedia page about OpenLayers
- Openlayer documentation made by using Natural Docs Openlayers Documentation
- More information about Openlayers Official documentation about styles
- Help with OpenLayer styles: OpenLayers Styles
- Debugging by Firebug OpenLayers Debug
- Some examples of OpenLayers
- Make your first map OpenStreetMap + osm2pgsql + PostGIS + Mapnik
- Using OpenStreetMap
- Tiles download OSM
1.4.4 OS Geo
1.4.5 Geo Server
- Documentation for GIS extensions for PostgreSQL 8.1