Difference between pages "Pandora: Documentation en: Configuration Agents" and "Pandora: Documentation en: Discovery"

From Pandora FMS Wiki
(Difference between pages)
Jump to: navigation, search
((>= 6.0 SP4) module_ff_timeout)
 
(NetScan)
 
Line 1: Line 1:
= Pandora FMS Software Agents =
 
  
== What is a software Agent? ==
+
=What is Pandora FMS Discovery?=
  
As its name indicates, they are small pieces of software that are installed in the operating systems and remain running in them to extract monitoring information and send it to the Pandora FMS server regularly.
+
{{Tip|Available for Pandora FMS 732 versions or higher.}}
  
They use the commands and tools of the operating system in which they are installed to obtain the information. They conform the data in a file in XML format and send them to the Pandora FMS data server, which processes and stores them in the database.
+
Discovery provides a set of tools to simplify monitoring through wizards.
  
Each of the individual checks is called ''Module''.
+
The following tools are included:
  
== Introduction to the Agent Configuration ==
+
;Task list: Pandora FMS Discovery tool allows you to see a list of all the tasks programmed in your environment, both at console and server levels.
 +
;Discovery Applications: It allows to monitor MySQL, Oracle or VMware environments from a new management console.
 +
;Discovery Cloud: Through this feature, you may monitor your cloud infrastructure, ranging from virtual machines created through Amazon Web Services (EC2) or relational databases in AWS RDS, to virtual machines running in Azure Compute.
 +
;Console Tasks: It allows you to automate console tasks within the Discovery system, like scheduling reports, doing backups or executing custom scripts from Pandora FMS Console.
 +
;Discovery Host&Devices: It includes the tools needed to discover or import devices and equipment to your network.
  
The operation of the software agent is determined by its configuration file, called ''pandora_agent.conf'', located in the installation directory on Windows systems, and ''/etc'' on Linux systems.
+
<center>
 +
[[File:discovery1.png]]
 +
</center>
  
The configuration file contains all the operating parameters and modules of that agent.
+
=Discovery Task list=
  
== General Agent Parameters ==
+
Pandora FMS Discovery tool allows you to see a list of all the tasks programmed in your environment, both at console and server levels.
  
The Configuration of the General Agent Parameters is defined in this section. Some of them are common for all systems and others are intended specifically for Windows or Unix machines. The general parameters are:
+
<center>
 +
[[File:DISC_Task_list_1.JPG]]
 +
</center>
  
 +
==Console tasks==
  
{{warning|The first time the server receives data from an agent is going to save all of the information into the database. For the following received data it will only update (depending on learning mode status enabled/disabled) the following fields from XML file: '''version''', '''date''', '''OS version''', and the following parameters from the configuration file: '''gis_exec''', '''latitude''', '''longitude''', '''altitude''' '''parent_agent_name''', '''timezone_offset''', '''address''' and '''custom_field'''.}}
+
This section allows you to see the list of scheduled tasks in the console. The information is shown according to the following parameters:  
  
{{Warning|'''The agent configuration file encoding is UTF-8''' on both Linux and Windows systems. If you make manual edits of this file, verify that the encoding is correct before overwriting it. If the encoding is not UTF-8 and you use symbols (such as stress marks or extended symbols), the agent will misinterpret these symbols, not being able to guarantee a correct interpretation of its configuration.}}
+
* User: It is the user who created the task.  
 +
* Task: Description of the programmed task
 +
* Scheduled: It specifies how often the task will be executed.
 +
* Next Execution: It specifies the next task execution.
 +
* Last Execution: It indicates when the task was last executed.
 +
* Group: The group to which the task belongs.  
 +
* Operations: It shows the actions that can be performed on the task, such as editing and deleting.
  
===server_ip===
+
===Edit Console tasks===
  
The IP address or the name of the Pandora FMS Server Host where all data will be stored.
+
This button allows access to the creation section, where the desired task can also be edited according to the following parameters:
  
===server_path===
+
* Task: The task that will be executed among the following:
 +
** Backup Pandora FMS database.
 +
** Execute custom script.
 +
** Save custom report to disk.
 +
** Save custom XML report to disk.
 +
** Send custom report (from template) by email.
 +
** Send custom report by email.
  
The server path is the comprehensive file path where the server stores all the data sent by the agents. The default path is ''/var/spool/pandora/data_in''.
+
* Scheduled: It is used to specify how often the task will be executed.
 +
* Next execution: It shows the date of the next execution, being able to modify it if necessary.
 +
* Group: Group to which the task belongs.  
 +
* Parameters: They are the specific parameters of each task.  
  
===temporal===
+
==== Parameters of different tasks ====
 +
<br>
 +
;Backup Pandora FMS database:
 +
* Description: Backup description.
 +
* Save to disk in path: Path where the backup will be stored.<br><br>
 +
;Execute custom script:
 +
* Custom script: The script to be executed will be indicated.<br><br>
 +
;“Save custom report to disk” and “Save custom XML report to disk”:
 +
* Report pending to be created: The report to be created.
 +
* Save to disk in path: Path where the created report will be stored.<br><br>
 +
;Send custom report (from template) by email:
 +
* Template pending to be created: Custom template to be created.
 +
* Agents: Agents from which the information that will be reflected in the report will be obtained.
 +
* Report per agent: If you wish to generate separate reports for each report.
 +
* Report name: Name that you wish to give the report.
 +
* Send to email addresses: Email addresses to which the report will be sent.
 +
* Subject: Topic of the mail to be sent.
 +
* Message: Body of the message with which the reports will be sent.<br><br>
 +
;Send custom report by email:
 +
* Report pending to be created: Report to be generated.
 +
* Send to email addresses: Email addresses the report will be sent to.
 +
* Subject: Topic of the mail to be sent.
 +
* Message: Body of the message with which the reports will be sent.
 +
* Report Type: Type of report that will be sent.
  
The path where the agent stores the data files before they are sent to the server and deleted locally.
+
==Server tasks==
  
===description===
+
This section reflects the recognition tasks programmed by the server. The information is shown according to the following parameters:
  
Sends the description of the agent in XML and Pandora FMS imports this description when it creates the Agent.
+
* Force: Option that will allow forcing the task execution.
 +
* Task name: Name assigned to the task.
 +
* Server name: Server that will execute the task.
 +
* Interval: Time interval during which the task will be performed.
 +
* Network: Network where the checks will be made.
 +
* Status: Status of the scheduled task.
 +
* Task type: Type of the task that has been generated.
 +
* Progress: Progress of the task in case of being executed.
 +
* Updated at: It indicates when the task was last executed.
 +
* Operations: Actions that can be performed on the task. Display of the task status, display of the map of the discovered network, editing and deletion.  
  
===group===
+
===Operations===
  
If there is a group with the name specified in this parameter, the agent will be created within this group unless the server forces the creation of all agents in a given group.
+
The edition of the server recognition tasks allows to adjust the following parameters:
  
===temporal_min_size===
+
* Interval: The task execution interval can be set, either manually or defined.
 +
* Task name: Task Name.
 +
* Discovery server: Server that will perform the recognition task. It is a mandatory parameter for correct recognition operation.
 +
* Network: Network on which the checks are to be carried out.
 +
* Group: Group to which it belongs.
 +
* Comment: Comments to add.
  
If the free space (in MB) of the partition in which the temporary directory is located is lower than this value, it won't continue generating data packets. This prevents the disk from being full if for any reason connection to the server is lost for an extended period of time.
+
=Discovery Applications=
  
===logfile===
+
Now, it is possible to monitor applications remotely using ''Discovery Applications''.
  
The path to the Pandora FMS agent events record file.
 
  
===interval===
+
<center>
 +
[[File:discoverysap1.png]]
 +
</center>
  
It is the agent sampling time,  in seconds. Each time this interval is completed, the agent will collect information and send it to the Pandora FMS server.
+
==Discovery Applications: MySQL==
  
===disable_logfile===
+
From Pandora FMS 7.0-733 version on, MySQL environments can be monitored using Discovery Applications.
  
This parameter disables log writing in pandora_agent.log. Only for Windows.
+
For that purpose, it will be necessary to define the following parameters:
  
===debug===
+
* Task name: Name of the task that will perform MySQL monitoring.
 +
* Discovery Server: Server that will perform the execution of the specified task.
 +
* Group: Group to which it belongs.
 +
* MySQL server IP: IP of the server where the MySQL environment to be monitored is.
 +
* MySQL server port: Port of the specified address through which the information of MySQL monitoring will be obtained.
 +
* User: MySQL user with which to login. (Important: It must be a user with permissions on the database where the queries will be executed, since otherwise the connection will never be established.)
 +
* Password: MySQL user password specified above.
 +
* Interval: Time interval in which monitoring will be executed.
  
If it is active (1), the agent data files are stored and renamed in the temporary directory and are not deleted after being sent to the server, being able to open XML files and analyze their content.
+
<center>
 +
[[File:DISCMySQL1.JPG]]
 +
</center>
  
===agent_name===
+
Once the parameters with the data needed for installation are defined, you will be shown a new window where you must specify the agent on which you wish to create all the modules resulting from MySQL monitoring.
  
It allows setting a custom name. If it is not enabled, the agent name will be the hostname of the machine.
+
The options to be displayed are the following:
  
===(>=5.1SP2) agent_name_cmd===
+
* Target agent: Agent on which the modules resulting from monitoring will be created.
 +
* Custom module prefix: It defines a custom prefix that will be concatenated with the name of the modules generated by the task.
 +
* Scan databases: It will scan the databases.
 +
* Create agent per database: This option will allow an agent to be created for each database found in MySQL environment.
 +
* Check engine uptime: It will check the time that MySQL engine is operational.
 +
* Retrieve query statistics: It allows to recover the statistics of the executed queries.
 +
* Analyze connections: It analyzes connections.
 +
* Retrieve InnoDB statistics: It returns InnoDB statistics.
 +
* Retrieve cache statistics: It returns cache statistics.
 +
* Custom queries: It allows defining custom statements.  
  
Defines the agent name using an external command. If agent_name_cmd is set, agent_name is ignored. The command must return the agent name by STDOUT. If you return more than one line, only the first line will be used.
+
<center>
 +
[[File:DISCMySQL2.JPG]]
 +
</center>
  
===(>=7.0) agent_alias_cmd===
+
==Discovery Applications: Oracle==
  
Defines the agent alias using an external command. If agent_alias_cmd is defined, agent_alias is ignored. The command must return the agent name by STDOUT. If you return more than one line, only the first line will be used.
+
From Pandora FMS 7.0-733 version on, Oracle can be monitored using Discovery Applications.
  
===address===
+
Oracle monitoring will allow to define the following parameters:
  
This is the IP address of the software agent. It could be an IP address with the format X.X.X.X or a domain name such as 'localhost' or 'auto'. If it's an IP address or a domain name, it will be added to the addresses of the agent and established as a main address. If the value is 'auto', it will obtain the IP address from the host and added to the agent as in the previous case.
+
* Task name: Task Name
 +
* Discovery server: Server that will run the Oracle monitoring task.  
 +
* Group: Group it belongs to.
 +
* Oracle target strings: Where the target strings of the task will be defined.  
 +
* User: Oracle user that will access to perform the monitoring.
 +
* Password: Password of the previously defined user.  
 +
* Interval: Execution interval
  
===encoding===
+
<center>
 +
[[File:DISC_Oracle1.JPG]]
 +
</center>
  
Installs the kind of codification of the local system, such as ISO-8859-15 or UTF-8.
+
Once defined, it will be necessary to specify the agent that will store the information and the checks that will be made. The information that can be defined in this section is the following:
  
===server_port===
+
* Target agent: Agent that will receive Oracle monitoring information.
 +
* Custom module prefix: It defines a custom prefix that will be concatenated with the name of the modules generated by the task.
 +
* Check engine uptime: It will check the time that Oracle is operational.
 +
* Retrieve query statistics: It allows to recover the statistics of the executed queries.
 +
* Analyze connections: It analyzes connections.
 +
* Calculate fragmentation ratio: It calculates the fragmentation rate.
 +
* Monitor tablespaces: It monitors tablespaces. 
 +
* Retrieve cache statistics: It returns cache statistics.
 +
* Execute custom queries: It executes custom queries.
 +
* Custom queries: it allows to define customized queries.
  
This parameter allows to identify the remote port of the server that is waiting. By default it's 41121 for Tentacle.
+
<center>
 +
[[File:DISC Oracle2.JPG]]
 +
</center>
  
===transfer_mode===
+
=== Installing Oracle packages ===
  
This parameter specifies the transfer mode we have to install in order send the agent data to the server. Tentacle by default.
+
It is very important to bear in mind that for the correct integration and operation of Oracle with Pandora FMS, it is necessary to have the appropriate packages. Pandora FMS ISO includes everything necessary, but for installations carried out in another way, the installation process will be as follows:
  
=== (>= 6.0) transfer_timeout ===
+
* Install oracle instant client from the Oracle page:
 +
https://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html
  
It is the timeout for file transfer, if the indicated number of seconds is exceeded without completing the transfer, it will be cancelled.
+
* Required packages:
  
===server_pwd===
+
oracle-instantclient11.1-basic-11.1.0.7.0-1.x86_64.rpm
 +
oracle-instantclient11.1-devel-11.1.0.7.0-1.x86_64.rpm
 +
oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.x86_64.rpm
  
Specific for the password of Windows FTP  and for the Tentacle transference mode, although the password for the latter is optional. Server password for authentication with password.
+
* Prepare the boot environment of pandora_server:
  
===server_ssl===
+
{{Warning|In the pandora_server path you need to create a file called pandora_server.env with the following information. Its execution is needed ./pandora_server.env}}
  
