What Are SAP Monitoring Plugins?
The SAP Monitoring Plugins are a collection of programs that allow you to monitor SAP Systems and Landscapes.
They are a sample implementation of the shared lib sap_moni.so which is freely available and give you the possibility to write own plugins or other tools.
The SAP Monitoring Plugins consists of five programs:
Configuring SAP Monitoring Plugins?
To configure the Plugins you need four files in /etc/sapmon
/etc/sapmon/agent.cfg
Configures which datas will be collected from SAP-System.
It has a template syntax. You can choose between an easy syntax or
advanced syntax.
[TEMPLATE_ | |
DESCRIPTION = Description of the Templates | e.g. simple Template |
SYSTEM = SID | e.g. BCE | BC? | B* |
APPL-SERVER = APPL-SERVER | e.g. bcemain_BCE_26 | bce* | * |
VALUE = VALUE | e.g. DIALOG_RESPONSE_TIME |
[TEMPLATE_ | |
DESCRIPTION = Description of the Templates | e.g. simple Template |
MONI_SET_NAME= MONISET | e.g. "SAP ADMIN TEMPLATE" |
MONI_NAME= Monitor of the set | e.g. "Operating System" |
MAX_TREE_DEPTH = n | e.g. 3 |
PATTERN_0=SID\Context\Monitorobject\Monitorattribut | e.g. BCE\bcemain_BCE_26\CPU\CPU_UTILIZATION |
PATTERN_ | e.g. BCE\bcemain_BCE_26\CPU\CPU_UTILIZATION |
/etc/sapmon/moni_tr.cfg
The moni_tr.cfg defines the translation from the simple syntax to the advanced syntax.
[TEMPLATE_TEST]
SYSTEM = BCE
APPL-SERVER = *
VALUE = DIALOG_RESPONSE_TIME
is translated to
[TEMPLATE_TEST]
MONI_SET_NAME="SAP ADMIN TEMPLATE"
MONI_NAME="Dialog Overview"
PATTERN_0="BCE\*\DIALOG\DIALOGRESPONSETIME"
The entry in the moni_tr.cfg looks like:
DIALOG_RESPONSE_TIME#SAP ADMIN TEMPLATE# Dialog Overview#DIALOG\DIALOGRESPONSETIME
That means that for the VALUE=DIALOGRESPONSETIME the Monitor "Dialog Overview" from the
monitorset "SAP ADMIN TEMPLATE" is loaded.
The pattern is concatenated to
You can easily enhance the moni_tr.cfg.
/etc/sapmon/logon.cfg
The connection to the R/3 system is an RFC-Connection.
Thus this you need the system- and logon-data.
[LOGIN_templatename]
LOGIN=Arguments
Arguments:
-D -u -p -c |
-d -u -p -c -h -s [ -l -t -g -x ]
-d destination
-D destination, uses saprfc.ini
-u userid
-p password
-c client
-l language
-t Trace
-h hostname
-s system number
-g gateway host
-x gateway service
You can decide if you want to use the saprfc.ini
If you want to use the saprfc.ini: -D Destination -u user -p passwd -c client.
The destination must exist in the saprfc.ini
Otherwise: -d Destination -u user -p passwd -c client -h hostname -s system number
Example:
[LOGIN_BCE]
LOGIN=-d BCE -u ag_t -p *** -h bcemain -s 26
/etc/sapmon/sshconfig
To start and stop an R/3-System ssh is used.
If you don't have the possibility to see the output via X11-Forwarding, the
commands are executed in background. Thus they are executed in background you can't
enter a password.
The sshconfig is used to disable the password prompt if it runs in background.
Example:
PasswordAuthentication no
Configure a hostauthentification between nagios host (root) and SAP-host (sidadm)
Configuring Nagios
Now we can configure nagios. There is nothing special to do:
We have our five plugins with the following commands:
Enhanced Functionality
You can not only get data from an R/3-System, you have some extra features in nagios.
If the host-alias is an SAP-Alias (Appl.server_SID_Systemnr) you can start/stop R/3 systems.
You can also open an ssh-connection to the host or open an SAPGUI.
At last you can change the thresholds.
After you clicked on the hostname, a menue opens where you can start/stop SAP-Systems or
open a SAPGUI or a ssh-connection.
You can change the thresholds after a click of the values.