Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Since Checkmk 1.5 it is possible to monitor SAP HANA. The easiest way to get the Plugin working is to use the Agent Bakery: WATO - CONFIGURATION → Monitoring Agents → Rules → AGENT PLUGINS → SAP HANA.

In this manual we will explain all configuration options for SAP Hana. Especially the options of sap_hana.cfg if the use of the Agent Bakery is not possible.

Table of Contents

SAP HANA Config example

Note: Please don't modify sap_hana.cfg if you're using the Agent Bakery.

1. Example: Credentials = User and password / RUNAS = instance / SID = XYZ

Code Block
title/etc/check_mk/sap_hana.cfg
linenumberstrue
USER=kdeadm
PASSWORD=xyz
RUNAS=instance
SID=XYZ


2. Example: Credentials = User and password / RUNAS = agent / SID = XYZ

Code Block
title/etc/check_mk/sap_hana.cfg
linenumberstrue
USER=kdeadm
PASSWORD=xyz
RUNAS=agent
SID=XYZ


3. Example: Credentials = USERSTOREKEY / RUNAS = instance or agent / SID = XYZ

Code Block
title/etc/check_mk/sap_hana.cfg
linenumberstrue
USERSTOREKEY=xxx
RUNAS=instance
SID=XYZ

Note: The configuration of the SID in the sap_hana.cfg is optional. The agent plugin detects the SID automatically

4. Example: Credentials for Connect (ODBC interface)

With Werk #10937 (Checkmk 2.0) we introduced a new check to monitor the status of SAP HANA Connect. It supports HANA V1.0 and HANA 2.0. In order to get the needed data from SAP HANA, you need to update the agent plugin "mk_sap_hana" as well. 

Info
titleSetup > Monitoring Agents > SAP HANA > Edit rule: SAP HANA


Code Block
title/etc/check_mk/sap_hana.cfg
linenumberstrue
...
PASSWORD_CONNECT="123"
USER_CONNECT="hana"
...


5. Difference between RUNAS=agent and RUNAS=instance

Code Block
linenumberstrue
++ credentials='-u SAP_MON -p Hana4us1'
++ '[' agent = agent ']'
+++ /usr/sap/KDE/HDB00/exe/hdbsql -C '-F;' -x -a -n localhost -i 00 '-u SAP_MON -p Hana4us1' 'SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME='\''Version'\'' or NAME='\''All Started'\'' '

→ With RUNAS=agent the Checkmk Agent tries to execute the mk_sap_hana Plugin


Code Block
linenumberstrue
su - hp1adm -c '/usr/sap/HP1/HDB00/exe/hdbsql -C -F\; -x -a -n localhost -i 00 -u SAPCMK -p CMK#123 "SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME='\''Version'\'' or NAME='\''All Started'\''"'

→ With RUNAS=instance the Checkmk Agent connects with the SAP instance user to the database

Debugging

Execute plugin manually

For testing and diagnosis you can execute the plugin manually. You need to set 'MK_CONFDIR' that mk_sap_hana can find the configuration file which is stored in /etc/check_mk

Code Block
linenumberstrue
MK_CONFDIR=/etc/check_mk /usr/lib/check_mk_agent/plugins/mk_sap_hana


Debug Log

The mk_sap_hana Plugin provides a detailed log. Therefore, you can use --debug. Please redirect the output to a file for a better overview.

Code Block
linenumberstrue
MK_CONFDIR=/etc/check_mk /usr/lib/check_mk_agent/plugins/mk_sap_hana --debug


SQL Statements

For debugging, it can be useful to execute some SQL-Statements manually. Please check out the debug log for more information.

Here is one example for SAP HANA Status:

Code Block
linenumberstrue
su - <INSTANCE_USER>
/usr/sap/KDE/HDB00/exe/hdbsql -C '-F;' -x -a -n localhost -i 00 '-u BECHTLE_MON -p Hana4us1' 'SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME='\''Version'\'' or NAME='\''All Started'\'' '



Related articles

Content by Label
showLabelsfalse
max5
spacesKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("sap","hana","mk_sap_hana","sap_hana_cfg") and type = "page" and space = "KB"
labelssap hana sap_hana_cfg mk_sap_hana

Page properties
hiddentrue


Related issues