Specific for the Tentacle transfer mode. Allows to authorize ('1') or deny ('0) the SSL network encryption.
+
# Set Oracle environment for pandora_server
 +
cat > /etc/pandora/pandora_server.env << 'EOF_ENV'
 +
#!/bin/bash
 +
  VERSION=11.1
 +
export PATH=$PATH:$HOME/bin:/usr/lib/oracle/$VERSION/client64/bin
 +
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/$VERSION/client64/lib
 +
export ORACLE_HOME=/usr/lib/oracle/$VERSION/client64
 +
EOF_ENV
  
===server_opts===
+
* Restart pandora_server
  
Specific for the Tentacle transfer mode. Allows to give additional parameters to the Tentacle client for advanced configurations with security options.
+
/etc/init.d/pandora_server restart
  
Coming with the 3.2 agent version, Tentacle supports the optional use of a HTTP proxy (using CONNECT) mode to send information to the server.  In order to be able to use the output through a proxy, we use the following advanced option (example):
+
{{Warning|If package E7 is being used, version 12.2 of both library and environment variables must be installed, and Oracle (v12.2) packages must be used}}
  
server_opts -y user:[email protected].inet:8080
+
== Discovery Applications: SAP ==
 +
<br>
 +
Discovery Applications has a new family member from Pandora FMS version 741 onwards. This new feature will now be included in the official ISO installation.
 +
<br>
 +
{{Warning|If you Pandora FMS is installed from packages, or your system is prior to NG741, deploy the official SAP plugin in Pandora FMS server and configure it manually (see below).}}
  
This will force the Tentacle client to use 'proxy.inet' on port 8080 using "user" and "pass" for authentication. If you intend to use a proxy on e.g. 192.168.1.2 on port 9000 without credentials, the command would have to be:
+
{{Warning|In order to use SAP in Discovery, configure a specific license number for this plugin, which is not included in Pandora FMS Enterprise license. Configure this license in Setup > Enterprise.}}
  
server_opts -y 192.168.1.2:9000
+
The system will guide you along each step to configure SAP, according to your needs. You may define the same task to monitor systems with similar configurations.
  
===delayed_startup===
+
<center>
 +
[[File:discoverysap2.png]]
 +
</center>
  
This parameter allows the Pandora FMS agent to be configured in order to start working after any specific amount of time (in seconds) after manual execution. It's deactivated by default. This option is only valid on Linux/Unix agents.
+
In the example above, servers sapsample.artica.lan, sap2.artica.lan and 10.0.30.33 use the same client, system and credential configuration, so they can be grouped in the same task.  
  
===pandora_nice===
+
{{Warning|If you need to monitor different configurations, create a task for each configuration.}}
  
This parameter allows to specify the priority that the Pandora FMS agent process will have within the system. It's only available for Unix / Linux agents.
+
Select from the list the information about the SAP system you wish to retrieve as shown below:
  
===autotime===
+
<center>
 +
[[File:discoverysap3.png]]
 +
</center>
  
If it's enabled ('1') it sends a timestamp of special execution (AUTO) that makes the server use its local date / time to establish the data time, not paying attention to the time sent by the agent. This is necessary in agents which have a wrong time or a different hour from the server for any reason.
+
Pandora FMS Discovery will be in charge of collecting information, storing it in agents represented by the defined ¨SAP Hostnames¨.  
  
===cron_mode===
 
  
With this parameter, it's possible to make the agents using the Linux crontab functions to execute itself in a predetermined interval instead of using the agents internal system to execute itself at a certain time. It's deactivated by default.
+
=== SAP Discovery connector manual installation ===
  
===remote_config===
+
If your Pandora FMS version was installed before the NG741 version, download the connector and configure it manually.
  
(Pandora FMS Enterprise only)
+
First, install JAVA (JRE) on Pandora FMS server for Discovery SAP operation.
  
Enables (1) or disables (0) remote agent configuration. Operation is only allowed with Tentacle transfer mode.
+
Then you need to download the remote connector/plugin for Linux from SAP, download it from [https://pandorafms.com/library/sap-r3-monitoring-agent/ our library].  
  
===xml_buffer===
+
Configure your pandora_server.conf too, and set the following parameters:
If enabled (1), the agent will save in its temporary directory the XML files that it could not send to the server in case of a connectivity problem. They will be sent when communications are restored.
 
  
===timezone_offset===
+
# Discovery SAP
 +
java /usr/bin/java
 +
 +
# Discovery SAP utils
 +
sap_utils /usr/share/pandora_server/util/recon_scripts/SAP
  
The agent can now install its timezone offset with the server. This allows the server to make a scrolling of the time collected by the agent, so that it matches the local time of the server.
+
In the directory indicated, with the configuration token ''sap_utils'' decompress the files that you will find in the tarball downloaded from the library called "Pandora FMS SAP Discovery for Linux" that contains the following files:
  
  # Timezone offset: Difference with the server timezone
+
  Deset_SAP_Plugin.jar
  timezone_offset 3
+
  dev_jco_rfc.trc
 +
libsapjco3.so
 +
sapjco3.dll
 +
sapjco3.jar
  
It is calculated by subtracting the agent's timezone from the server's timezone. For example, if the server's timezone is UTC+1 and the agent's timezone is UTC-5, the timezone offset should be 6 = 1 - (-5).
+
Once the configuration file is modified, restart the Pandora FMS server.
  
===parent_agent_name===
+
=== SAP View ===
 +
<br>
 +
You can see the general state of the SAP system servers in the SAP View.
  
Indicates the parent of the software agent. It must be the name of an existing agent in Pandora FMS.
+
<center>
 +
[[File:discoverysap4.png]]
 +
</center>
  
=== agent_threads <threads> ===
+
This view will display a panel with the available SAP modules of the selected SAP agent.
  
Number of threads the agent is going to launch to execute modules simultaneously.By default, the modules are executed one after the other without launching any additional thread. This is only available in Linux/Unix agents.
+
You may select the refresh time and the interval to show in the graphs.  
 +
<br>
 +
<br>
  
# Number of threads to execute modules in parallel
+
=== SAP agent view ===
agent_threads 4
+
<br>
 +
The SAP view is also integrated as a new tab within the agent view. If the system detects that the agent is a SAP agent, an access to the SAP View tab will be displayed:
  
===include <filename> ===
+
<center>
 +
[[File:discoverysap5.png]]
 +
</center>
  
This file can contain additional modules and collections alongside the ones found in the main configuration file. This token is optional. El fichero lo podrán subir aquellos usuarios que tengan permisos de, al menos, escritura sobre agentes(AW).
+
The agent view will provide an overview of the status of the SAP modules for the current agent:
  
===broker_agent <name>===
+
<center>
 +
[[File:discoverysap6.png]]
 +
</center>
  
Enables broker agent functionality. To activate it, you only need to uncomment the parameter and indicate the name that will be assigned to the broker agent:
+
<br>
  
broker_agent Name_broker
+
{{Warning|Java must be installed within the server for SAP integration to work.}}
  
===pandora_user <user>===
+
== Discovery Applications: VMware ==
  
This parameter is optional and allows the agent to be executed with a specified system user. This user has to have permissions to execute the agent and all associated resources.
+
{{Warning|In case of manual installation or update from a '''Pandora FMS''' version prior to '''732''', it is necessary to install '''SDK''' for VMWare to work properly.}}
  
===(>= 5.X) custom_id===
+
From Pandora FMS 7.0-733 version on, VMware infrastructures can be monitored using Discovery Applications.  
  
Custom ID of the agent for external applications.
 
  
===(>= 5.X) url_address===
+
<center>
 +
[[File:discoveryapplications2.png]]
 +
</center>
  
Custom URL to open it from the agent in the console.
 
  
===(>= 5.X) custom_fieldX_name===
+
The following must be specified:
  
Name of an agent custom field which already exists on the system. If doesn't exist, it will be ignored.
+
* A name to identify the task.
 +
* A Discovery server where to run it.
 +
* A group to which the agents generated by the VMware task will be associated.
  
Example:
+
{{Tip|It must be taken into account that if the Pandora FMS server has the '' autocreate_group '' token active, priority will be given to the group corresponding to the indicated ID, instead of applying the configuration of the wizard.}}
  
custom_field1_name Model
 
  
===(>= 5.X) custom_fieldX_value===
+
The data required to monitor VMware are:
  
Value for the custom field X defined in the previous parameter.
+
* V-Center IP
 +
* The name of the datacenter (it can be seen through VMware installation management screen).
 +
* User with read permissions.
 +
* User password.
 +
* Monitoring interval.
  
Example:
+
Password encryption can be enabled by pressing the button '''encrypt passwords'''. This only applies to the wizard in progress.
  
custom_field1_value C1700
 
  
=== (> 5.1 Unix agent only) macro<macro> <value> ===
+
On the next page, VMware monitoring details can be specified:
  
Defines a local execution macro that can be used in the definition of a module. These macros are used in the meta console system and local module components system to "abstract" the difficulty of using a module by directly editing the code, presenting  a local interface that allows to "fill in" values to a less advanced user. These values are used below, using a macros system, relatively similar to the macros system of the local plugins.
+
<center>
 +
[[File:discoveryapplications3.png]]
 +
</center>
  
Example:
+
* Max threads: Choose the number of threads that the VMware monitoring script will use to speed up data collection.
 +
* Retry send: The information of the detected agents is sent by XML to the DataServer. This option must be activated to retry sending in case of error.
 +
* Event mode: '''Only for VCenter'''. VMware VCenter event-based monitoring is enabled. This working mode is exclusive and independent from standard monitoring.
 +
* Virtual network monitoring: It enables monitoring of virtual network devices which are defined in VMware.
 +
* Extra settings: Any advanced settings needed to customize VMware monitoring should be included here in text mode. For more information, visit [https://pandorafms.com/docs/index.php?title=Pandora:Documentation_en:Virtual_environment_monitoring#Entity_renaming this section].
 +
<br>
 +
<br>
 +
<br>
 +
<br>
  
<pre>
+
==Discovery Applications: MS SQL==
module_begin
+
<br>
module_name FreeDisk_opt
+
This new Pandora FMS integration allows monitoring Microsoft SQL server databases.
module_type generic_data
 
module_exec df -kh _field1_ | tail -1 |  awk '{ print $5}' | tr -d "%"
 
module_macro_field1_ /opt
 
module_end
 
</pre>
 
  
=== (>= 6.0SP5) group_password <password> ===
+
Microsoft <b>ODBC</b> must be installed in the system where Pandora FMS server is running.  
 +
<br>
 +
<br>
 +
{{Tip|From version 745 onwards, ODBC is preinstalled in Pandora FMS ISO.}}
  
Password for the agent group. Leave it commented if the group is not password protected.
+
=== How to install Microsoft ODBC ===
  
=== (>= 7.0) ehorus_conf <path> ===
+
* In <b>CentOS 6</b>:
  
Absolute path to a valid [https://ehorus.com/ eHorus] agent configuration file. The agent will create a custom field named ''eHorusID'' that contains the eHorus agent's identifying key.
+
curl https://packages.microsoft.com/config/rhel/6/prod.repo > /etc/yum.repos.d/mssql-release.repo && \
 +
yum remove unixODBC-utf16 unixODBC-utf16-devel && \
 +
ACCEPT_EULA=Y yum install -y msodbcsql17
  
=== (>= 7.0OUM713) transfer_mode_user <user> ===
+
* In <b>CentOS 7</b>:
  
User of files copied in the local transfer mode. In console folders, this user must have reading and writing permissions for the remote configuration to work properly. By default it is ''apache''.
+
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo && \
 +
  yum remove unixODBC-utf16 unixODBC-utf16-devel && \
 +
ACCEPT_EULA=Y yum install -y msodbcsql17
  
=== (>= 7.0OUM721) secondary_groups <secondary groups> ===
+
Once the ODBC is installed, it might be necessary to set which driver Pandora FMS should use. To that end, check Pandora FMS server configuration file.  
  
Name of the secondary groups assigned to the agent. Several secondary groups separated by commas can be specified. If any of the groups does not exist on the server to which the information is sent, that group will not be assigned, but the creation of the agent will not be affected.
+
/etc/pandora/pandora_server.conf
  
=== (>= 7.0OUM728) standby <1|0> ===
+
Once you go to the configuration file, look for the following token:
  
If an agent has standby 1 mode, the agent will not perform any check or send or generate any XML. This configuration directive makes sense in enterprise installations where there is remote configuration. Thanks to it, it is possible to silence an agent at will just by disabling it.
+
mssql_driver IDENTIFYING STRING
  
The debug mode overwrites this functionality and the agent is executed normally.
+
The <b>IDENTIFYING STRING</b> parameter can be found in <b>/etc/odbcinst.ini</b> which will be created when installing ODBC.
  
== Secondary Server ==
+
This is the default string:  
We can define a secondary server to which the data will be sent in two possible situations depending on the configuration:
 
  
* '''on_error''': Send data to the secondary server only in cases it could not send them to the primary one.
+
ODBC Driver 17 for SQL Server
* '''always''': Always send data to the secondary server, no matter if it's able to contact the main server or not.
 
  
Configuration example:
+
=== Configure a Discovery Applications MS SQL task ===
  
secondary_server_ip    192.168.1.123
+
To create a monitoring task for a Microsoft SQL Server database, access through Discovery (Discovery > Applications > Microsoft SQL Server).  
secondary_server_path  /var/spool/pandora/data_in
 
secondary_mode          on_error
 
secondary_transfer_mode tentacle
 
secondary_server_port  41121
 
  
== UDP Server ==
+
Once you choose the Microsoft SQL Server task, you may define the instances in the following way:
  
The Pandora FMS Agent can be configured to listen to remote commands. This server listens to a UDP port spcified by the user and allows orders to be received from a remote system - usually from Pandora FMS' console through the execution of alerts on the server.
+
IP\Instance
  
There are several options to configure the UDP remote server. The default file is ''pandora_agent.conf''
+
If you wish so, define a port like this:
  
* '''udp_server''': To activate the UDP server, set it on '1'. This is deactivated by default.
+
IP:Port\Instance
* '''udp_server_port''': Port where it listens.
 
* '''udp_server_auth_address''': Authorized IP address to send orders. Several Addresses can be set separated by commas. If it is configured with 0.0.0.0, UDP Server will accept orders from all addresses.
 
* '''process_<name>_start <command>''': Command which is going to start a process defined by the user.
 
* '''process_<name>_stop <command>''': Command which is going to stop the process.
 
* '''service_<name> 1''': Allows the service <name> to be started or stopped remotely from the UDP server.
 
  
Configuration Example:
+
<center>
 +
[[File:mssql1.png]]
 +
</center>
  
udp_server 1
 
udp_server_port 4321
 
udp_server_auth_address 192.168.1.23
 
process_firefox_start firefox
 
process_firefox_stop killall firefox
 
service_messenger 1
 
  
The server accepts the following commands:
+
This integration's configuration advanced options include service stability, usage statistics, connection status and custom queries.
  
* '''<START|STOP> SERVICE <name of the service>''': Starting or stopping a service.
+
<center>
* '''<START|STOP> PROCESS <name of the process>''': Starting or stopping a process.
+
[[File:mssql3.png]]
* '''REFRESH AGENT <name of the agent>''': Forces one execution of the agent and refreshes data.
+
</center>
  
In 5.0 version, Unix agent only implements REFRESH AGENT command.
+
If you wish to execute any custom query, keep in mind they follow the same format as those of Oracle.
  
For example:
+
=Discovery Cloud=
  
  STOP SERVICE messenger
+
Discovery Cloud allows you to monitor structures in the AWS cloud. Thanks to Pandora FMS, you can manage many Amazon Web Services accounts as well as Microsoft Azure's, concentrating information management in a single tool.  
START PROCESS firefox
 
REFRESH AGENT 007
 
  
There is a script on the server at ''/util/udp_client.pl'' which is used by the Pandora FMS Server as a command of an alert to start processes or services. It has this syntax:
+
<center>
 +
[[File:azure66.JPG]]
 +
</center>
  
./udp_client.pl <address> <port> <command>
+
Account management, both from AWS and Microsoft Azure, will be made through the <b>Credential Store</b> located in Profiles -> Manage agent groups -> Credential Store.
  
E.g. to restart an agent:
+
<center>
 +
[[File:credential_store.png]]
 +
</center>
  
./udp_client.pl 192.168.50.30 41122 "REFRESH AGENT"
+
==Discovery Cloud: Amazon Web Services (AWS)==
  
For more information, please go to the Alert Configuration section.
+
{{Warning|This section is under construction.}}
  
== Modules definition ==
+
To monitor an infrastructure in Amazon Web Services, follow the different pages of the wizard step by step.
  
The local execution modules are defined in the configuration file pandora_agent. conf. Below we explain all the parameters that can be accepted.
 
  
The general syntax is the following:
+
=== AWS. Credential validation ===
  
module_begin
 
module_name <Module Name>
 
module_type generic_data
 
module_exec <local command to execute>
 
module_end
 
  
There are different kinds of modules,; in this example we have only used the common and mandatory lines for most of them.
+
Pandora FMS allows managing several AWS accounts. Once you have accessed the Amazon Web Services menu, the navigation will be automatically redirected to the window to select the account with which you need to access the service. If there is a previously created account in previous versions of Pandora FMS, it will be shown as "imported_aws_account".  
  
=== Common elements of all modules  ===
+
<center>
 +
[[File:AWSCredentials1.JPG]]
 +
</center>
  
{{warning|Module fields (except module data, description and extended info) are only stored on module creation and will never be updated if the module is already created. }}
+
You can add as many accounts as necessary through the "Manage Accounts" option next to the AWS Account drop-down.
  
==== module_begin ====
+
This will allow access to the "Credential store" section of Profiles> Manage agent groups and it will act as the store of all the Amazon Web Services accounts previously created to be registered.  
Defines the beginning of the module (compulsory).
 
  
==== module_name <name> ====
+
<center>
 +
[[File:AWS4.png]]
 +
</center>
  
Name of the module (compulsory). This name CANNOT be duplicated.
+
<center>
 +
[[File:AWS5.png]]
 +
</center>
  
==== module_type ====
+
Query accounts in Amazon AWS must be created with the following permissions:
  
Type of data the module will return. It is compulsory to choose one of these. The available types are:
+
<center>
 +
[[File:awsgrants.png]]
 +
</center>
  
* '''Numerical''' (generic_data). Simple numerical data, in floating points or wholes.
+
* Billing (read)
 +
* CloudWatch (list,read)
 +
* Cost Explorer Service (Full access)
 +
* EC2 (full read, limited: list)
  
* '''Incremental''' (generic_data_inc). Numeric data equal to the difference between the current value and the previous one divided by the elapsed time in seconds. When this difference is negative, the value is reset, which means that when the difference becomes positive again, the previous value will be taken as long as the increment returns to a positive value.
 
  
* '''Absolute incremental''' (generic_data_inc_abs). Numeric data equal to the difference between the current value and the previous one, with no division made, so the value is the total difference or increment, and not the increment per second. When this difference is negative, the value is reset, this means that at the time when the difference is again a positive value, the base value used to make this calculation is the last one from which the incremental value is positive.
+
Summary of the policy in JSON:
  
* '''Alphanumeric''' (generic_data_string). Collects alphanumeric text strings.
+
{
 +
    "Version": "2012-10-17",
 +
    "Statement": [
 +
        {
 +
            "Sid": "VisualEditor0",
 +
            "Effect": "Allow",
 +
            "Action": [
 +
                "ec2:DescribeInstances",
 +
                "ec2:DescribeVolumesModifications",
 +
                "ec2:GetHostReservationPurchasePreview",
 +
                "ec2:DescribeSnapshots",
 +
                "aws-portal:ViewUsage",
 +
                "ec2:DescribePlacementGroups",
 +
                "ec2:GetConsoleScreenshot",
 +
                "ec2:DescribeHostReservationOfferings",
 +
                "ec2:DescribeInternetGateways",
 +
                "ec2:GetLaunchTemplateData",
 +
                "ec2:DescribeVolumeStatus",
 +
                "ec2:DescribeScheduledInstanceAvailability",
 +
                "ec2:DescribeSpotDatafeedSubscription",
 +
                "ec2:DescribeVolumes",
 +
                "ec2:DescribeFpgaImageAttribute",
 +
                "ec2:DescribeExportTasks",
 +
                "ec2:DescribeAccountAttributes",
 +
                "aws-portal:ViewBilling",
 +
                "ec2:DescribeNetworkInterfacePermissions",
 +
                "ec2:DescribeReservedInstances",
 +
                "ec2:DescribeKeyPairs",
 +
                "ec2:DescribeNetworkAcls",
 +
                "ec2:DescribeRouteTables",
 +
                "ec2:DescribeReservedInstancesListings",
 +
                "ec2:DescribeEgressOnlyInternetGateways",
 +
                "ec2:DescribeSpotFleetRequestHistory",
 +
                "ec2:DescribeLaunchTemplates",
 +
                "ec2:DescribeVpcClassicLinkDnsSupport",
 +
                "ec2:DescribeVpnConnections",
 +
                "ec2:DescribeSnapshotAttribute",
 +
                "ec2:DescribeVpcPeeringConnections",
 +
                "ec2:DescribeReservedInstancesOfferings",
 +
                "ec2:DescribeIdFormat",
 +
                "ec2:DescribeVpcEndpointServiceConfigurations",
 +
                "ec2:DescribePrefixLists",
 +
                "cloudwatch:GetMetricStatistics",
 +
                "ec2:GetReservedInstancesExchangeQuote",
 +
                "ec2:DescribeVolumeAttribute",
 +
                "ec2:DescribeInstanceCreditSpecifications",
 +
                "ec2:DescribeVpcClassicLink",
 +
                "ec2:DescribeImportSnapshotTasks",
 +
                "ec2:DescribeVpcEndpointServicePermissions",
 +
                "ec2:GetPasswordData",
 +
                "ec2:DescribeScheduledInstances",
 +
                "ec2:DescribeImageAttribute",
 +
                "ec2:DescribeVpcEndpoints",
 +
                "ec2:DescribeReservedInstancesModifications",
 +
                "ec2:DescribeElasticGpus",
 +
                "ec2:DescribeSubnets",
 +
                "ec2:DescribeVpnGateways",
 +
                "ec2:DescribeMovingAddresses",
 +
                "ec2:DescribeAddresses",
 +
                "ec2:DescribeInstanceAttribute",
 +
                "ec2:DescribeRegions",
 +
                "ec2:DescribeFlowLogs",
 +
                "ec2:DescribeDhcpOptions",
 +
                "ec2:DescribeVpcEndpointServices",
 +
                "ce:GetCostAndUsage",
 +
                "ec2:DescribeSpotInstanceRequests",
 +
                "cloudwatch:ListMetrics",
 +
                "ec2:DescribeVpcAttribute",
 +
                "ec2:GetConsoleOutput",
 +
                "ec2:DescribeSpotPriceHistory",
 +
                "ce:GetReservationUtilization",
 +
                "ec2:DescribeNetworkInterfaces",
 +
                "ec2:DescribeAvailabilityZones",
 +
                "ec2:DescribeNetworkInterfaceAttribute",
 +
                "ce:GetDimensionValues",
 +
                "ec2:DescribeVpcEndpointConnections",
 +
                "ec2:DescribeInstanceStatus",
 +
                "ec2:DescribeHostReservations",
 +
                "ec2:DescribeIamInstanceProfileAssociations",
 +
                "ec2:DescribeTags",
 +
                "ec2:DescribeLaunchTemplateVersions",
 +
                "ec2:DescribeBundleTasks",
 +
                "ec2:DescribeIdentityIdFormat",
 +
                "ec2:DescribeImportImageTasks",
 +
                "ec2:DescribeClassicLinkInstances",
 +
                "ec2:DescribeNatGateways",
 +
                "ec2:DescribeCustomerGateways",
 +
                "ec2:DescribeVpcEndpointConnectionNotifications",
 +
                "ec2:DescribeSecurityGroups",
 +
                "ec2:DescribeSpotFleetRequests",
 +
                "ec2:DescribeHosts",
 +
                "ec2:DescribeImages",
 +
                "ec2:DescribeFpgaImages",
 +
                "ec2:DescribeSpotFleetInstances",
 +
                "ec2:DescribeSecurityGroupReferences",
 +
                "ec2:DescribeVpcs",
 +
                "ec2:DescribeConversionTasks",
 +
                "ec2:DescribeStaleSecurityGroups",
 +
                "ce:GetTags"
 +
            ],
 +
            "Resource": "*"
 +
        }
 +
    ]
 +
}
  
* '''Booleans''' (generic_proc). For values that can only be correct/affirmative (1) or incorrect/negative (0). Useful to check if a computer is alive, or a process/service is running. A negative value (0) has the critical status preassigned, while any higher value is considered correct.
 
  
* '''Asynchronous Alphanumeric''' (async_string). For asynchronous text strings. Asynchronous monitoring depends on events or changes that may or may not occur, so these types of modules are never in unknown status.
+
Assign the policy to a new user.
  
* '''Asynchronous Boolean''' (async_proc). Similar to 'generic_proc' but asynchronous.  
+
<center>
 +
[[File:awsgrants2.png]]
 +
</center>
  
* '''Asynchronous Numerical''' (async_data). Similar to 'generic_data' but asynchronous.
 
  
==== module_min <value> ====
+
Back in Pandora FMS, the registered account can be used to link it and be able to access AWS monitoring.
 +
<br>
 +
{{Tip|If pandora-cm-api is not available in the installation, it can be obtained from the following link: [https://pandorafms.com/library/pandora-cloud-monitoring-api/]}}
  
Minimum value that the module must return to be accepted. Otherwise it will be discarded and will not be displayed on the console.
 
  
==== module_max <value> ====
+
===Discovery Cloud. AWS===
  
Maximum value that the module must return to be accepted. Otherwise it will be discarded and will not be displayed on the console.
+
Once the credentials have been validated, access the <i>Discovery Cloud</i> menu <i>=> Amazon Web Services</i>
  
==== module_min_warning <value> ====
+
<center>
 +
[[File:AWS6.png]]
 +
</center>
  
This is the minimum value that will make the module go into 'warning' status.  
+
In this section, Amazon EC2 and Amazon RDS are found. For each account added to the "Credential store", the EC2 environment hosted in that account can be monitored.
 +
<br>
 +
{{Tip|Only one recognition task per AWS account can be active. The account will be the same for all monitored technologies within the provider.}}
  
==== module_max_warning <value> ====
+
===Discovery Cloud. AWS.EC2===
  
This is the maximum value that will make the module go into 'warning' status.
+
Within EC2 monitoring you can find:
  
==== module_min_critical <value> ====
+
* Expense monitoring.
 +
* Summary of resources registered in AWS.EC2.
 +
* Specific instance monitoring.
 +
* Volume and elastic IP address monitoring.
  
This is the minimum value that will make the module go into 'critical' status.
+
To start the monitoring process, a series of basic data is requested:
  
==== module_max_critical <value> ====
+
<center>
 +
[[File:cloud3.png]]
 +
</center>
  
This is the maximum value that will make the module go into 'critical' status.  
+
It is required to provide a name for the task, indicate the Discovery server from where it will be executed and the monitoring interval.
  
==== module_disabled <value> ====
+
====Discovery Cloud AWS.EC2 Costs====
  
Indicates if the module is enabled ('0') or disabled ('1').
+
When clicking next, you will start configuring AWS monitoring expenses:
  
==== module_min_ff_event <value> ====
+
{{warning|Amazon Web Services expense monitoring involves extra expenses. You can find more information about it in the following link [https://aws.amazon.com/aws-cost-management/pricing/|Amazon cost managementpricing]}}
  
''Flip flop'' protection value for false positives. The number of status changes indicated in this value will be necessary for the module to visually modify its status in the web console.
+
Expense monitoring provides a separate monitoring interval to avoid extra charges.
  
==== (>= 6.0 SP4) module_each_ff <value> ====
+
<center>
 +
[[File:cloud4.png]]
 +
</center>
  
If enabled (1),  ''flip flop'' thresholds per status will be used (module_min_ff_event_normal, module_min_ff_event_warning and module_min_ff_event_critical). Set to 0 to disable.
+
Both the overall cost and the independent cost per region can be monitored.
  
==== (>= 6.0 SP4) module_min_ff_event_normal <value> ====
+
====Discovery Cloud AWS.EC2 Summary====
  
''Flip flop'' protection value for switching to normal status.
+
The Discovery task can be configured to collect general information on the stock status in all regions.
  
==== (>= 6.0 SP4) module_min_ff_event_warning <value> ====
+
To enable it, the ''Scan and general monitoring'' option must be activated.
  
''Flip flop'' protection value for switching to warning status.
+
<center>
 +
[[File:cloud5.png]]
 +
</center>
  
==== (>= 6.0 SP4) module_min_ff_event_critical <value> ====
+
Generic CPU usage counters can be added, as well as output (disk) input operations or volume of disk and network transferred data (bytes).
  
''Flip flop'' protection value for switching to critical status.
 
  
==== (>= 6.0 SP4) module_ff_timeout <seconds> ====
 
  
Resets the ''flip flop'' threshold counter after the given number of seconds. This implies that the number of status changes determined in ''module_min_ff_event'' must occur at an interval ''module_ff_timeout'' seconds before the state changes in the console's visual level.
+
==== Discovery Cloud AWS.EC2 Specific Instance Monitoring ====
  
==== (>= 734) Keep counters <seconds> ====
+
Specific instances can be monitored to obtain readings of:
  
This is an advanced option of the Flip Flop to control the status of a module. By means of "keep counters" we will establish some counter values to pass from one status to another depending, instead of the value, on the status of the module with the received value.
+
* CPUUtilization: Average CPU usage
 +
* DiskReadBytes: Reading bytes (disk)
 +
* DiskWriteBytes: Writing bytes (disk)
 +
* DiskReadOps: Read operations (disk)
 +
* DiskWriteOps: Writing operations (disk)
 +
* NetworkPacketsIn: Input packets (network)
 +
* NetworkPacketsOut: Output packets (network)
  
==== module_description <text> ====
+
The agents that represent the specific instances will have as their parent the agent that represents the region where they are hosted.
  
Free text with information about the module.
+
It must be verified that the ''update_parent'' token is configured to 1 in the Pandora FMS server configuration to keep the parent-child relationships updated.
  
==== module_interval <factor> ====
+
Navigation must be carried out through the browser by selecting the instances that need to be monitored:
  
This interval is calculated as a multiplier for the agent interval. If the agent has e.g. an interval 300 (5 minutes) but you want a module which is going to get processed every 15 minutes only;  so you should add this line: module_interval 3. This module will be processed every 300sec x 3 = 900sec (15 minutes).
+
<center>
 +
[[File:cloud6.png]]
 +
</center>
  
==== module_timeout <secs> ====
+
====Discovery Cloud AWS.EC2 Extras====
  
In seconds, maximum time allowed for the execution of the module. If this time is exceeded before the end of its execution, it will be interrupted.
+
In this last screen you can indicate whether you want to monitor the volumes used by the reserved instances.
  
==== module_postprocess <factor> ====
+
Two extra modules will appear in the region agents:
  
Numerical value by which the data returned by the module will be multiplied. It is useful for unit conversions.
+
* Total reserved volume (GB)
 +
* Total registered volumes (number)
  
==== module_save <variable name> ====
 
  
Stores the value returned by the module in a variable with the name indicated in this parameter. This value can be used later in other modules.
+
You can also choose to activate the ''Elastic IP addresses'' token. The number of elastic IPs registered in the AWS.EC2 account will be reported.
  
For example:
+
<center>
 +
[[File:cloud7.png]]
 +
</center>
  
module_begin
 
module_name echo_1
 
module_type generic_data
 
module_exec echo 41121
 
module_save ECHO_1
 
module_end
 
  
It will store the value"41121" in the "ECHO_1" variable.
+
Once the wizard is completed, the progress of the execution in ''Discovery Task list'' can be seen:
  
module_begin
+
<center>
module_name echo_2
+
[[File:tasklist1.png]]
module_type generic_data
+
</center>
module_exec echo $ECHO_1
 
module_end
 
  
This second module will show the contents of the variable "$ECHO_1", it being "41121".
+
===Discovery Cloud. AWS.RDS ===
  
In Windows agents the module would have to be formed with %var% instead of $var.  
+
AWS RDS allows you to monitor relational databases provided by Amazon Web Services.  
Following the example:
 
  
module_begin
+
The RDS service provides a database server and allows creating the instance related to said database. In addition, RDS offers the possibility to connect to its instances through clients such as SSMS, MySQL workbench or through JDBC or ODBC DB APIs.
module_name echo_2
 
module_type generic_data
 
module_exec echo %ECHO_1%
 
module_end
 
  
==== module_crontab <minute> <hour> <day> <month> <day of the week> ====
+
<center>
 +
[[File:AWS8.JPG]]
 +
</center>
  
From version 3.2, it's possible to schedule modules in the order they'll be executed on a specific date.
+
Through Pandora FMS, different RDS instances can be monitored by filling in the parameters included in the menu shown at the top.
To do this, you're required to define the '''module_crontab'''', using a similar format to that of the crontab file: (http://es.wikipedia.org/wiki/Cron_(Unix)#Sintaxis)
 
  
module_crontab <minute> <hour> <day> <month> <day of the week>
+
AWS RDS integration with Pandora FMS allows to monitor both the data source and their availablity.
  
Being:
+
In addition, the database running under RDS can be monitored retrieving all the metrics that could be monitored in a database as usual.
  
* Minute 0-59
+
{{Warning|Integration with AWS RDS only supports <b>Oracle</b>, <b>MySQL</b> and <b>Mariadb</b>.}}
* Hour 0-23
 
* Day of the month 1-31
 
* Month 1-12
 
* Day of the week  0-6 (0 is Sunday)
 
  
It's also possible to specify intervals using the '''-''' character as a divider.
+
===Discovery Cloud. Overview===
  
In order for one module to be executed e.g. every Monday between 12 and 15, we could use the following configuration:
+
Discovery Cloud includes an overview where the key points of the infrastructure in Amazon Web Services can be reviewed. Pandora FMS allows displaying different maps based on existing accounts.  
  
module_begin
+
In the AWS view, the account from which you wish to display the information can be selected:
module_name crontab_test
 
module_type generic_data
 
module_exec script.sh
 
module_crontab * 12-15 * * 1
 
module_end
 
  
To execute a command every hour, in an hour and 10 minutes:
+
<center>
 +
[[File:AWS9.JPG]]
 +
</center>
  
module_begin
+
It includes:
module_name crontab_test3
 
module_type generic_data
 
module_exec script.sh
 
module_crontab 10 * * * *
 
module_end
 
  
==== module_condition <operation> <command> ====
+
* Current expenses
 +
* Previous expenses
 +
* Expense evolution chart (6 months)
 +
* Reserve / instance evolution chart (1 month)
 +
* Map of regions with the number of instances per region.
  
From version 3.2, it's possible to define commands that will be executed if the module returns some specific values. It's necessary to specify one of the following options:
+
<center>
 +
[[File:awsview.png]]
 +
</center>
  
* '''>''' [value]: Executes the command if the module value is higher than the given one.
+
==Discovery Cloud: Microsoft Azure==
 +
<br>
 +
To monitor an infrastructure in Microsoft Azure, follow these instructions step by step.
 +
<br>
 +
===How to register a user to use the Azure API===
  
* '''<''' [valor]: Executes the command if the module value is lower than the given one.
+
* Go to https://portal.azure.com/#home
 +
* Open the "Azure Active Directory" service
  
* '''=''' [valor]: Executes the command if the module value is equal to the given one.
+
<center>
 +
[[File:azure.png]]
 +
</center>
  
* '''!=''' [valor]: Executes the command if the module value is different to the given one.
+
* Go to 'App registrations'> 'New registration'
  
* '''=~''' [regular expression]: Executes the command if the module value coincides with the given regular expression.
+
<center>
 +
[[File:azure2.png]]
 +
</center>
  
* '''('''valor, valor''')''': Executes the command if the module value is ranged between the given values.
 
  
Multiple conditions can be specified for a single module. In the following case,  the ''script_1.sh'' will be executed if the value returned by the module is between 1 and 3, and ''script_2.sh'' will be executed if the value of the module is greater than 5.5, so in this case, being 2.5 the value returned in the ''module_exec'' line , only the first condition ''script_1.sh'' will be executed:
+
* Enter the data.
  
module_begin
+
<center>
module_name condition_test
+
[[File:azure3.png]]
module_type generic_data
+
</center>
module_exec echo 2.5
 
module_condition (1, 3) script_1.sh
 
module_condition > 5.5 script_2.sh
 
module_end
 
  
Examples of possible real cases:
 
  
module_begin
+
* Write down the data "client_id" and "directory".
module_name MyProcess
 
module_type generic_data
 
module_exec tasklist | grep MyProcess | wc -l
 
module_condition > 2 taskkill /IM MyProcess* /F
 
module_end
 
  
module_begin
+
<center>
module_name PandoraLogSize
+
[[File:azure4.png]]
module_type generic_data
+
</center>
module_exec ls -la "c:\Archivos de programa\pandora_agent\pandora_agent.log" | gawk "{ print $5 }"
 
module_condition > 10000 del "c:\Archivos de programa\pandora_agent\pandora_agent.log"
 
module_end
 
  
module_begin
+
* Next, access 'certificates & secrets' and create a new one:
module_name Service_Spooler
 
module_type generic_proc
 
module_service Spooler
 
module_condition = 0 net start Spooler
 
module_end
 
  
*'''NOTE''': On Windows platforms, it's recommended to use '''cmd.exe /c''' to execute the command to ensure it's executed properly. For example:
+
<center>
 +
[[File:azure5.png]]
 +
</center>
  
module_begin
+
{{Warning|Write down the key that is shown, it is the application_secret.}}
module_name condition_test
 
module_type generic_data
 
module_exec echo 5
 
module_condition (2, 8) cmd.exe /c script.bat
 
module_end
 
  
==== module_precondition <operation> <command> ====
+
===Assigning permissions===
  
If the precondition is true, the module is going to run. It's necessary to specify one of the following options:
+
Assign a role to the account that will operate (app). To that effect, access "home" and get into the subscription.  
 
+
<center>
* '''>''' [value]: Executes the command if the module value is higher than the given one.
+
[[File:azure6.png]]
 
+
</center>
* '''<''' [value]: Executes the command if the module value is lower than the given one.
 
 
 
* '''=''' [value]: Executes the command if the module value is equal to the given one.
 
 
 
* '''!=''' [value]: Executes the command if the module value is different to the given one.
 
 
 
* '''=~''' [regular expression]: Executes the command if the module value coincides with the given regular expression.
 
 
 
* '''('''value, value''')''': Executes the command if the module value is ranged between the given values.
 
 
 
In the following example, the module ''monitoring_variable.bat'' will only be executed  if the result of the execution indicated in the precondition is between 2 and 8. In this case, the execution result indicated in the ''module_precondition'' line is 5, a value between 2 and 8, so ''monitoring_variable.bat'' will be executed correctly:
 
 
 
module_begin
 
module_name Precondition_test1
 
module_type generic_data
 
module_precondition (2, 8) echo 5
 
module_exec monitoring_variable.bat
 
module_end
 
 
 
Like postconditions, it's also possible to use several preconditions. The module is only going to be executed if all preconditions are met:
 
 
 
module_begin
 
module_name Precondition_test2
 
module_type generic_data
 
module_precondition (2, 8) echo 5
 
module_precondition < 3 echo 5
 
module_exec monitoring_variable.bat
 
module_end
 
 
 
*'''NOTE''': On Windows platforms, it's recommended to use '''cmd.exe /c''' to execute the command to ensure it's proper execution. For example:
 
 
 
module_begin
 
module_name Precondition_test3
 
module_type generic_data
 
module_precondition (2, 8) cmd.exe /c script.bat
 
module_exec monitoring_variable.bat
 
module_end
 
 
 
==== (>= 5.x) module_unit <value> ====
 
 
 
Units shown next to the value obtained by the module.
 
 
 
Example:
 
 
 
module_unit %
 
 
 
==== (>= 5.x) module_group <value> ====
 
 
 
This is the name of the module group.
 
 
 
Example:
 
 
 
module_group Networking
 
 
 
==== (>= 5.x) module_custom_id <value> ====
 
 
 
This is a custom identifier for the module.
 
 
 
Example:
 
 
 
module_custom_id host101
 
 
 
==== (>= 5.x) module_str_warning <value> ====
 
 
 
This is a regular expression to define the 'warning' status in the string types modules.
 
 
 
Example:
 
 
 
module_str_warning .*NOTICE.*
 
 
 
==== (>= 5.x) module_str_critical <value> ====
 
 
 
This is a regular expression to define the 'critical' status in the string type modules.
 
 
 
Example:
 
 
 
module_str_critical .*CRITICAL.*
 
 
 
==== (>= 5.x) module_warning_instructions <value> ====
 
 
 
These are the instructions to the operator if the module changes to 'warning' status.
 
 
 
Example:
 
 
 
module_warning_instructions Increase incident priority
 
 
 
==== (>= 5.x) module_critical_instructions <value> ====
 
 
 
These are the instructions to the operator if the modules changes to 'critical' status.
 
 
 
Example:
 
 
 
module_critical_instructions Call to sys department
 
 
 
==== (>= 5.x) module_unknown_instructions <value> ====
 
 
 
These are the instructions to the operator if the module changes to 'unknown' status.
 
 
 
Example:
 
 
 
module_unknown_instructions Open incident
 
 
 
==== (>= 5.x) module_tags <value> ====
 
 
 
These are the tags which will be assigned to the module separated by commas.
 
 
 
Example:
 
 
 
module_tags tag1,tag2,tag3
 
 
 
==== (>= 5.x) module_warning_inverse <value> ====
 
 
 
Allows activating (1) the inverse interval for the warning threshold.
 
 
 
Example:
 
 
 
module_critical_inverse 0
 
 
 
==== (>= 5.x) module_critical_inverse <value> ====
 
 
 
Allows activating (1) the inverse interval for the critical threshold.
 
 
 
Example:
 
 
 
module_critical_inverse 1
 
 
 
==== (>= 5.x) module_native_encoding <value> ====
 
(Win32 only)
 
 
 
This configuration token only affects executed modules by command line, that is, there is a module_exec in the module configuration.
 
 
 
Windows manages three encodings for its processes: the command line encoding (OEM), the system encoding (ANSI) and UTF-16. Both encodings are agree on basic characters, but they are different on less common characters, like written accent. With this token, the Pandora's agent transforms the output to the encoding specified in the configuration file (pandora_agent.conf).
 
 
 
module_native_encoding has four acceptable values:
 
* module_native_encoding OEM: to command line encoding
 
* module_native_encoding ANSI: to system encoding
 
* module_native_encoding UTFLE: to UTF-16 little-endian
 
* module_native_encoding UTFBE: to UTF-16 big-endian
 
 
 
If module_native_encoding does not appear, no re-encoding will be done.
 
 
 
==== (>= 5.x) module_quiet <value> ====
 
 
 
If enabled (1) the module will be in silent mode: it will not generate events or trigger alerts, nor will it store data history.
 
 
 
Example:
 
 
 
module_quiet 1
 
 
 
==== (>= 5.x) module_ff_interval <value> ====
 
 
 
This is the ''flip flop'' execution threshold of the module (in seconds).
 
  
Example:
 
  
module_ff_interval 2
+
Within the subscription, select "Access control (IAM)".
  
==== (>= 5.x) module_macro<macro> <value> ====
 
 
Only applicable to local components from the console. It has no utility in the configuration file.
 
 
==== (>= 5.1 SP4) module_alert_template <template_name> ====
 
 
This macro assigns to the module the alert template that corresponds to the name introduced as parameter(see [http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Alerts#Alert_Templates Alert templates])
 
 
Example:
 
 
<module>
 
<name><![CDATA[CPU usage]]></name>
 
<type>generic_data</type>
 
<module_interval>1</module_interval>
 
<min_critical>91</min_critical>
 
<max_critical>100</max_critical>
 
<min_warning>70</min_warning>
 
<max_warning>90</max_warning>
 
<alert_template><![CDATA[Critical condition]]></alert_template>
 
<data><![CDATA[92]]></data>
 
</module>
 
 
==== module_end ====
 
 
Defines the end of the module (compulsory).
 
 
=== Specific guidelines to obtain information ===
 
 
Furthermore, there are the specific guidelines that could be specified for each module in order to '''obtain information'''. Only one kind of them can be used in each module.
 
 
==== module_exec <command> ====
 
 
General command execution line. The desired run must be specified to obtain the information in a single line.
 
 
On Linux, the command will be executed using the default command prompt. Which is the default interpreter will be determined by the symbolic link '''/bin/sh'''. Normally the link points to'' bash'', but in systems like Ubuntu this is not the case (in this case it points to ''dash''). Therefore, it can happen that a command is tested in the terminal and then an error occurs when the agent executes it. A solution that will work in most cases will be to force the bash execution of the command as follows:
 
 
module_exec bash -c "<command>"
 
 
{{Warning|If execution returns a return code different from '0', it will be interpreted as "execution error" and the information will be discarded.}}
 
 
For a Windows agent there are more guidelines for obtaining data, which are described below.
 
 
==== module_service <service> ====
 
 
Checks if a specific service is being executed on the machine. Remember to use the  «" "» characters if the name of the service contains blanks.
 
 
module_begin
 
module_name Service_Dhcp
 
module_type generic_proc
 
module_service Dhcp
 
module_description Service DHCP Client
 
module_end
 
 
The service is identified with the short name of the service (service name), such as it appears in the Windows services manager.
 
 
<center>
 
<center>
[[image:Service_name_id.png]]
+
[[File:azure7.png]]
 
</center>
 
</center>
  
'' Asynchronous Mode ''
+
Add a new role assignment and once there, select the "reader" role for the created app.  
 
 
Pandora FMS usually executes a test battery (each of it defined by a module) every X seconds (300 seg. = 5 min. by default). If a service is down just after an execution of Pandora, it's going to take 300 additional seconds to find out the service went down. The difference on asynchronous mode is that modules immediatly notify Pandora FMS about the fail or shutdown of this service. This is called ''asynchronous'' operation mode. It would be sufficient to add the following command to the guideline to use it:
 
 
 
module_async yes
 
 
 
This feature is not supported on broker agents.
 
 
 
{{Warning|
 
In Windows Home Edition versions, this asynchronous functionality is not supported and, only in those versions, the Pandora agent makes a periodic query to know if the service is running or not. This can be quite resource-intensive so it is recommended to use the synchronous version if a large number of services are being monitored.}}
 
 
 
'' Service Watchdog  ''
 
 
 
There is a watchdog mode for the services, so the agent is able to restart them if they stop. In this case, the restarted service doesn't require any parameter, because Windows already knows how to do it. In such cases, the configuration is a lot easier:
 
 
 
module_begin
 
module_name ServiceSched
 
module_type generic_proc
 
module_service Schedule
 
module_description Service Task scheduler
 
module_async yes
 
module_watchdog yes
 
module_end
 
 
 
'''Unix'''
 
 
 
In Unix,  it works the same as in Windows, the only difference is that for Unix, process and service is the same concept, for example to see if the bash process is active in the system, just run:
 
 
 
module_begin
 
module_name Service_bash
 
module_type generic_proc
 
module_service /bin/bash
 
module_description Process bash running
 
module_end
 
 
 
Watchdog mode and asynchronous detection are not possible in the Unix agent.
 
 
 
==== module_proc <process> ====
 
 
 
Checks if an specific name of process is working in this machine. If the name of the process has blanks ''' do not use «" " '''»; please consider that the name of the process should have the .exe extension. The module is going to return the number of processes executed with this name.
 
 
 
This is an example of the monitoring of the process 'cmd.exe':
 
 
 
module_begin
 
module_name CMDProcess
 
module_type generic_proc
 
module_proc cmd.exe
 
module_description Process Command line
 
module_end
 
 
 
'''UNIX'''
 
 
 
Under UNIX, this module works just like in Windows. It doesn't support asynchronous and/or watchdog mode.
 
 
 
'' Asynchronous mode ''
 
 
 
In a similar way to the services, monitoring processes can be critical in some cases. The Windows agent supports '''asynchronous''' checking for the ''module_proc.'' module now. In this case, the agent '''immediately''' reports it if the process changes its status without  waiting for the agent's execution interval to be reached again. In this way, you're able to get informed about the failure of critical processes almost  instantly. This is an example of asynchronous monitoring of the processes:
 
 
 
module_begin
 
module_name Notepad
 
module_type generic_proc
 
module_proc notepad.exe
 
module_description Notepad
 
module_async yes
 
module_end
 
 
 
The difference is located in the configuration token 'module_async yes'. This feature is not supported on broker agents.
 
 
 
''Processes Watchdog ''
 
 
 
A Watchdog is a system that allows to act immediately if an agent is down, usually raising the process that went down. The Pandora FMS Windows Agent could act as a watchdog when a process is down.
 
 
 
Since executing a process would require some parameters, there are some additional configuration options for these kind of modules. It is important to keep in mind that the ''watchdog'' mode only works if the module type is set to ''asynchronous''. This is an example of configuration of 'module_proc' with 'watchdog' enabled:
 
 
 
module_begin
 
module_name Notepad
 
module_type generic_proc
 
module_proc notepad.exe
 
module_description Notepad
 
module_async yes
 
module_watchdog yes
 
module_start_command c:\windows\notepad.exe
 
module_startdelay 3000
 
module_retrydelay 2000
 
module_retries 5
 
module_end
 
 
 
This is the definition of additional parameters for 'module_proc' with watchdog enabled:
 
 
 
* '''module_retries''': Number of consecutive attempts that the module will try to raise the process before deactivating the watchdog. If the limit is reached, the watchdog mechanism for this module will be deactivated and will never attempt to launch the process again until the agent is restarted. Unlimited by default.
 
 
 
* '''module_startdelay''': Number of milliseconds the module is going to wait before starting the process for the first time.
 
 
 
* '''module_retrydelay''':  Number of milliseconds that the module will wait before trying to launch the process in each retry.
 
 
 
*'''module_user_session''': it vontrols in which session you want the process to be launched. If set to 'no', the process will start in the services session and therefore remain in the background (default setting). Otherwise, if set to 'yes', the process will be launched in the user's session and will be visible from the PC desktop.
 
 
 
{{Warning|For versions prior to Windows Vista, the ''module_user_session'' token can be configured in a general way by enabling  the checkbox "Interactive access with desktop" in the Pandora FMS service properties, as shown in the following screenshot:
 
  
 
<center>
 
<center>
[[image:Service_interactive.png]]
+
[[File:azure8.png]]
</center> }}
+
</center>
  
It's also necessary to understand that Pandora FMS is executed under the "SYSTEM" account if started as a service.  The executed process will do it under that user and with that environment, so that if you want to execute any particular process that requires to be used with a certain user, you will have to include in a script (.bat or similar) the previous processes to initialize the environment, environment variables, etc, and execute that script as a watchdog action.
+
It is important to save the changes by pressing "save".
  
==== module_cpuproc <process> ====
 
  
''(UNIX only)''
+
From that moment onwards, you can connect to the service and make requests through pandora-cm-api.
  
Returns the CPU usage of a specific process.
+
====Examples====
  
module_begin
+
The status of Azure can be checked from Pandora FMS as follows:
module_name myserver_cpu
 
module_type generic_data
 
module_cpuproc myserver
 
module_description Process Command line
 
module_end
 
  
==== module_memproc <process>  ====
+
* Preload the environment.
 +
* Run . load_env.sh
 +
* pandora-cm-api --product Azure --get availability
  
''(Unix only)''
 
  
Returns the memory used by a specific process.
+
If the environment is operational, the system should return a response of 1.  
  
module_begin
+
An example of the contents of the load_env.sh script would be the following:  
module_name myserver_mem
+
<br>
module_type generic_data
+
* Azure
module_memproc myserver
 
module_description Process Command line
 
module_end
 
 
 
==== module_freedisk <unit_letter:>|<volume> ====
 
 
 
This module works under UNIX and Windows. It checks for the free space in the disk unit (don't forget «":"» after the '''unit_letter''' in Windows) or the UNIX volume e.g. '/var'.
 
 
 
 
 
<pre>
 
module_begin
 
module_name freedisk
 
module_type generic_data
 
module_freedisk C:
 
module_end
 
</pre>
 
  
 
<pre>
 
<pre>
module_begin
+
export CLIENT_ID=XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX
module_name disk_var
 
module_type generic_data
 
module_freedisk /var
 
module_end
 
</pre>
 
  
==== module_freepercentdisk <unit_letter:>|<volume> ====
+
export DOMAIN=XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX
  
This module returns the free disk percentage under a Windows unit: (don't forget the ":") or on a Unix system, the volume, like '/var'.
+
export APPLICATION_SECRET="XXXXXXXXXXXXXXXXXXXXXXXXX"
  
<pre>
+
export AZURE_SUBSCRIPTION_ID=XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX
module_begin
 
module_name freepercentdisk
 
module_type generic_data
 
module_freepercentdisk C:
 
module_end
 
 
</pre>
 
</pre>
  
module_begin
+
=== Configure a task in Pandora FMS ===
module_name disk_var
 
module_type generic_data
 
module_freepercentdisk /var
 
module_end
 
  
==== module_occupiedpercentdisk <unit_letter:>|<volume> ====
 
  
(Unix only)
+
Pandora FMS allows managing several Microsoft Azure accounts.
  
This module returns the occupied disk percentage in a UNIX volume e.g. '/var'.
+
You can add as many accounts as needed through the "Manage Accounts" option next to the Account drop-down.
  
module_begin
+
This will allow access to the "Credential store" section of Profiles> Manage agent groups and it will act as the store of all previously created Microsoft Azure accounts to be registered.
module_name disk_var
 
module_type generic_data
 
module_occupiedpercentdisk /var
 
module_end
 
  
==== module_cpuusage <cpu id> ====
+
To configure a new task, follow these steps:
  
This works under UNIX and Windows. It returns the CPU usage in a CPU number. If there is only one CPU, please leave it blank or use 'all'.  
+
* Add a new password to the "credential store".
  
It's also possible to obtain the average use of all CPU in multiprocessor systems this way:
+
<center>
 +
[[File:azure9.png]]
 +
</center>
  
module_begin
 
module_name SystemCPU
 
module_type generic_data
 
module_cpuusage all
 
module_description Average CPU use in systme
 
module_end
 
  
To check the CPU usage in CPU #1:
 
  
module_begin
+
* Access 'Discovery> Cloud> Azure' and validate the Azure account.
module_name SystemCPU_1
 
module_type generic_data
 
module_cpuusage 1
 
module_description Average CPU use in system for CPU #1
 
module_end
 
  
==== module_freememory ====
 
  
Supported in Windows and UNIX. It returns the free memory of the whole system:
+
<center>
 +
[[File:azure10.png]]
 +
</center>
  
module_begin
 
module_name FreeMemory
 
module_type generic_data
 
module_freememory
 
module_description Non-used memory on system
 
module_end
 
  
==== module_freepercentmemory ====
+
<center>
 +
[[File:azure11.png]]
 +
</center>
  
Supported under UNIX and Windows. This module returns the free memory percentage on one system:
 
  
module_begin
+
<center>
module_name freepercentmemory
+
[[File:azure12.png]]
module_type generic_data
+
</center>
module_freepercentmemory
 
module_end
 
  
==== module_tcpcheck ====
 
  
(Windows only)
+
* From that point onwards, it will be necessary to define the name of your recon task, the server that will execute the task, the group it will belong to and the execution interval.
  
This module tries to connect with an IP and a specified port. It returns '1' if successful and '0' if not. It's also recommended to specify a timeout:
+
<center>
 
+
[[File:AzureX3.PNG]]
module_begin
+
</center>
module_name tcpcheck
 
module_type generic_proc
 
module_tcpcheck www.artica.es
 
module_port 80
 
module_timeout 5
 
module_end
 
 
 
==== module_regexp ====
 
 
 
(Windows only)
 
 
 
This module monitors a record file (log) looking for coincidences using regular expressions, ruling out the already existing lines when starting the monitoring. The data returned by the module depend on the module type:
 
 
 
* '''generic_data_string''', '''async_string''': Returns all the lines which fit the regular expression.
 
* '''generic_data''': Returns the number of lines which fit with the regular expression.
 
* '''generic_proc''': Returns '1' if there is a coincidence and '0' if not.
 
* '''module_noseekeof''': With this configuration token active, with a '0' default value in each module execution and independently from any modification of the target file, the module will restart its check process without searching for the file's EOF flag. It will always extract from the XML output all lines that correspond to our search patterns.
 
 
 
module_begin
 
module_name regexp
 
module_type generic_data_string
 
module_regexp C:\WINDOWS\my.log
 
module_pattern ^\[error\].*
 
module_noseekeof 1
 
module_end
 
 
 
To obtain more information about the syntax of regular expressions in general, please visit [http://www.regular-expressions.info/reference.html].
 
 
 
==== module_wmiquery ====
 
 
 
(Windows only)
 
 
 
The WMI modules allow to locally execute any WMI query without the use of an external tool. It's configured through two parameters:
 
 
 
* '''module_wmiquery''': Used WQL query. As a result, several lines could be obtained which will be inserted as several data.
 
  
* '''module_wmicolumn''': Name of the column which is going to be used as a data source.
+
* Once task data are defined, select the Azure account sections that you wish to monitor. Each section will allow in turn to choose the desired instances.  
 
 
For example, we could obtain a list of the installed services:
 
 
 
module_begin
 
module_name Services
 
module_type generic_data_string
 
module_wmiquery Select Name from Win32_Service
 
module_wmicolumn Name
 
module_end
 
 
 
Or the current CPU load:
 
 
 
module_begin
 
module_name CPU_speed
 
module_type generic_data
 
module_wmiquery SELECT LoadPercentage FROM Win32_Processor
 
module_wmicolumn LoadPercentage
 
module_end
 
 
 
==== module_perfcounter ====
 
 
 
(Win32 only)
 
 
 
Obtains data from the performance counter ([http://msdn.microsoft.com/en-us/library/aa373083(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/aa373083(v=vs.85).aspx Performance Counters (Documentación en ingles] Performance Counters Documentation) through the PDH interface (the library '' pdh.dll'' should be installed in the system. PDH.DLL is a Windows library. If you have not installed it yet, you have to install the Windows performance analysis tool (which is usually installed by default).
 
 
 
module_begin
 
module_name perfcounter
 
module_type generic_data
 
module_perfcounter \Memory\Pages/sec
 
module_end
 
 
 
The Windows performance monitor is a powerful tool with hundreds of parameters that can be used for monitoring. In addition, each manufacturer incorporates its own counters.
 
 
 
Performance counters can be observed using the Performance tool:
 
  
 
<center>
 
<center>
[[image:Perfcounter_screen1.png|center|450px]]
+
[[File:AzureX4.PNG]]
 
</center>
 
</center>
  
New performance counters can be added using the system tool. Its configuration has a management structure with elements and sub-elements. In this case ''Processor, % of processor time'' and ''_Total'':
+
* The last step is selecting the metrics you wish to obtain from the agents generated by Pandora FMS for each instance it finds in Microsoft Azure. Once the section is configured, the task can be launched and Pandora FMS will create automatically agents according to the instances required in previous steps.  
  
 
<center>
 
<center>
[[image:Perfcounter_screen2.png]]
+
[[File:AzureX5.PNG]]
 
</center>
 
</center>
  
The configuration of the module for this particular check would be as follows:
+
<br>
  
module_begin
+
=Discovery Console Tasks=
module_name Processor_Time
 
module_type generic_data_inc
 
module_perfcounter \Procesador(_Total)\% de tiempo de procesador
 
module_end
 
  
By default the raw value of the counter is shown, to get the cooked value add the '''module_cooked 1''' parameter:
+
Virtually identical to what was previously seen in Task List, Console Task will allow creating new tasks taking into account the following parameters:  
  
module_begin
+
* Task: The task that will be executed among the following:
module_name Disk_E/S_Seg
+
** Backup Pandora FMS database.
module_type generic_data
+
** Execute custom script.
module_cooked 1
+
** Save custom report to disk.
module_perfcounter \DiscoFísico(_Total)\E/S divididas por seg.
+
** Save custom XML report to disk.
module_end
+
** Send custom report (from template) by email.  
 +
** Send custom report by email.
  
Most of the returned data arejust counters, so you should use 'generic_data_inc' as data type. It's also able to return values in very high data scales (several millions), so you could reduce these values using the module post process with values like '0.000001' or similar.
+
* Scheduled: It is used to specify how often the task will be executed.
 +
* Next execution: It shows the date of the next execution, being able to modify it if necessary.  
 +
* Group: Group to which the task belongs.  
 +
* Parameters: They are the specific parameters of each task.  
  
==== module_inventory DEPRECATED ====
+
<center>
 +
[[File:ConsoleTasks.JPG]]
 +
</center>
  
{{Warning|Currently this functionality has been replaced by inventory from agent plugins on both Windows and Linux/Unix systems.}}
+
==== Parameters of different tasks ====
 +
<br>
 +
;Backup Pandora FMS database:
 +
* Description: Backup description.
 +
* Save to disk in path: path where the backup will be stored.<br><br>
 +
;Execute custom script:
 +
* Custom script: The script to be executed will be indicated.<br><br>
 +
;“Save custom report to disk” and “Save custom XML report to disk”:
 +
* Report pending to be created: The report to be created.
 +
* Save to disk in path: Path where the created report will be stored.<br><br>
 +
;Send custom report (from template) by email:
 +
* Template pending to be created: Custom template to be created.
 +
* Agents: Agents from which the information that will be reflected in the report  will be obtained.
 +
* Report per agent: If you wish to generate separate reports for each report.
 +
* Report name: Name that you want to give the report.
 +
* Send to email addresses: Email addresses the report will be sent to.
 +
* Subject: Topic of the mail to be sent.
 +
* Message: Body of the message which will be sent together with the reports.<br><br>
 +
;Send custom report by email:
 +
* Report pending to be created: Report to be generated.
 +
* Send to email addresses: Email addresses the report will be sent to.
 +
* Subject: Topic of the mail to be sent.
 +
* Message: Body of the message with which the reports will be sent.
 +
* Report Type: Type of report that will be sent.
  
''(Win32 only. In linux/unix is implemented as agent plugin)''
+
=Discovery Host&Devices=
  
Using predefined WMI queries and log searches, this module gathers information about the different aspects of a machine, about software and hardware.
+
The Discovery Host & Devices section offers a multitude of options to help manage and discover devices within as many environments as needed.
  
The module can get different parameters to mark the kind of information it gets. Here is the parameter list and the kind of information that they give:
+
Therefore, it features the following tools:  
  
* '''CPU''': Gets information about the system's CPUs (processor name, clock frequency and description).
+
* Net Scan.
* '''CDROM''': Gets information about the CD-ROM (name, description and unit letter).  
+
* Import CSV.
* '''Video''': Gets information about video cards (description, RAM and processor).
+
* Custom NetScan.
* '''HDs''': Gets information about the hard disks (model, size and name in the system).
+
* Manage NetScan scripts.
* '''NICs''': Gets information about the network interface controllers (description, MAC address and IP address).
 
* '''Patches''': Gets information about the installed patches (identifier, description and comments).
 
* '''Software''': Gets information about MSI packages installed (name and version).
 
* '''RAM''': Gets information about RAM modules (tag, capacity and name).
 
* '''Services''': Gets information about the installed services. The short name shown in the first column is the name of the service that Pandora FMS probably uses to monitor services.
 
  
Additional Module Parameters:
 
  
* '''module_interval''': This module has an additional line to specify the interval ''in days'', where one can obtain the information for the module.
+
<center>
 +
[[File:DISCHost&Devices.JPG|800]]
 +
</center>
  
This is an example to use this module:
+
==NetScan==
  
module_begin
+
With the NetScan tool, you may find devices in a network and apply different monitoring rules.
module_name Inventory
 
module_interval 7
 
module_type generic_data_string
 
module_inventory RAM Patches Software Services
 
module_description Inventory
 
module_end
 
  
==== module_logevent ====
+
First, define the name of the task, the Discovery server that will run it, the group the discovered agents will be assigned to and the scanning interval.
  
(Windows only)
+
In addition, you will have two options when performing the scanning task. You may indicate the networks to be discovered in the field designed to that end in ''Red'' or you may enable the token ''Use CSV file'', that will allow to load a csv file containing the specific devices or network to check throughout the recon task. If the csv file is selected, the Network option will not be enabled.
 
 
Allows obtaining information from the Windows event log based on the indicated patterns, providing the possibility to filter according to the source and event type.
 
 
 
The general format of this module is as follows:
 
 
 
module_begin
 
module_name MyEvent
 
module_type async_string
 
module_logevent
 
module_source <logName>
 
module_eventtype <event_type/level>
 
module_eventcode <event_id>
 
module_application <source>
 
module_pattern <text substring to match>
 
module_description
 
module_end
 
 
 
To avoid showing ducplicated information, only those events which occurred since the last time the agent was executed will be considered.
 
 
 
'module_logevent' accepts the following parameters (all of them are case-sensitive):
 
 
 
* '''module_source''': Event source (System, Application, Security). This field is compulsory.
 
* '''module_eventtype''': Event type (failure, information). This is an optional field.
 
* '''module_pattern''': Pattern to search (substring). It's an optional field.
 
* '''module_eventcode''': It's a numeric ID of the event, e.g. 5112. It's an optional field.
 
* '''module_application''': Application source of the event. Be careful not to mistake it by 'module_source' which shows the name, source or log file where the events are looked for.
 
 
 
For example, to show all events of an error type system we should define the following module:
 
 
 
module_begin
 
module_name log_events
 
module_type generic_data_string
 
module_description System errors
 
module_logevent
 
module_source System
 
module_eventtype error
 
module_end
 
 
 
To show all events which contain the word 'PandoraAgent':
 
 
 
module_begin
 
module_name log_events_pandora
 
module_type async_string
 
module_description PandoraAgent related events
 
module_logevent
 
module_source System
 
module_pattern PandoraAgent
 
module_end
 
 
 
Another example: Filtering the event showed on the snapshot:
 
  
 
<center>
 
<center>
[[Image:Event sample.png|center|450px]]
+
[[File:3oaKq2yukE.png]]
 
</center>
 
</center>
  
module_begin
+
{{Warning|The intervals selected as manuals must be manually launched. '''Discovery will not launch any manual task automatically.'''}}
module_name MyEvent
 
module_type async_string
 
module_source Application
 
module_eventtype Information
 
module_eventcode 6000
 
module_application Winlogon
 
module_pattern unavailable to handle
 
module_description
 
module_end
 
 
 
==== module_logchannel ====
 
(Windows only,  from 7.0OUM715 on)
 
 
 
Type of module that allows you to obtain information about Windows logging channels. Although ''module_logevent'' only has access to Windows Logs, this type of module allows you to extract data from other log files that are configured as channels. In this way, it is possible to obtain the logs included in the  services and application logs.
 
 
 
The general format of this module is as follows:
 
 
 
module_begin
 
module_name MyEvent
 
module_type async_string
 
module_logchannel
 
module_source <logChannel>
 
module_eventtype <event_type/level>
 
module_eventcode <event_id>
 
module_pattern <text substring to match>
 
module_description <description>
 
module_end
 
 
 
To avoid displaying repeated information, only those events that have occurred since the start of the agent are taken into account.
 
 
 
module_logchannel accepts the following parameters (all case-sensitive):
 
  
* '''module_source''': Event channel. With the command '''wevtutil. exe enum-logs''' a list of all the local log channels of the machine is obtained. Required field.
 
* '''module_eventtype''': Event type (''critical'', ''error'', ''warning'', ''info'' or ''verbose''). Optional field
 
* '''module_pattern''': Pattern to search (substring). Optional field.
 
* '''module_eventcode''': Numeric ID of the event, e.g. 5112.Optional field.
 
  
For example, we would define the following module to show all the events of the channel ''Microsoft-Windows-TaskScheduler/Operational'', ''information'' type, with code ''201'' and with log text ''code 0'':
+
In the features section, you may indicate the following options:
 
 
module_begin
 
module_name New logs
 
module_type async_string
 
module_logchannel
 
module_description Successfully completed tasks
 
module_source Microsoft-Windows-TaskScheduler/Operational
 
module_eventtype information
 
module_eventcode 201
 
module_pattern code 0
 
module_end
 
 
 
With this module configuration, the Pandora FMS agent would collect the following log:
 
  
 
<center>
 
<center>
[[Image:Logchannel example.png|center|700px]]
+
[[File:Wvia6RtpOr2.png|800]]
 
</center>
 
</center>
<br>
 
  
==== module_plugin ====
 
  
A parameter to define the data which is obtained at the exit of a plugin agent. It's a special case , since '''it  doesn't require any other delimiter''' like 'module_begin', 'module_type', nor will it need the module type.  
+
* '''Known hardware auto discovery''': It dinamically applies the templates that were previously added to the ''Private Enterprise Number'' section. To learn more, go to the following [https://pandorafms.com/docs/index.php?title=Pandora:Documentation_en:Templates_and_components#Private_Enterprise_Number| link.]
 +
* '''Module templates''': Try to apply the modules from the selected templates. If the execution does not pass the test, they will not be added to the monitoring list.
 +
* '''Check results''': The user must validate the results selecting which agents will be created from those found through the discovery task.
 +
* '''Apply autoconfiguration rules''': It applies the predefined autoconfiguration rules to the detected agents. To learn more, go to the following [https://wiki.pandorafms.com/index.php?title==Pandora:Documentation_en:Configuration_Agents| link.]
  
It just requires this format:
+
{{Tip|Automatic configuration allows you to apply policies, group changes and settings, as well as launch custom events or execute scripts on actions.}}
  
module_plugin plugin_filename parámetro_1 parámetro_2 parámetro_3
+
{{Tip|Agents detected by NetScan are remote agents without a configuration file. You cannot apply local monitoring policies or add configuration changes in block if you do not deploy an agent on the targets.}}
  
However, it can be used between the usual module labels to add additional options such as conditions or interval:
 
  
module_begin
+
* '''SNMP activated''': To complete the information obtained from the discovered network devices, enable SNMP. That improves detection by scanning the SNMP information available in the discovered targets. Once this token is enabled, two more options appear:
module_plugin plugin_filename parameter_1 parameter_2 parameter_3
+
** '''SNMP version''': Select the SNMP version configured in the scanned network devices. It supports SNMP versions 1,2, 2c and 3.
module_interval 2
+
** '''SNMP communities''': Indicate the environment configured community. You may add as many communities as you need by typing them in the following box.
module_condition (0, 1) script.sh
 
module_end
 
  
The parameters to be used will be different for each plugin, so it will be necessary to refer to your particular documentation. We will describe the operation of one of the plugins that comes by default with the Agent, the grep_log plugin to search for matches in a file:
+
* '''WMI enabled''': You may enable WMI scanning. Just select the previously loaded credentials from the [https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Managing_and_Administration#Credential_store| credential store.]
  
module_plugin grep_log /var/log/syslog Syslog ssh
+
{{Tip|The different credentials provided against the detected targets that support WMI will be tested, complementing monitoring with modules that will report about CPU, memory and disk usage.}}
  
In this example, the name of the plugin is 'grep_log' and it's going to search for the regular expression 'ssh' in the file '/var/log/syslog' which will be kept in a module called 'Syslog'.
+
* '''SO detection''': Detect the target's operating system.
  
Another example intended to be solely used on Windows-based systems (and only on versions 3.1 or later):
+
* '''Name resolution''': Solve the target's name.
  
module_plugin cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\df_percent.vbs"
+
* '''Parent detection''': By means of the information collected through SNMP, the different interconnections between devices will be calculated, to be able to represent their network infrastructure.
  
==== module_ping <host> ====
+
* '''Parent recursion''': It improves parent detection, adding recursion to the process.
  
(Only for Windows versions 4.0.1 or newer)
+
* '''VLAN enabled''': It detects the VLAN to which the different devices are connected.
  
This module pings the preset host and returns '1' if it's up and '0' if not.  
+
Once the wizard is finished, Discovery will start executing it in each defined interval. If the interval is manual, the task should be started manually:
  
Is supports the following configuration parameters:
+
<center>
 +
[[File:AFgAv40l9Y.png|800]]
 +
</center>
  
* '''module_ping_count x''': Number of 'ECHO_REQUEST' packets to be sent ('1' by default).
+
Once the task is finished, if you access from Review, you will see a summary of the devices found that respond to ping and the rest of metrics available through SNMP or WMI. All the IPs will be shown, but they may have two status:
* '''module_ping_timeout x''': Timeout in milliseconds to wait for each reply ('1000' by default).
+
* '''Disabled''': There is already an agent or module being monitored in the environoment and it will not be created nor modified.
* '''module_advanced_options''': Advanced options for ''ping.exe''.
+
* '''Enabled''': It is a new non-monitored element, or within the obtained metrics there is a new element that responded and that will be displayed on a drop-down. You may choose to add it to the monitored agent list in devices in this status or add any of the new enabled metrics.
  
Example:
+
<center>
 +
[[File:HK8XAXtv92.png]]
 +
</center>
  
module_begin
+
{{Tip|Once the targets to be monitored are selected, the system will create them systematically. Along the process, the target OS will be detected to complete the information gathered.}}
module_name Ping
 
module_type generic_proc
 
module_ping 192.168.1.1
 
module_ping_count 2
 
module_ping_timeout 500
 
module_end
 
  
==== module_snmpget ====
+
== Automatic agent deployment ==
  
(Windows only)
+
{{Warning|Please confirm '''winexe''' command is installed and working in your server before using this feature. This utility is provided by Pandora FMS Enterprise server installer. You must install '''zlib.i686''' and '''glibc.i686''' to get winexe working.}}
  
This module performs an SNMP get query and returns the requested value.  
+
{{Warning|In <b>Windows</b> environments it is recommended to install as an administrator user. Before starting the service it will be necessary to define an administrator account for its use.}}
  
It supports the following configuration parameters:
 
  
* '''module_snmpversion [1,2c,3]''': SNMP version (1 by default).
+
From Pandora FMS version 737 onwards, it is possible to deploy agents from the console itself using the '''deployment center'''.
* '''module_snmp_community <community>''': SNMP community (''public'' by default).
 
* '''module_snmp_agent <host>''': Target SNMP agent.
 
* '''module_snmp_oid <oid>''': Target OID.
 
* '''module_advanced_options''': Advanced options for ''snmpget.exe''.
 
  
Example:
+
{{Warning|Server version must be EL7 for agent automatic deployment to work.}}
  
module_begin
+
[[File:Depl1.png]]
module_name SNMP get
 
module_type generic_data
 
module_snmpget
 
module_snmpversion 1
 
module_snmp_community public
 
module_snmp_agent 192.168.1.1
 
module_snmp_oid .1.3.6.1.2.1.2.2.1.1.148
 
module_end
 
  
== Automatic agent configuration ==
 
  
Starting from Pandora FMS version 725, you can establish a series of rules for your agents to be configured automatically.
+
The steps to deploy agents from the console are:
  
The agent auto-configuration process works as follows:
+
'''Register the versions of the software agents to be deployed in the agent repository.'''
  
'''1-''' Automatic configurations are prepared in your Pandora FMS Console o Pandora FMS Metaconsole.
+
The installers of the agents to be deployed throughout the infrastructure are needed. You may use custom agents.
  
'''2-''' The agents are installed reporting against your Pandora FMS (if you have a single console, point the agent against your Pandora FMS server, if you have a Metaconsole with the automatic provisioning system configured, set the Metaconsole itself as server).
+
For more information about the use of the '''agent repository''', visit [https://pandorafms.com/docs/index.php?title=Pandora:Documentation_en:Managing_and_Administration#Software_agent_repository this link]
  
'''3-''' Pandora FMS Server will receive a XML (.data) with the agent's data for the first time.
 
  
'''4-''' The rules for determining the automatic configuration to be applied will be evaluated.
+
'''Register the credentials to be used to connect the targets in the credential manager.'''
  
'''5-''' The agent will pick up the new configuration and report in the next cycle with the updated configuration.
+
Specify the credentials with which the accesses to found or specified targets will be tested.
  
 +
For more information about the use of the '''Credential Store''', visit [https://pandorafms.com/docs/index.php?title=Pandora:Documentation_en:Managing_and_Administration#Credential_store this link]
  
You can access the form that manages the automatic settings through:
 
  
<b>Console</b>
+
'''Check that your environment is ready for deployment.'''
Management > Manage automatic agent configuration
 
  
<center>[[Image:autoconf_menu_console.png‎‎]]</center>
+
When visiting the deployment center for the first time, the following notices will be shown:
  
<b>Metaconsole</b>
+
[[File:depl_info1.png]]
Advanced > Agent Management > Automatic Agent Configuration
 
  
<center>[[Image:Autoconf1.png‎‎]]</center>
+
This message points out that objectives for deployment have not been defined yet.
  
Once you access the administration page you can create new automatic configurations by pressing the "Create automatic configuration" button.
 
  
You will need to choose a name and description for its automatic configuration.
+
[[File:Depl_info2.png]]
  
 +
These messages indicate:
  
<center>[[Image:Autoconf_new.png‎‎]]</center>
+
The first message indicates that the ''public_url'' public access URL must be configured so that the targets can get connected to the console and be configured.
  
 +
{{Warning|This system does not perform PUSH operations. All deployments are sent by ''offering'' the software and ordering the target to install it.}}
  
Once the new automatic configuration is created, you can display the configuration forms by clicking on the section you need:
 
  
 +
The second one indicates that no installers have been added to the agent repository. Register installers to deploy the software.
  
<center>[[Image:Autoconf_options.png‎‎]]</center>
 
  
  
=== Rules ===
 
  
To define the agents to which the automatic configuration will be applied, you can add rules to identify them.
+
==== Target Search ====
  
Display the rules section within your automatic configuration, and select "Add new rule".
+
'''Search or point out the targets in the deployment center.'''
  
You can choose a series of options in the rules selector to identify the agents to be configured.
+
Use any of the methods described below to register new targets.
  
<center>[[Image:autoconf_rules1.png||750px‎‎]]</center>
+
You may use any of the following options to define targets:
  
; Server name: Server name match
+
[[File:Depl_action_buttons.png]]
; Group name: Group name match
 
; OS: OS name match (uses regular expressions)
 
; Custom field: Match by key/value based on a custom field reported by the agent. Specify the name of the custom field and the value it should have.
 
; IP range: Match by IP range (network), use IP/mask notation, for example
 
192.168.1.0/24
 
  
; Script output (> 0): Result of the execution of a script, the rule will be evaluated as valid as long as the result in the standard output is greater than 0.
 
  
The rule script call supports the following macros in the field 'arguments':
 
; _agent_ : will be replaced by the agent's name
 
; _agentalias_ : will be replaced by the agent's alias;
 
; _address_ : will be replaced by the principal IP addresss, reported by the agent
 
; _agentgroup_ : will be replaced by the group's nname, reported by the agent
 
; _agentos_ : will be replaced by the agent's OS
 
  
 +
===== Scan one or more networks in pursuit of targets. =====
  
You can choose between <i>AND</i> and <i>OR</i> operators to modify the logic of the rules.
+
By pressing the scan targets button, a pop-up with the following fields will be displayed:
  
<center>[[Image:autoconf_rules2.png||750px‎‎]]</center>
+
[[File:Depl2.png]]
  
  
<b>Note:</b> If you do not add any rules, the automatic configuration will not apply.
+
Firstly indicate:
  
If you need a single configuration for all agents, you can use the following regular expression to match any <i>alias</i>
+
* The network or networks (separated by commas) to scan.
 +
* The Discovery server that will perform the scan.
 +
* The credentials used to try to connect to the discovered targets.
 +
* The software agent version registered as "desired" for the discovered targets.
 +
* The IP of the target server where these software agents will point when they are installed (it corresponds to the "server_ip" field in the agent configuration file).
  
.*
 
  
 +
When pressing 'Scan', you will receive a confirmation, with a link that you can follow to check the progress of this task.
  
 +
[[File:Depl_info3.png]]
  
=== Settings ===
 
  
From this section we will be able to configure:
+
A new entry will appear in the task list:
  
; Agent's group: We can keep it unchanged or force it to be a specific one.
+
[[File:Depl2b.png]]
; Secondary groups: The groups selected here will be added as secondary groups to the agent.
 
; Policies: We can select policies to be applied automatically when the agent reaches the server.
 
; Configuration block: Adds the extra raw configuration to the agent configuration file.
 
  
  
<center>[[File:autoconf_config.png]]</center>
+
{{Tip|Discovery tasks related to agent deployment are '''volatile''' tasks. Once completed, they will be automatically deleted. Information about scan or deployment, both successful and failing, can be consulted from the deployment center itself.}}
  
<b>Note:</b> If you try to access automatic configuration management from a node belonging to a Metaconsole, with centralized management active, the view will be read-only:
 
  
<center>[[File:autoconf_ro.png]]</center>
 
  
 +
As possible targets are found, they will appear in the deployment center:
  
 +
[[File:Depl3.png]]
  
=== Extra Actions ===
 
  
From this section you can associate other actions to the autoconfiguration, for example:
+
{{Tip|The discovered targets added to this list are all found devices whose operating system matches Windows or Linux / Unix based systems, regardless of whether valid credentials were found or not.}}
  
#Launch a personalized event
+
===== Define a target manually. =====
#Execute an alert action
 
#Execute a script
 
  
 +
You may manually register the target by defining:
  
<center>[[File:autoconf_actions.png]]</center>
+
* IP.
 +
* OS. This version only allows Windows and those operating systems based on Linux / Unix (compatible with the tar.gz agent installer).
 +
* Architecture.
 +
* Credentials used to try to connect to the target.
 +
* The agent version you wish to deploy.
 +
* The IP address of the server where that agent will point once installed (it corresponds to the field ''server_ip '' of the software agent configuration).
  
 +
[[File:Depl5.png]]
  
The system supports the following macros:
+
===== Upload a CSV file with target information. =====
; _agent_ : will be replaced by the agent's name
 
; _agentalias_ : will be replaced by the agent's alias;
 
; _address_ : will be replaced by the principal IP addresss, reported by the agent
 
; _agentgroup_ : will be replaced by the group's nname, reported by the agent
 
; _agentos_ : will be replaced by the agent's OS
 
; _agentid_ : will be replaced by the agent's ID
 
  
== UNIX / Linux Agents ==
+
If you wish to mass register targets, upload a CSV file with the following format:
  
=== Pandora FMS UNIX Agents Configuration ===
 
  
The fundamental routes and directories to consider are:
+
IP; OS; Architecture; Target agent version; Credential identifier; Target server ip
  
* '/usr/share/pandora_agent/': where the Pandora FMS agent is installed. In  systems where this isn't possible for reasons like a strict system policy, we recommend creating a link to this path from the real installation path, e.g. '/opt/pandora' -> '/usr/share/pandora_agent'.
 
  
* ''/etc/pandora/pandora_agent.conf'': Main agent configuration folder. The definition of where the data is collected is defined by the used command.
+
[[File:Depl6.png]]
  
* ''/usr/local/bin/pandora_agent'': The current Pandora FMS agent. This file is a shellscript which collects the configuration data in the 'pandora_agent.conf' files and sends the data packages to the Pandora Server. It usually has a link to '/usr/bin/pandora_agent'.
+
The system will create the objectives based on what is defined in the CSV.
  
* ''/usr/local/bin/tentacle_client'': The agent which adds the Tentacle client for being able to send the data files to the server. This is a client written in Perl 5.8. It usually has a link to '/usr/bin/tentacle_client'.
+
==== Deploy the software ====
  
* ''/etc/init.d/pandora_agent_daemon'': Script for starting and stopping. This daemon calls up 'pandora_agent' and gives two options (start / stop). On the AIX systems, the daemon's name is '''/etc/rc.pandora_agent_daemon'''.  
+
{{Warning|You may only schedule deployment against targets whose information is complete, specifying both credentials and software versions to deploy.}}
  
* ''/var/log/pandora/pandora_agent.log'': Text file where the activity of the Pandora FMS agent is kept if the agent is executed in depuration mode.
+
When you have possible targets on the list, launch agent deployment:
  
* ''/etc/pandora/plugins'': Directory which keeps the agent's plugins. It's a link to ''/usr/share/pandora_agent/plugins''.
+
[[File:Depl4.png]]
  
*''/etc/pandora/collections'': Directory containing the collections of the agent. It is linked to the directory ''/usr/share/pandora_agent/collections''.
 
  
=== Initial Execution of a UNIX Agent ===
+
Select the IPs of the targets from the list (only valid targets will appear) and press ''deploy''.
  
To start the agent, simply execute:
+
A Discovery task for background deployment will automatically be created, which will install the agent on the desired targets.
  
/etc/init.d/pandora_agent_daemon start
+
You can confirm that the agent has been successfully installed from the list of objectives of the deployment center:
  
To stop the agent, just execute:
+
[[File:Depl7.png]]
  
/etc/init.d/pandora_agent_daemon stop
 
  
This boot script will be able to start or stop the Pandora FMS agent, which will be running in the system as a daemon by default after started.
+
The name of the target also becomes a link to the corresponding Pandora FMS agent.
  
=== Altering the way UNIX Agents obtain system information ===
 
  
As we saw in the configuration section, there are some modules that obtain the information in a predefined way without having to specify a command with module_exec. These modules are:
+
Failure example: The user not only entered the IP of the target, but also its netmask ('''THE IP IS ENOUGH''').
  
* module_procmem
+
When the system tries to deploy the software, it will notice that the IP format is not correct and will warn the user:
* module_freedisk
 
* module_freepercentdisk
 
* module_cpuproc
 
* module_proc
 
* module_procmem
 
* module_cpuusage
 
* module_freememory
 
* module_freepercentmemory
 
  
It is possible to modify the operation of these modules by directly editing the agent executable (''/usr/bin/pandora_agent'' by default). The Pandora FMS agent is generally located in ''/usr/bin/pandora_agent''. Searching for the string "Commands to retrieve" we get to the code part that contains the internal commands. We can make the modifications we need to adapt them to our system.
+
[[File:Depl_err1.png]]
  
# Commands to retrieve total memory information in kB
+
==Import a list of your devices in CSV==
use constant TOTALMEMORY_CMDS => {
 
linux => 'cat /proc/meminfo  | grep MemTotal: | awk \'{ print $2 }\'',
 
solaris => 'MEM=`prtconf | grep Memory | awk \'{print $3}\'` bash -c \'echo $(( 1024 * $MEM ))\'',
 
hpux => 'swapinfo -t | grep memory | awk \'{print $2}\''
 
};
 
  
# Commands to retrieve partition information in kB
+
A list of devices can be imported to represent them as agents using the agent import wizard through CSV.
use constant PART_CMDS => {
 
# total, available, mount point
 
linux => 'df -P | awk \'NR > 1 {print $2, $4, $6}\'',
 
solaris => 'df -k | awk \'NR > 1 {print $2, $4, $6}\'',
 
hpux => 'df -P | awk \'NR > 1 {print $2, $4, $6}\'',
 
aix => 'df -kP | awk \'NR > 1 {print $2, $4, $6}\''
 
};
 
  
To change any of the predefined values to get the information, just edit the command but be careful with the following:
+
{{Tip|This feature only creates agents in Pandora FMS for its remote monitoring.}}
  
# Check that lines end with ";"
 
# Check that commands are between ' ' symbols.
 
# Check that any ' symbol you use ends on the \ symbol, e.g.:
 
  
df -P | awk 'NR > 1 {print $2, $4, $6}'
+
<center>
 +
[[File:hostdevices2.png]]
 +
</center>
  
Will be
+
Select the separator used, the server on which you wish to import and the file that contains the data, then click on "next".
  
df -P | awk \'NR > 1 {print $2, $4, $6}\'
+
<center>
 +
[[File:hostdevices3.png]]
 +
</center>
  
== Pandora FMS Windows Agents ==
+
==Custom NetScan==
  
=== Configuration of Pandora FMS Windows Agent ===
+
It allows the execution of custom scripts for the execution of network recognition tasks.
  
The fundamental paths and directories in the Windows agent installation will be found in the directory where the agent is installed, by default ''C: \Program Files''. The most important ones to keep in mind are:
+
Create a recognition task specifying:  
  
*''C:\Program Files\pandora_agent'': where the Pandora FMS agent is installed, its executable and its directories.
+
* Task name: Name of the recognition task.  
*''C:\Program Files\pandora_agent\pandora_agent.conf'': Agent configuration main file. Local execution modules and agent plugins are configured here.
+
* Comment: Allows adding comments.  
*''C:\Program Files\pandora_agent\PandoraAgent.exe'': Executable binary of the agent.
+
* Discovery server: Server that will execute the task.  
*''C:\Program Files\pandora_agent\util\tentacle_client.exe'': Tentacle executable binary for transferring files to the server.
+
* Group: Group it belongs to.  
*''C:\Program Files\pandora_agent\scripts'': Pandora FMS agent start/stop/restart scripts
+
* Interval: Execution interval.  
*''C:\Program Files\pandora_agent\pandora_agent.log'': Text file where Pandora FMS agent activity is saved, when the agent is executed in debug mode.
 
*''C:\Program Files\pandora_agent\util'': Directory containing the agent plugins.
 
*''C:\Program Files\pandora_agent\collections'': Directory containing the agent's collections.
 
  
== Auto-upgrading Software Agents ==
+
<center>
Using the file collections and pandora_update tool we can provide a way to "self-update" the software agents.
+
[[File:DISC_NetScan_Custom_1.JPG]]
 +
</center>
  
{{Tip|Pandora_update tool requires Perl's Digest:MD5 module to function. It is included by default from Perl 5.14, but for earlier versions it has to be manually installed.}}
+
Once the process of creating the task is complete, specify the script that you wish to run, as well as the configuration file necessary for its execution.
  
It works the following way:
+
==Net scan scripts==
  
1. Agents receive new binaries e.g. in the file collection's incoming directory.
+
This section will show the different scripts that have been created for custom recognition tasks. A view is displayed where the name and description of the task are defined.  
  
Windows example:
+
<center>
 
+
[[File:DISC_Net_scan_scripts.JPG]]
c:\program files\pandora_agent\collections\fc_1\PandoraAgent.exe
+
</center>
 
 
Linux example:
 
 
 
/etc/pandora/collections/fc_1/pandora_agent
 
 
 
2. The agent runs the pandora_update plugin. This plugin receives a single parameter: the short name of the collection (in this example, ''fc_1''). It will scan the collection directory for the agent binary, compare the binary located in the collection with the one currently running and if they are different, pandora_update stops the agent, replaces the binary and restarts the agent again using the new binary.
 
 
 
To update different architectures, a different collection must be established for each one of them. For example, if you need to update 32-bit and 64-bit Windows agents, you will have to create two collections and include the corresponding ''PandoraAgent.exe'' binary in each one of them.
 
 
 
3. Pandora_update also writes the updated event to a small log, to be able to recover in the next execution and warn the user, by using an async_string module, about the agent update process.
 
 
 
This means that the used modules could be configured to have a high interval to perform the update process.
 
 
 
'''UNIX Standard Installation'''
 
 
 
module_begin
 
module_name Pandora_Update
 
module_type async_string
 
module_interval 20
 
module_exec nohup /etc/pandora/plugins/pandora_update fc_1 2> /dev/null && tail -1 nohup.out 2> /dev/null
 
module_description Module to check new version of pandora agent and update itself
 
module_end
 
 
 
'''UNIX Custon Installation'''
 
  
module_begin
+
Pandora FMS allows adding additional scripts to make monitoring and recognition of required networks easier.
module_name Pandora_Update
 
module_type async_string
 
module_interval 20
 
module_exec nohup /var/opt/PandoraFMS/etc/pandora/plugins/pandora_update fc_1 /var/opt/PandoraFMS 2> /dev/null && tail -1 nohup.out 2> /dev/null
 
module_description Module to check new version of pandora agent and update itself
 
module_end
 
  
NOTE: The second parameter of the 'pandora_update' command is the installation path of Pandora FMS. This parameter is only required if Pandora FMS is installed in a path different from the default path.
+
The parameters that can be defined are the following:
  
'''Windows'''
+
* Name: Script name.  
 
+
* Script fullpath: Path where the script is located.
module_begin
+
* Description: Script description. You can define descriptions of the different fields, as well as default values for them.  
module_name Pandora_Update
+
* Hide value: In case you wish to hide the value of a field.  
module_type async_string
+
* Help: Help fields.  
module_interval 20
 
module_exec pandora_update.exe fc_1
 
module_description Module to check new version of pandora agent and update itself
 
module_end
 
 
 
== Agent / Module Autocreation from XML File / Learning Mode ==
 
Agents can be configured from the console in three working modes:
 
 
 
*'''Learning mode''': If the XML received from the software agent contains new modules, they will be automatically created. This is the default behavior.
 
*'''Normal mode''': No new modules will be created that arrive in XML if they have not been previously declared in the console.
 
*'''Autodisable mode''': Similar to learning mode, in this mode, also, if all modules pass to unknown state the agent will be automatically disabled, going to be enabled again if it receives new information.
 
  
 
<center>
 
<center>
[[File:Learning mode.png]]
+
[[File:DISC_Net_scan_scripts_2.JPG]]
 
</center>
 
</center>
  
 
+
Creating scripts allows adding macros with which to define all the parameters needed for the correct execution of the script.
=== Loaded Data from the XML in the Creation of an Agent ===
 
 
 
The data that is incorporated into the agent at the moment of its creation automatically when receiving an XML is the following:
 
 
 
* Agent name.
 
* Agent's IP address.
 
* Agent description.
 
* Agent's parent.
 
* Timezone offset.
 
* Group.
 
* Operating system.
 
* Agent interval.
 
* Agent version
 
*Custom fields.
 
*Custom ID.
 
*URL address.
 
*Agent mode: Learning, Normal, Autodisable.
 
 
 
=== Data modified in the Agent when receiving XML (Learning Mode enabled) ===
 
 
 
* Agent's IP address.
 
* Agent's parent .
 
* OS Version.
 
* Agent's version.
 
* Timezone.
 
* Custom fields.
 
 
 
 
 
{{Tip|The GIS data are always updated (if enabled). It doesn't matter at all if the learning mode is enabled or not.}}
 
 
 
In addition, with the ''learning mode'' activated, new modules will be created in Pandora FMS when received through XMLs.
 
 
 
=== Data added to the Module on Creation Time ===
 
 
 
The data entered in the module the first time an XML is received is as follows:
 
 
 
''' In 4.x version '''
 
 
 
* Name.
 
* Type.
 
* Description.
 
* Max Min value filter.
 
* Post process.
 
* Module interval.
 
* Min / Max Critical.
 
* Min / Max Warning.
 
* Disabled module.
 
* Units.
 
* Module group.
 
* Custom ID.
 
* Str. Warning / Critical.
 
* Critical instructions.
 
* Warning instructions.
 
* Unknown instructions.
 
* Tags.
 
* Critical inversion mode.
 
* Warning inversion mode.
 
* Quiet mode.
 
* Min. FF Threshold.
 
* Alert template.
 
* Crontab.
 
 
 
=== Loaded Data when Module already exists ===
 
 
 
When an XML containing information from an existing module is received, only the description and extended information are updated, in addition to the module data.
 
 
 
[[Pandora:Documentation_en|Go back to Pandora FMS documentation index]]
 
 
 
[[Category:Pandora FMS]]
 
[[Category:Documentation]]
 

Revision as of 12:48, 22 May 2020

Contents

1 What is Pandora FMS Discovery?

Info.png

Available for Pandora FMS 732 versions or higher.

 


Discovery provides a set of tools to simplify monitoring through wizards.

The following tools are included:

Task list
Pandora FMS Discovery tool allows you to see a list of all the tasks programmed in your environment, both at console and server levels.
Discovery Applications
It allows to monitor MySQL, Oracle or VMware environments from a new management console.
Discovery Cloud
Through this feature, you may monitor your cloud infrastructure, ranging from virtual machines created through Amazon Web Services (EC2) or relational databases in AWS RDS, to virtual machines running in Azure Compute.
Console Tasks
It allows you to automate console tasks within the Discovery system, like scheduling reports, doing backups or executing custom scripts from Pandora FMS Console.
Discovery Host&Devices
It includes the tools needed to discover or import devices and equipment to your network.

Discovery1.png

2 Discovery Task list

Pandora FMS Discovery tool allows you to see a list of all the tasks programmed in your environment, both at console and server levels.

DISC Task list 1.JPG

2.1 Console tasks

This section allows you to see the list of scheduled tasks in the console. The information is shown according to the following parameters:

  • User: It is the user who created the task.
  • Task: Description of the programmed task
  • Scheduled: It specifies how often the task will be executed.
  • Next Execution: It specifies the next task execution.
  • Last Execution: It indicates when the task was last executed.
  • Group: The group to which the task belongs.
  • Operations: It shows the actions that can be performed on the task, such as editing and deleting.

2.1.1 Edit Console tasks

This button allows access to the creation section, where the desired task can also be edited according to the following parameters:

  • Task: The task that will be executed among the following:
    • Backup Pandora FMS database.
    • Execute custom script.
    • Save custom report to disk.
    • Save custom XML report to disk.
    • Send custom report (from template) by email.
    • Send custom report by email.
  • Scheduled: It is used to specify how often the task will be executed.
  • Next execution: It shows the date of the next execution, being able to modify it if necessary.
  • Group: Group to which the task belongs.
  • Parameters: They are the specific parameters of each task.

2.1.1.1 Parameters of different tasks


Backup Pandora FMS database
  • Description: Backup description.
  • Save to disk in path: Path where the backup will be stored.

Execute custom script
  • Custom script: The script to be executed will be indicated.

“Save custom report to disk” and “Save custom XML report to disk”
  • Report pending to be created: The report to be created.
  • Save to disk in path: Path where the created report will be stored.

Send custom report (from template) by email
  • Template pending to be created: Custom template to be created.
  • Agents: Agents from which the information that will be reflected in the report will be obtained.
  • Report per agent: If you wish to generate separate reports for each report.
  • Report name: Name that you wish to give the report.
  • Send to email addresses: Email addresses to which the report will be sent.
  • Subject: Topic of the mail to be sent.
  • Message: Body of the message with which the reports will be sent.

Send custom report by email
  • Report pending to be created: Report to be generated.
  • Send to email addresses: Email addresses the report will be sent to.
  • Subject: Topic of the mail to be sent.
  • Message: Body of the message with which the reports will be sent.
  • Report Type: Type of report that will be sent.

2.2 Server tasks

This section reflects the recognition tasks programmed by the server. The information is shown according to the following parameters:

  • Force: Option that will allow forcing the task execution.
  • Task name: Name assigned to the task.
  • Server name: Server that will execute the task.
  • Interval: Time interval during which the task will be performed.
  • Network: Network where the checks will be made.
  • Status: Status of the scheduled task.
  • Task type: Type of the task that has been generated.
  • Progress: Progress of the task in case of being executed.
  • Updated at: It indicates when the task was last executed.
  • Operations: Actions that can be performed on the task. Display of the task status, display of the map of the discovered network, editing and deletion.

2.2.1 Operations

The edition of the server recognition tasks allows to adjust the following parameters:

  • Interval: The task execution interval can be set, either manually or defined.
  • Task name: Task Name.
  • Discovery server: Server that will perform the recognition task. It is a mandatory parameter for correct recognition operation.
  • Network: Network on which the checks are to be carried out.
  • Group: Group to which it belongs.
  • Comment: Comments to add.

3 Discovery Applications

Now, it is possible to monitor applications remotely using Discovery Applications.


Discoverysap1.png

3.1 Discovery Applications: MySQL

From Pandora FMS 7.0-733 version on, MySQL environments can be monitored using Discovery Applications.

For that purpose, it will be necessary to define the following parameters:

  • Task name: Name of the task that will perform MySQL monitoring.
  • Discovery Server: Server that will perform the execution of the specified task.
  • Group: Group to which it belongs.
  • MySQL server IP: IP of the server where the MySQL environment to be monitored is.
  • MySQL server port: Port of the specified address through which the information of MySQL monitoring will be obtained.
  • User: MySQL user with which to login. (Important: It must be a user with permissions on the database where the queries will be executed, since otherwise the connection will never be established.)
  • Password: MySQL user password specified above.
  • Interval: Time interval in which monitoring will be executed.

DISCMySQL1.JPG

Once the parameters with the data needed for installation are defined, you will be shown a new window where you must specify the agent on which you wish to create all the modules resulting from MySQL monitoring.

The options to be displayed are the following:

  • Target agent: Agent on which the modules resulting from monitoring will be created.
  • Custom module prefix: It defines a custom prefix that will be concatenated with the name of the modules generated by the task.
  • Scan databases: It will scan the databases.
  • Create agent per database: This option will allow an agent to be created for each database found in MySQL environment.
  • Check engine uptime: It will check the time that MySQL engine is operational.
  • Retrieve query statistics: It allows to recover the statistics of the executed queries.
  • Analyze connections: It analyzes connections.
  • Retrieve InnoDB statistics: It returns InnoDB statistics.
  • Retrieve cache statistics: It returns cache statistics.
  • Custom queries: It allows defining custom statements.

DISCMySQL2.JPG

3.2 Discovery Applications: Oracle

From Pandora FMS 7.0-733 version on, Oracle can be monitored using Discovery Applications.

Oracle monitoring will allow to define the following parameters:

  • Task name: Task Name
  • Discovery server: Server that will run the Oracle monitoring task.
  • Group: Group it belongs to.
  • Oracle target strings: Where the target strings of the task will be defined.
  • User: Oracle user that will access to perform the monitoring.
  • Password: Password of the previously defined user.
  • Interval: Execution interval

DISC Oracle1.JPG

Once defined, it will be necessary to specify the agent that will store the information and the checks that will be made. The information that can be defined in this section is the following:

  • Target agent: Agent that will receive Oracle monitoring information.
  • Custom module prefix: It defines a custom prefix that will be concatenated with the name of the modules generated by the task.
  • Check engine uptime: It will check the time that Oracle is operational.
  • Retrieve query statistics: It allows to recover the statistics of the executed queries.
  • Analyze connections: It analyzes connections.
  • Calculate fragmentation ratio: It calculates the fragmentation rate.
  • Monitor tablespaces: It monitors tablespaces.
  • Retrieve cache statistics: It returns cache statistics.
  • Execute custom queries: It executes custom queries.
  • Custom queries: it allows to define customized queries.

DISC Oracle2.JPG

3.2.1 Installing Oracle packages

It is very important to bear in mind that for the correct integration and operation of Oracle with Pandora FMS, it is necessary to have the appropriate packages. Pandora FMS ISO includes everything necessary, but for installations carried out in another way, the installation process will be as follows:

  • Install oracle instant client from the Oracle page:
https://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html
  • Required packages:
oracle-instantclient11.1-basic-11.1.0.7.0-1.x86_64.rpm
oracle-instantclient11.1-devel-11.1.0.7.0-1.x86_64.rpm
oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.x86_64.rpm
  • Prepare the boot environment of pandora_server:

Template warning.png

In the pandora_server path you need to create a file called pandora_server.env with the following information. Its execution is needed ./pandora_server.env

 


# Set Oracle environment for pandora_server
cat > /etc/pandora/pandora_server.env << 'EOF_ENV'
#!/bin/bash
VERSION=11.1
export PATH=$PATH:$HOME/bin:/usr/lib/oracle/$VERSION/client64/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/$VERSION/client64/lib
export ORACLE_HOME=/usr/lib/oracle/$VERSION/client64
EOF_ENV
  • Restart pandora_server
/etc/init.d/pandora_server restart

Template warning.png

If package E7 is being used, version 12.2 of both library and environment variables must be installed, and Oracle (v12.2) packages must be used

 


3.3 Discovery Applications: SAP


Discovery Applications has a new family member from Pandora FMS version 741 onwards. This new feature will now be included in the official ISO installation.

Template warning.png

If you Pandora FMS is installed from packages, or your system is prior to NG741, deploy the official SAP plugin in Pandora FMS server and configure it manually (see below).

 


Template warning.png

In order to use SAP in Discovery, configure a specific license number for this plugin, which is not included in Pandora FMS Enterprise license. Configure this license in Setup > Enterprise.

 


The system will guide you along each step to configure SAP, according to your needs. You may define the same task to monitor systems with similar configurations.

Discoverysap2.png

In the example above, servers sapsample.artica.lan, sap2.artica.lan and 10.0.30.33 use the same client, system and credential configuration, so they can be grouped in the same task.

Template warning.png

If you need to monitor different configurations, create a task for each configuration.

 


Select from the list the information about the SAP system you wish to retrieve as shown below:

Discoverysap3.png

Pandora FMS Discovery will be in charge of collecting information, storing it in agents represented by the defined ¨SAP Hostnames¨.


3.3.1 SAP Discovery connector manual installation

If your Pandora FMS version was installed before the NG741 version, download the connector and configure it manually.

First, install JAVA (JRE) on Pandora FMS server for Discovery SAP operation.

Then you need to download the remote connector/plugin for Linux from SAP, download it from our library.

Configure your pandora_server.conf too, and set the following parameters:

# Discovery SAP 
java /usr/bin/java

# Discovery SAP utils
sap_utils /usr/share/pandora_server/util/recon_scripts/SAP

In the directory indicated, with the configuration token sap_utils decompress the files that you will find in the tarball downloaded from the library called "Pandora FMS SAP Discovery for Linux" that contains the following files:

Deset_SAP_Plugin.jar
dev_jco_rfc.trc
libsapjco3.so
sapjco3.dll
sapjco3.jar

Once the configuration file is modified, restart the Pandora FMS server.

3.3.2 SAP View


You can see the general state of the SAP system servers in the SAP View.

Discoverysap4.png

This view will display a panel with the available SAP modules of the selected SAP agent.

You may select the refresh time and the interval to show in the graphs.

3.3.3 SAP agent view


The SAP view is also integrated as a new tab within the agent view. If the system detects that the agent is a SAP agent, an access to the SAP View tab will be displayed:

Discoverysap5.png

The agent view will provide an overview of the status of the SAP modules for the current agent:

Discoverysap6.png


Template warning.png

Java must be installed within the server for SAP integration to work.

 


3.4 Discovery Applications: VMware

Template warning.png

In case of manual installation or update from a Pandora FMS version prior to 732, it is necessary to install SDK for VMWare to work properly.

 


From Pandora FMS 7.0-733 version on, VMware infrastructures can be monitored using Discovery Applications.


Discoveryapplications2.png


The following must be specified:

  • A name to identify the task.
  • A Discovery server where to run it.
  • A group to which the agents generated by the VMware task will be associated.

Info.png

It must be taken into account that if the Pandora FMS server has the autocreate_group token active, priority will be given to the group corresponding to the indicated ID, instead of applying the configuration of the wizard.

 



The data required to monitor VMware are:

  • V-Center IP
  • The name of the datacenter (it can be seen through VMware installation management screen).
  • User with read permissions.
  • User password.
  • Monitoring interval.

Password encryption can be enabled by pressing the button encrypt passwords. This only applies to the wizard in progress.


On the next page, VMware monitoring details can be specified:

Discoveryapplications3.png

  • Max threads: Choose the number of threads that the VMware monitoring script will use to speed up data collection.
  • Retry send: The information of the detected agents is sent by XML to the DataServer. This option must be activated to retry sending in case of error.
  • Event mode: Only for VCenter. VMware VCenter event-based monitoring is enabled. This working mode is exclusive and independent from standard monitoring.
  • Virtual network monitoring: It enables monitoring of virtual network devices which are defined in VMware.
  • Extra settings: Any advanced settings needed to customize VMware monitoring should be included here in text mode. For more information, visit this section.





3.5 Discovery Applications: MS SQL


This new Pandora FMS integration allows monitoring Microsoft SQL server databases.

Microsoft ODBC must be installed in the system where Pandora FMS server is running.

Info.png

From version 745 onwards, ODBC is preinstalled in Pandora FMS ISO.

 


3.5.1 How to install Microsoft ODBC

  • In CentOS 6:
curl https://packages.microsoft.com/config/rhel/6/prod.repo > /etc/yum.repos.d/mssql-release.repo && \
yum remove unixODBC-utf16 unixODBC-utf16-devel && \
ACCEPT_EULA=Y yum install -y msodbcsql17
  • In CentOS 7:
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo && \
yum remove unixODBC-utf16 unixODBC-utf16-devel && \
ACCEPT_EULA=Y yum install -y msodbcsql17

Once the ODBC is installed, it might be necessary to set which driver Pandora FMS should use. To that end, check Pandora FMS server configuration file.

/etc/pandora/pandora_server.conf

Once you go to the configuration file, look for the following token:

mssql_driver IDENTIFYING STRING

The IDENTIFYING STRING parameter can be found in /etc/odbcinst.ini which will be created when installing ODBC.

This is the default string:

ODBC Driver 17 for SQL Server

3.5.2 Configure a Discovery Applications MS SQL task

To create a monitoring task for a Microsoft SQL Server database, access through Discovery (Discovery > Applications > Microsoft SQL Server).

Once you choose the Microsoft SQL Server task, you may define the instances in the following way:

IP\Instance

If you wish so, define a port like this:

IP:Port\Instance

Mssql1.png


This integration's configuration advanced options include service stability, usage statistics, connection status and custom queries.

Mssql3.png

If you wish to execute any custom query, keep in mind they follow the same format as those of Oracle.

4 Discovery Cloud

Discovery Cloud allows you to monitor structures in the AWS cloud. Thanks to Pandora FMS, you can manage many Amazon Web Services accounts as well as Microsoft Azure's, concentrating information management in a single tool.

Azure66.JPG

Account management, both from AWS and Microsoft Azure, will be made through the Credential Store located in Profiles -> Manage agent groups -> Credential Store.

Credential store.png

4.1 Discovery Cloud: Amazon Web Services (AWS)

Template warning.png

This section is under construction.

 


To monitor an infrastructure in Amazon Web Services, follow the different pages of the wizard step by step.


4.1.1 AWS. Credential validation

Pandora FMS allows managing several AWS accounts. Once you have accessed the Amazon Web Services menu, the navigation will be automatically redirected to the window to select the account with which you need to access the service. If there is a previously created account in previous versions of Pandora FMS, it will be shown as "imported_aws_account".

AWSCredentials1.JPG

You can add as many accounts as necessary through the "Manage Accounts" option next to the AWS Account drop-down.

This will allow access to the "Credential store" section of Profiles> Manage agent groups and it will act as the store of all the Amazon Web Services accounts previously created to be registered.

AWS4.png

AWS5.png

Query accounts in Amazon AWS must be created with the following permissions:

Awsgrants.png

  • Billing (read)
  • CloudWatch (list,read)
  • Cost Explorer Service (Full access)
  • EC2 (full read, limited: list)


Summary of the policy in JSON:

{
   "Version": "2012-10-17",
   "Statement": [
       {
           "Sid": "VisualEditor0",
           "Effect": "Allow",
           "Action": [
               "ec2:DescribeInstances",
               "ec2:DescribeVolumesModifications",
               "ec2:GetHostReservationPurchasePreview",
               "ec2:DescribeSnapshots",
               "aws-portal:ViewUsage",
               "ec2:DescribePlacementGroups",
               "ec2:GetConsoleScreenshot",
               "ec2:DescribeHostReservationOfferings",
               "ec2:DescribeInternetGateways",
               "ec2:GetLaunchTemplateData",
               "ec2:DescribeVolumeStatus",
               "ec2:DescribeScheduledInstanceAvailability",
               "ec2:DescribeSpotDatafeedSubscription",
               "ec2:DescribeVolumes",
               "ec2:DescribeFpgaImageAttribute",
               "ec2:DescribeExportTasks",
               "ec2:DescribeAccountAttributes",
               "aws-portal:ViewBilling",
               "ec2:DescribeNetworkInterfacePermissions",
               "ec2:DescribeReservedInstances",
               "ec2:DescribeKeyPairs",
               "ec2:DescribeNetworkAcls",
               "ec2:DescribeRouteTables",
               "ec2:DescribeReservedInstancesListings",
               "ec2:DescribeEgressOnlyInternetGateways",
               "ec2:DescribeSpotFleetRequestHistory",
               "ec2:DescribeLaunchTemplates",
               "ec2:DescribeVpcClassicLinkDnsSupport",
               "ec2:DescribeVpnConnections",
               "ec2:DescribeSnapshotAttribute",
               "ec2:DescribeVpcPeeringConnections",
               "ec2:DescribeReservedInstancesOfferings",
               "ec2:DescribeIdFormat",
               "ec2:DescribeVpcEndpointServiceConfigurations",
               "ec2:DescribePrefixLists",
               "cloudwatch:GetMetricStatistics",
               "ec2:GetReservedInstancesExchangeQuote",
               "ec2:DescribeVolumeAttribute",
               "ec2:DescribeInstanceCreditSpecifications",
               "ec2:DescribeVpcClassicLink",
               "ec2:DescribeImportSnapshotTasks",
               "ec2:DescribeVpcEndpointServicePermissions",
               "ec2:GetPasswordData",
               "ec2:DescribeScheduledInstances",
               "ec2:DescribeImageAttribute",
               "ec2:DescribeVpcEndpoints",
               "ec2:DescribeReservedInstancesModifications",
               "ec2:DescribeElasticGpus",
               "ec2:DescribeSubnets",
               "ec2:DescribeVpnGateways",
               "ec2:DescribeMovingAddresses",
               "ec2:DescribeAddresses",
               "ec2:DescribeInstanceAttribute",
               "ec2:DescribeRegions",
               "ec2:DescribeFlowLogs",
               "ec2:DescribeDhcpOptions",
               "ec2:DescribeVpcEndpointServices",
               "ce:GetCostAndUsage",
               "ec2:DescribeSpotInstanceRequests",
               "cloudwatch:ListMetrics",
               "ec2:DescribeVpcAttribute",
               "ec2:GetConsoleOutput",
               "ec2:DescribeSpotPriceHistory",
               "ce:GetReservationUtilization",
               "ec2:DescribeNetworkInterfaces",
               "ec2:DescribeAvailabilityZones",
               "ec2:DescribeNetworkInterfaceAttribute",
               "ce:GetDimensionValues",
               "ec2:DescribeVpcEndpointConnections",
               "ec2:DescribeInstanceStatus",
               "ec2:DescribeHostReservations",
               "ec2:DescribeIamInstanceProfileAssociations",
               "ec2:DescribeTags",
               "ec2:DescribeLaunchTemplateVersions",
               "ec2:DescribeBundleTasks",
               "ec2:DescribeIdentityIdFormat",
               "ec2:DescribeImportImageTasks",
               "ec2:DescribeClassicLinkInstances",
               "ec2:DescribeNatGateways",
               "ec2:DescribeCustomerGateways",
               "ec2:DescribeVpcEndpointConnectionNotifications",
               "ec2:DescribeSecurityGroups",
               "ec2:DescribeSpotFleetRequests",
               "ec2:DescribeHosts",
               "ec2:DescribeImages",
               "ec2:DescribeFpgaImages",
               "ec2:DescribeSpotFleetInstances",
               "ec2:DescribeSecurityGroupReferences",
               "ec2:DescribeVpcs",
               "ec2:DescribeConversionTasks",
               "ec2:DescribeStaleSecurityGroups",
               "ce:GetTags"
           ],
           "Resource": "*"
       }
   ]
}


Assign the policy to a new user.

Awsgrants2.png


Back in Pandora FMS, the registered account can be used to link it and be able to access AWS monitoring.

Info.png

If pandora-cm-api is not available in the installation, it can be obtained from the following link: [1]

 



4.1.2 Discovery Cloud. AWS

Once the credentials have been validated, access the Discovery Cloud menu => Amazon Web Services

AWS6.png

In this section, Amazon EC2 and Amazon RDS are found. For each account added to the "Credential store", the EC2 environment hosted in that account can be monitored.

Info.png

Only one recognition task per AWS account can be active. The account will be the same for all monitored technologies within the provider.

 


4.1.3 Discovery Cloud. AWS.EC2

Within EC2 monitoring you can find:

  • Expense monitoring.
  • Summary of resources registered in AWS.EC2.
  • Specific instance monitoring.
  • Volume and elastic IP address monitoring.

To start the monitoring process, a series of basic data is requested:

Cloud3.png

It is required to provide a name for the task, indicate the Discovery server from where it will be executed and the monitoring interval.

4.1.3.1 Discovery Cloud AWS.EC2 Costs

When clicking next, you will start configuring AWS monitoring expenses:

Template warning.png

Amazon Web Services expense monitoring involves extra expenses. You can find more information about it in the following link [https://aws.amazon.com/aws-cost-management/pricing/

 


Expense monitoring provides a separate monitoring interval to avoid extra charges.

Cloud4.png

Both the overall cost and the independent cost per region can be monitored.

4.1.3.2 Discovery Cloud AWS.EC2 Summary

The Discovery task can be configured to collect general information on the stock status in all regions.

To enable it, the Scan and general monitoring option must be activated.

Cloud5.png

Generic CPU usage counters can be added, as well as output (disk) input operations or volume of disk and network transferred data (bytes).


4.1.3.3 Discovery Cloud AWS.EC2 Specific Instance Monitoring

Specific instances can be monitored to obtain readings of:

  • CPUUtilization: Average CPU usage
  • DiskReadBytes: Reading bytes (disk)
  • DiskWriteBytes: Writing bytes (disk)
  • DiskReadOps: Read operations (disk)
  • DiskWriteOps: Writing operations (disk)
  • NetworkPacketsIn: Input packets (network)
  • NetworkPacketsOut: Output packets (network)

The agents that represent the specific instances will have as their parent the agent that represents the region where they are hosted.

It must be verified that the update_parent token is configured to 1 in the Pandora FMS server configuration to keep the parent-child relationships updated.

Navigation must be carried out through the browser by selecting the instances that need to be monitored:

Cloud6.png

4.1.3.4 Discovery Cloud AWS.EC2 Extras

In this last screen you can indicate whether you want to monitor the volumes used by the reserved instances.

Two extra modules will appear in the region agents:

  • Total reserved volume (GB)
  • Total registered volumes (number)


You can also choose to activate the Elastic IP addresses token. The number of elastic IPs registered in the AWS.EC2 account will be reported.

Cloud7.png


Once the wizard is completed, the progress of the execution in Discovery Task list can be seen:

Tasklist1.png

4.1.4 Discovery Cloud. AWS.RDS

AWS RDS allows you to monitor relational databases provided by Amazon Web Services.

The RDS service provides a database server and allows creating the instance related to said database. In addition, RDS offers the possibility to connect to its instances through clients such as SSMS, MySQL workbench or through JDBC or ODBC DB APIs.

AWS8.JPG

Through Pandora FMS, different RDS instances can be monitored by filling in the parameters included in the menu shown at the top.

AWS RDS integration with Pandora FMS allows to monitor both the data source and their availablity.

In addition, the database running under RDS can be monitored retrieving all the metrics that could be monitored in a database as usual.

Template warning.png

Integration with AWS RDS only supports Oracle, MySQL and Mariadb.

 


4.1.5 Discovery Cloud. Overview

Discovery Cloud includes an overview where the key points of the infrastructure in Amazon Web Services can be reviewed. Pandora FMS allows displaying different maps based on existing accounts.

In the AWS view, the account from which you wish to display the information can be selected:

AWS9.JPG

It includes:

  • Current expenses
  • Previous expenses
  • Expense evolution chart (6 months)
  • Reserve / instance evolution chart (1 month)
  • Map of regions with the number of instances per region.

Awsview.png

4.2 Discovery Cloud: Microsoft Azure


To monitor an infrastructure in Microsoft Azure, follow these instructions step by step.

4.2.1 How to register a user to use the Azure API

Azure.png

  • Go to 'App registrations'> 'New registration'

Azure2.png


  • Enter the data.

Azure3.png


  • Write down the data "client_id" and "directory".

Azure4.png

  • Next, access 'certificates & secrets' and create a new one:

Azure5.png

Template warning.png

Write down the key that is shown, it is the application_secret.

 


4.2.2 Assigning permissions

Assign a role to the account that will operate (app). To that effect, access "home" and get into the subscription.

Azure6.png


Within the subscription, select "Access control (IAM)".

Azure7.png

Add a new role assignment and once there, select the "reader" role for the created app.

Azure8.png

It is important to save the changes by pressing "save".


From that moment onwards, you can connect to the service and make requests through pandora-cm-api.

4.2.2.1 Examples

The status of Azure can be checked from Pandora FMS as follows:

  • Preload the environment.
  • Run . load_env.sh
  • pandora-cm-api --product Azure --get availability


If the environment is operational, the system should return a response of 1.

An example of the contents of the load_env.sh script would be the following:

  • Azure
export CLIENT_ID=XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX

export DOMAIN=XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX

export APPLICATION_SECRET="XXXXXXXXXXXXXXXXXXXXXXXXX"

export AZURE_SUBSCRIPTION_ID=XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX

4.2.3 Configure a task in Pandora FMS

Pandora FMS allows managing several Microsoft Azure accounts.

You can add as many accounts as needed through the "Manage Accounts" option next to the Account drop-down.

This will allow access to the "Credential store" section of Profiles> Manage agent groups and it will act as the store of all previously created Microsoft Azure accounts to be registered.

To configure a new task, follow these steps:

  • Add a new password to the "credential store".

Azure9.png


  • Access 'Discovery> Cloud> Azure' and validate the Azure account.


Azure10.png


Azure11.png


Azure12.png


  • From that point onwards, it will be necessary to define the name of your recon task, the server that will execute the task, the group it will belong to and the execution interval.

AzureX3.PNG

  • Once task data are defined, select the Azure account sections that you wish to monitor. Each section will allow in turn to choose the desired instances.

AzureX4.PNG

  • The last step is selecting the metrics you wish to obtain from the agents generated by Pandora FMS for each instance it finds in Microsoft Azure. Once the section is configured, the task can be launched and Pandora FMS will create automatically agents according to the instances required in previous steps.

AzureX5.PNG


5 Discovery Console Tasks

Virtually identical to what was previously seen in Task List, Console Task will allow creating new tasks taking into account the following parameters:

  • Task: The task that will be executed among the following:
    • Backup Pandora FMS database.
    • Execute custom script.
    • Save custom report to disk.
    • Save custom XML report to disk.
    • Send custom report (from template) by email.
    • Send custom report by email.
  • Scheduled: It is used to specify how often the task will be executed.
  • Next execution: It shows the date of the next execution, being able to modify it if necessary.
  • Group: Group to which the task belongs.
  • Parameters: They are the specific parameters of each task.

ConsoleTasks.JPG

5.1 Parameters of different tasks


Backup Pandora FMS database
  • Description: Backup description.
  • Save to disk in path: path where the backup will be stored.

Execute custom script
  • Custom script: The script to be executed will be indicated.

“Save custom report to disk” and “Save custom XML report to disk”
  • Report pending to be created: The report to be created.
  • Save to disk in path: Path where the created report will be stored.

Send custom report (from template) by email
  • Template pending to be created: Custom template to be created.
  • Agents: Agents from which the information that will be reflected in the report will be obtained.
  • Report per agent: If you wish to generate separate reports for each report.
  • Report name: Name that you want to give the report.
  • Send to email addresses: Email addresses the report will be sent to.
  • Subject: Topic of the mail to be sent.
  • Message: Body of the message which will be sent together with the reports.

Send custom report by email
  • Report pending to be created: Report to be generated.
  • Send to email addresses: Email addresses the report will be sent to.
  • Subject: Topic of the mail to be sent.
  • Message: Body of the message with which the reports will be sent.
  • Report Type: Type of report that will be sent.

6 Discovery Host&Devices

The Discovery Host & Devices section offers a multitude of options to help manage and discover devices within as many environments as needed.

Therefore, it features the following tools:

  • Net Scan.
  • Import CSV.
  • Custom NetScan.
  • Manage NetScan scripts.


800

6.1 NetScan

With the NetScan tool, you may find devices in a network and apply different monitoring rules.

First, define the name of the task, the Discovery server that will run it, the group the discovered agents will be assigned to and the scanning interval.

In addition, you will have two options when performing the scanning task. You may indicate the networks to be discovered in the field designed to that end in Red or you may enable the token Use CSV file, that will allow to load a csv file containing the specific devices or network to check throughout the recon task. If the csv file is selected, the Network option will not be enabled.

3oaKq2yukE.png

Template warning.png

The intervals selected as manuals must be manually launched. Discovery will not launch any manual task automatically.

 



In the features section, you may indicate the following options:

800


  • Known hardware auto discovery: It dinamically applies the templates that were previously added to the Private Enterprise Number section. To learn more, go to the following link.
  • Module templates: Try to apply the modules from the selected templates. If the execution does not pass the test, they will not be added to the monitoring list.
  • Check results: The user must validate the results selecting which agents will be created from those found through the discovery task.
  • Apply autoconfiguration rules: It applies the predefined autoconfiguration rules to the detected agents. To learn more, go to the following link.

Info.png

Automatic configuration allows you to apply policies, group changes and settings, as well as launch custom events or execute scripts on actions.

 


Info.png

Agents detected by NetScan are remote agents without a configuration file. You cannot apply local monitoring policies or add configuration changes in block if you do not deploy an agent on the targets.

 



  • SNMP activated: To complete the information obtained from the discovered network devices, enable SNMP. That improves detection by scanning the SNMP information available in the discovered targets. Once this token is enabled, two more options appear:
    • SNMP version: Select the SNMP version configured in the scanned network devices. It supports SNMP versions 1,2, 2c and 3.
    • SNMP communities: Indicate the environment configured community. You may add as many communities as you need by typing them in the following box.
  • WMI enabled: You may enable WMI scanning. Just select the previously loaded credentials from the credential store.

Info.png

The different credentials provided against the detected targets that support WMI will be tested, complementing monitoring with modules that will report about CPU, memory and disk usage.

 


  • SO detection: Detect the target's operating system.
  • Name resolution: Solve the target's name.
  • Parent detection: By means of the information collected through SNMP, the different interconnections between devices will be calculated, to be able to represent their network infrastructure.
  • Parent recursion: It improves parent detection, adding recursion to the process.
  • VLAN enabled: It detects the VLAN to which the different devices are connected.

Once the wizard is finished, Discovery will start executing it in each defined interval. If the interval is manual, the task should be started manually:

800

Once the task is finished, if you access from Review, you will see a summary of the devices found that respond to ping and the rest of metrics available through SNMP or WMI. All the IPs will be shown, but they may have two status:

  • Disabled: There is already an agent or module being monitored in the environoment and it will not be created nor modified.
  • Enabled: It is a new non-monitored element, or within the obtained metrics there is a new element that responded and that will be displayed on a drop-down. You may choose to add it to the monitored agent list in devices in this status or add any of the new enabled metrics.

HK8XAXtv92.png

Info.png

Once the targets to be monitored are selected, the system will create them systematically. Along the process, the target OS will be detected to complete the information gathered.

 


6.2 Automatic agent deployment

Template warning.png

Please confirm winexe command is installed and working in your server before using this feature. This utility is provided by Pandora FMS Enterprise server installer. You must install zlib.i686 and glibc.i686 to get winexe working.

 


Template warning.png

In Windows environments it is recommended to install as an administrator user. Before starting the service it will be necessary to define an administrator account for its use.

 



From Pandora FMS version 737 onwards, it is possible to deploy agents from the console itself using the deployment center.

Template warning.png

Server version must be EL7 for agent automatic deployment to work.

 


Depl1.png


The steps to deploy agents from the console are:

Register the versions of the software agents to be deployed in the agent repository.

The installers of the agents to be deployed throughout the infrastructure are needed. You may use custom agents.

For more information about the use of the agent repository, visit this link


Register the credentials to be used to connect the targets in the credential manager.

Specify the credentials with which the accesses to found or specified targets will be tested.

For more information about the use of the Credential Store, visit this link


Check that your environment is ready for deployment.

When visiting the deployment center for the first time, the following notices will be shown:

Depl info1.png

This message points out that objectives for deployment have not been defined yet.


Depl info2.png

These messages indicate:

The first message indicates that the public_url public access URL must be configured so that the targets can get connected to the console and be configured.

Template warning.png

This system does not perform PUSH operations. All deployments are sent by offering the software and ordering the target to install it.

 



The second one indicates that no installers have been added to the agent repository. Register installers to deploy the software.



6.2.1 Target Search

Search or point out the targets in the deployment center.

Use any of the methods described below to register new targets.

You may use any of the following options to define targets:

Depl action buttons.png


6.2.1.1 Scan one or more networks in pursuit of targets.

By pressing the scan targets button, a pop-up with the following fields will be displayed:

Depl2.png


Firstly indicate:

  • The network or networks (separated by commas) to scan.
  • The Discovery server that will perform the scan.
  • The credentials used to try to connect to the discovered targets.
  • The software agent version registered as "desired" for the discovered targets.
  • The IP of the target server where these software agents will point when they are installed (it corresponds to the "server_ip" field in the agent configuration file).


When pressing 'Scan', you will receive a confirmation, with a link that you can follow to check the progress of this task.

Depl info3.png


A new entry will appear in the task list:

Depl2b.png


Info.png

Discovery tasks related to agent deployment are volatile tasks. Once completed, they will be automatically deleted. Information about scan or deployment, both successful and failing, can be consulted from the deployment center itself.

 



As possible targets are found, they will appear in the deployment center:

Depl3.png


Info.png

The discovered targets added to this list are all found devices whose operating system matches Windows or Linux / Unix based systems, regardless of whether valid credentials were found or not.

 


6.2.1.2 Define a target manually.

You may manually register the target by defining:

  • IP.
  • OS. This version only allows Windows and those operating systems based on Linux / Unix (compatible with the tar.gz agent installer).
  • Architecture.
  • Credentials used to try to connect to the target.
  • The agent version you wish to deploy.
  • The IP address of the server where that agent will point once installed (it corresponds to the field server_ip of the software agent configuration).

Depl5.png

6.2.1.3 Upload a CSV file with target information.

If you wish to mass register targets, upload a CSV file with the following format:


IP; OS; Architecture; Target agent version; Credential identifier; Target server ip


Depl6.png

The system will create the objectives based on what is defined in the CSV.

6.2.2 Deploy the software

Template warning.png

You may only schedule deployment against targets whose information is complete, specifying both credentials and software versions to deploy.

 


When you have possible targets on the list, launch agent deployment:

Depl4.png


Select the IPs of the targets from the list (only valid targets will appear) and press deploy.

A Discovery task for background deployment will automatically be created, which will install the agent on the desired targets.

You can confirm that the agent has been successfully installed from the list of objectives of the deployment center:

Depl7.png


The name of the target also becomes a link to the corresponding Pandora FMS agent.


Failure example: The user not only entered the IP of the target, but also its netmask (THE IP IS ENOUGH).

When the system tries to deploy the software, it will notice that the IP format is not correct and will warn the user:

Depl err1.png

6.3 Import a list of your devices in CSV

A list of devices can be imported to represent them as agents using the agent import wizard through CSV.

Info.png

This feature only creates agents in Pandora FMS for its remote monitoring.

 



Hostdevices2.png

Select the separator used, the server on which you wish to import and the file that contains the data, then click on "next".

Hostdevices3.png

6.4 Custom NetScan

It allows the execution of custom scripts for the execution of network recognition tasks.

Create a recognition task specifying:

  • Task name: Name of the recognition task.
  • Comment: Allows adding comments.
  • Discovery server: Server that will execute the task.
  • Group: Group it belongs to.
  • Interval: Execution interval.

DISC NetScan Custom 1.JPG

Once the process of creating the task is complete, specify the script that you wish to run, as well as the configuration file necessary for its execution.

6.5 Net scan scripts

This section will show the different scripts that have been created for custom recognition tasks. A view is displayed where the name and description of the task are defined.

DISC Net scan scripts.JPG

Pandora FMS allows adding additional scripts to make monitoring and recognition of required networks easier.

The parameters that can be defined are the following:

  • Name: Script name.
  • Script fullpath: Path where the script is located.
  • Description: Script description. You can define descriptions of the different fields, as well as default values for them.
  • Hide value: In case you wish to hide the value of a field.
  • Help: Help fields.

DISC Net scan scripts 2.JPG

Creating scripts allows adding macros with which to define all the parameters needed for the correct execution of the script.