# SAP # Introduction The purpose of this document is to describe the monitoring of SAP systems with Pandora FMS through Discovery. The **pandora\_sap\_deset** plugin as a wrapper of the **Deset\_SAP\_Plugin** plugin for its use in Discovery, allows to monitor SAP systems and servers remotely without the need to install anything in the equipments that host SAP, using RFC (Remote Function Call) functions. # Prerrequisites - **Dependencies** The **lib** folder that should contain files **Deset\_SAP\_Plugin.jar, libsapjco3.so, sapjco3.jar and the jre folder** (java runtime environment), should be in the same path where the plugin is executed. This folder is attached with the plugin in the package that can be downloaded from the Pandora FMS library. - **Connectivity** Since the monitoring is done from outside the SAP system, it is necessary to ensure the communication with it. Making use of the RFC functions, the connectivity is done from the equipment that executes the plugin (for example, the Pandora FMS server) and the gateway of the SAP system through the port **33XX TCP**, being **XX** the number of the SAP system to which it is connected (by default the 3300 TCP). Therefore the range of possible connection ports will go from 3300 to 3399. - **User** In order to be able to execute the RFC functions of the SAP system it will be necessary to have a user and password. This user must be of type "B-System" (System) in SAP ECC or S/4HANA versions, or of type "C-Communication / CPI-C/RFC" in earlier SAP versions. It is recommended that the user is of type "B-System" whenever possible because for this type of users their passwords do not expire, which in the case of happening would force to change them also in the configuration of the plugin in Pandora FMS. For the creation of the user in the SAP system, it will be necessary to have the following authorization objects: - - Authorization Object "**S\_RFC**": - Field "**ACTVT**" with value "**16 Execute**". - Field "**RFC\_TYPE**" with value "**X FUGR**". - **"RFC\_NAME**" field with values "**I\***", "**R\***", "**S\***", "**O\***", "**T\***". - Authorization object "**S\_TABU\_DIS**": - Field "**ACTVT**": value "**03 Display**". - Field "**DICBERCLS**": value "**\***". - Authorization object "**S\_XMI\_LOG**": - All its fields with values "**\***". - Authorization object "**S\_XMI\_PROD**": - All its fields with values "**\***". - Authorization object "**S\_TCODE**": - "**TCD**" field with value "**SM50**". - Authorization Object "**S\_TABU\_RFC**": - - Field "**ACTVT**": value "**03 Display**" - **License** Deset\_SAP\_Plugin is exclusive for Pandora FMS Enterprise customers that have contracted it. Therefore it is necessary to have a valid license key to run the plugin. To obtain a valid license, please contact Pandora FMS team at: [https://pandorafms.com/es/](https://pandorafms.com/es/) # Parameters and configuration **Parámeters**
--conf | Path to the configuration file |
--custom\_modules | Path to the file in which the custom modules are to be defined |
The list of available modules and the parameters to be used for each one is defined in the attached documentation of the SAP plugin located in the Pandora FMS library, available at the following link : [https://pandorafms.com/library/sap-r3-monitoring-agent/](https://pandorafms.com/library/sap-r3-monitoring-agent/)
# Manual execution The format of the plugin execution is as follows: ```shell ./pandora_sap_deset \ --conf < path to the configuration file > \ [ --custom_modules < path to the file containing the list of custom modules to monitor > ] ``` Example ```shell ./pandora_sap_deset \ --conf /usr/share/pandora_server/util/plugin/sap.conf \ --custom_modules /usr/share/pandora_server/util/plugin/sap_custom_modules.conf ``` # Discovery This plugin can be integrated with Pandora FMS Discovery. To do so, you must load the ".disco" package that you can download from the Pandora FMS library: [https://pandorafms.com/library/](https://pandorafms.com/library/) [](https://pandorafms.com/guides/public/uploads/images/gallery/2023-06/image-1687944659047.png) Once loaded, SAP environments can be monitored by creating Discovery tasks from the Management > Discovery > Applications section. [](https://pandorafms.com/guides/public/uploads/images/gallery/2023-06/image-1687944773252.png) The following minimum data will be requested for each task: - **SAP Hostname**:IP or FQDN of the SAP environment to monitor. - **SAP Client**: SAP client/commander to monitor. - **SAP System Number**: Number of the SAP system to monitor. - **SAP License:** License provided by Pandora FMS to use the plugin. If you do not have a license, you can use the trial mode using the "trial" value. - **SAP Credentials**: SAP credentials to connect to the environment to monitor. These credentials will be created in the Pandora FMS console credentials store. [](https://pandorafms.com/guides/public/uploads/images/gallery/2023-05/image-1684835243175.png) You can also adjust the task configuration to customize the desired monitoring: - **Max threads**: to optimize execution time, multiple threads may be configured to monitor the task modules. Keep in mind that configuring multiple threads may increase the task CPU usage. - **Target agent:** Name of the target agent in which the indicated modules will be created. If no agent name is specified, the SAP Hostname will be used instead. - **SAP modules**: From a list of predefined modules, the elements to be monitored in the SAP environment can be selected. - **Custom modules definitions**: Custom modules definition block. Each line of the block will be a module to monitor, indicating for each case name, data type and SAP plugin parameters to obtain the data. Each line must have the format: `Average time of SAPGUI response | 102 |
Dialog Logged users | 103 |
SAP Idoc erroneus | 104 |
SAP IDOC OK | 105 |
SAP Dumps | 109 |
SAP List lock | 111 |
SAP Cancel Jobs | 113 |
Number of Update WPs in error | 116 |
SAP Batch input erroneus | 121 |
SAP WP without active restart | 150 |
SAP WP stopped | 151 |
SAP Login OK | 160 |
SYSFAIL, delivery attempts tRFC wrong entries number | 192 |
SYSFAIL, queue qRFC INPUT, wrong entries number | 195 |
The list of total available modules that can be included in the customized module monitoring is defined in the attached documentation of the SAP plugin located in the Pandora library, which can be found at the following link: [https://pandorafms.com/library/wp-content/uploads/2022/03/Guia\_instalacion\_SAP\_EN.Anexos\_v4.pdf](https://pandorafms.com/library/wp-content/uploads/2022/03/Guia_instalacion_SAP_EN.Anexos_v4.pdf)