SAP R3 - Deset
This document describes the SAP functionality of PandoraFMS discovery.
- Introduction
- Prerrequisites
- Parameters and configuration
- Manual execution
- Discovery
- Vista de SAP
- Módules generated by the plugin
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"
-
- Authorization Object "S_RFC":
- 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:
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 |
Configuration file (--conf)
The contents of the file will be as follows:
agents_group_id = < ID of the group in which the task agent will be created >
threads = < Number of threads to be used for module creation >
interval = < Agent monitoring interval in seconds >
server = < SAP server IP >
client = < SAP client number >
system = < SAP system number >
license = < License code >
credentials = < Base 64 of the JSON with credentials >
agent = < Target agent name >
modules = < JSON list of predefined modules to be monitored >
Example
agents_group_id = 10
threads = 5
interval = 300
server = 192.168.80.191
client = 001
system = 00
license = 022220743456700424
credentials = asJ1c2VyIjoiGBTREjUiLCJwYXNzd29yZCI6IklOKJNJQUwifQ==
agent = SAP_R3
modules = [192,195]
Credentials
The credentials to be entered in the "credentials" option of the configuration file described above are a code base 64 of a JSON with the following format:
{"user":"< user >","password":"< password >"}
JSON example
{"user":"SAP_USER","password":"JhGBf76@db!"}
This JSON should be converted to base 64 and the result would be a string like the following, which is what should be entered in the "credentials" option of the :
eyJ1c2VyIjoiU0FQX1VTRVIiLCJwYXNzd29yZCI6IkpoR0JmNzZAZGIhIn0=
List of customized modules (--custom_modules)
The content of the file will be a list of modules, separating the creation of each one in different lines. This format must be used for the creation of these modules:
< Module name >;< Module type >;< SAP module creation parameters >
Example
SAP info;generic_data_string;-m 120
SAP Mem Max;generic_data;-m 101
SAP Login users;generic_data_string;-m 103
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/
Manual execution
The format of the plugin execution is as follows:
./pandora_sap_deset \
--conf < path to the configuration file > \
[ --custom_modules < path to the file containing the list of custom modules to monitor > ]
Example
./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/
Once loaded, SAP environments can be monitored by creating Discovery tasks from the Management > Discovery > Applications section.
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.
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:
<module_name>;<module_type>;<check_definition>
Example:
SAP info;generic_data_string;-m 120
Tasks that are successfully completed will have an execution summary with the following information:
- SAP Target: Monitored SAP target environment.
- SAP Client: Monitored SAP client/commander.
- SAP System: Number of monitored SAP system.
- Total modules: Total modules generated for the target SAP environment.
Tasks that are not completed successfully will have an execution summary recording the errors that occurred.
Vista de SAP
Allows you to view the general status of SAP servers:
This view shows a panel with the available SAP modules of the selected SAP agent. You can select the refresh time and the interval to display in the graphs.
Módules generated by the plugin
The plugin will create an agent for the target server. This agent will contain the following predefined modules (if they have been included in the "modules" option in the configuration file):
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 plugin will also create a module for each custom module defined in the configuration file that is called using the --custom_modules parameter.
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