Pandora: Documentation en: GIS
- 1 The Pandora GIS
- 1.1 Setup
- 1.1.1 The Agent's Configuration
- 1.1.2 The Server's Configuration
- 1.1.3 The Console's Configuration
- 1.2 Operation
- 1.2.1 The GIS Maps
- 1.2.2 The Agent View
- 1.2.3 The Agent's GIS Setup
- 1.3 Useful Links
- 1.1 Setup
1 The Pandora GIS
From Pandora FMS versions 3.1 and above, Pandora FMS supports the processing of positional information and interactive maps to display the agent's positions. This is a feature of the open-source version and intended for UNIX Agents only.
1.1.1 The Agent's Configuration
The agent now accepts new parameters to send the positional data. In the 'agent.conf', there some new parameters for longitude, latitude, altitude and position description now. Other parameters for an alternative way to obtain the coordinates are located in the file named 'gis_exec' now. This parameter has a script path which is going to return a string, containing the coordinates in the format of '[latitude],[longitude],[altitude]'.
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.1.2 The Server's Configuration
The GIS features are also required to be enabled on the server. There is a new flag called 'activate_gis' for this. If this flag is set to '1', the server is going to process all GIS information it receives from the agents.
There is also the new feature of storing agent positions on Pandora FMS by positional data now. This data is coming from a source without high accuracy. It's possible to store a lot of different points very close to each other without an important difference on the position. To avoid this circumstance, the 'location_error' parameter determines the distance which is considered to be the same location. This is an error threshold on the position and all data received from an agent having a position within the distance (in meters) defined within this parameter will be stored as new data received on the same point, until the received position moves out of the defined error distance which triggers the setting of a new location.
Recon Server and positional Information:
By using a reverse geolocation algorithm and a database, containing the relation of IPs and positional information, the Recon Server is now able to 'guess' the position of the discovered agents. It's able to use a file in MaxMind GeoIP GeoLiteCity format or a couple of tables on the database containing this particular information.
There is also an entire two parameters which define this particular behavior of the Recon Server. 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'. The last parameter is called 'recon_location_scatter_radius' which is used to place the discovered agents randomly around the point defined by the reverse geolocation algorithm and within the range (in meters) defined by the 'recon_location_scatter_radius' parameter.
You're also able to 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'. You may activate OpenStreetMaps reverse geolocation by setting the parameter 'openstreetmaps_description' to '1'.
Be careful in 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 depends heavily on 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
1.1.3 The Console's Configuration
Within the Console, the configuration must be activated in the main setup in order to utilize the GIS features.
Because of the activation, the following new sections of the user interface are available now:
18.104.22.168 GIS Connections
Within the admin setup, the first step is to define the connections which can be used to connect to the map servers in order to provide maps for the GIS features.
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 that owns the connection. This is going to be used to filter the connections available on the map builder, depending on the ACLs.
- 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's the zoom 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.
22.214.171.124.1 Open Street Maps
The default installation of Pandora FMS comes with a predefined connection with OpenStreetMaps so the users are able to directly see and test the GIS features. Usually the Pandora FMS server's location is a place without direct access to the Internet or the user would prefer to use it's own map server to have more flexibility, to be faster or to define it's own kind of tiles. Please check the topic named Pandora:Current_development:Pandora_GIS_Backend for a possible way to achieve this.
In order to use an Open Street Maps type of map, the only parameter required is the URL of the tile server as shown on the image below.
This can be something like:
126.96.36.199.2 Google Maps
Pandora FMS also supports the connection to Google Maps. A valid key for the Pandora FMS Console Server must be obtained from Google (see Google Maps API Policy) and placed in the corresponding field of the connection definition.
By this key, it's possible to define several connections by using different types of base maps, e.g. 'hybrid', 'physical' or 'satellite'.
188.8.131.52.3 Static Image
Another type of supported connection is to utilize a static image as a map. In order to use this type of map, the image is required to be on a EPSG:4326 projection.
In this case, the parameters required for the map's definition are the URL of the image, the image's height and width and the positional limits ('longitude' and 'latitude') of the image's sides ('right', 'left', 'top' and 'bottom').
184.108.40.206.4 WMS Server
From version 7.0 Build 723 it is possible to add connections to WMS servers (Web Map Service), like GeoServer. To do this, it is necessary to enter the address where the service is provided and the name or names of the layers we want to get from it.
For a minimum installation and configuration of a GeoServer server, see this annex.
The Map's Center and Default Position
The last thing to define for a map connection is the map's center and the default position for agents without any positional data. In order to define them, it's possible to preview the map and click on the map to set this parameters, depending on which parameter is selected by the 'Change in the Map' selector.
Within this preview map, it's possible to move the map around by using the green arrows on the top left, to change the zoom level with the '+' and '-' icons or to use the 'magnifier' to use the full zoom.
It's also possible to set the position by inserting the values into the corresponding input boxes.
Once all connection parameters are set, it's possible to save the connection in order to use it on the map builder by clicking on the 'Save' button.
220.127.116.11 The GIS Map Builder
Once the connections are defined, they may be used to define the maps within the 'GIS Maps Builder'.
The menu takes the user to a screen which contains the defined maps. In there it's possible to edit a map by clicking on its name, to view the map by clicking on the 'View' icon, to determine the default map by the radio buttons or to delete maps by using the 'Delete' icon. 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'. Please select the group by the selector or add agents by the box. 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.2.1 The GIS Maps
The GIS Maps menu is going to display all defined maps. Each link leads to one of the maps which will be opened by using the parameters defined within the 'GIS Maps Builder'.
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. If you intend to close the bubble, please click on the red box with a cross.
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.
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 are the following five buttons to filter the agents shown by their state on the map's top:
- The green button is going to display all agents in 'OK' state.
- The gray button is going to display all agents in 'unknown' state.
- The yellow button is going to display all agents in 'warning' state.
- The red button is going to display all agents in 'critical' state.
- The All button is going to display all agents, defined by their layers without taking their states into account.
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.2.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. For Android devices, the path reported by the Pandora FMS agent is shown on the picture below.
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.2.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.3 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.3.4 OS Geo
1.3.5 Geo Server
- Documentation for GIS extensions for PostgreSQL 8.1