SAP HANA Monitoring Help

when i use the service configuration it shows the error message, WARNING: Parsing of section sap_hana_status failed - please submit a crash report!

it only finds 2 services one of them is unknown and it says “ESS state Unknown [Welcome to the SAP HANA Database interactive terminal.] Timestamp: not available”

the other is critical with “unacknowledged messages have exceeded max size,…”

does someone know how to fix this?

Hello,

It would be helpful to know what checkmk version you are running.
An agent output would also be helpful.

regards

Michael

the check_mk version is 2.0.0p21
the agent version is 1.6.0p3

i cannot provide an agent report due to security reasons

but when it goes to (at the very button from the agent report)
<<< job >>>
<<< local >>>
<<<sap_hana_status:sep(59>>>
[[SID 00]]

Welcome to the SAP HANA Database Interactive terminal.

Type: \h for help with commands
/\q to quit
<<<sap_hana_backup:sep(59)>>>
[[SID 00]]
Welcome to the SAP HANA Database Interactive terminal.

Type: \h for help with commands
/\q to quit

and so on
it’s always that message

thanks in advance

Is your configuration correct?

USAGE:
  mk_sap_hana [OPTIONS]
DESCRIPTION:
  Check_MK agent plugin for monitoring SAP HANA databases.
  To make this plugin work you have to configure
  - USERSTOREKEY or
  - USER and PASSWORD
  ie. USERSTOREKEY=SVAMON and SID=I08 means we need a key
  for SVAMONI08 in the HDB userstore specified in
  \$MK_CONFDIR/sap_hana.cfg
  Moreover you can configure 'RUNAS' with the following values:
  - 'agent' or
  - 'instance'
  Use the FQDN in the query if HOSTNAME is not set, other the
  short hostname.
OPTIONS:
  -h, --help              Shows this help message and exit
  --debug                 Enable full bash debugging

Run the plugin with option --debug to show more details.

the config looks like this

USER=***
PASSWORD=***
RUNAS=instance
SID=***

it’s in /etc/check_mk

with wich command can i debug it ?
./ mk_sap_hana - - debug?
and do i need to put in the hostname too?
thanks for the fast response

Hi @maliceatthepalace,

your output sounds a bit like the problem described in the solution Monitoring SAP R/3 + SAP HANA - #19 by louis. Please check if it is working for you.

Can you please also check the output with the new agent and especially with the plugin from 2.0? Between 1.6 and 2.0 there are several changes at the HANA plugin which my fix your problem.

hey,
it is not working for me but i read in a previous post of him, that he is using the user store key instead of user and password, iam using user and password and the version 2.0 of the plugin
i provide you the result →
if [ “$RUNAS” = “agent” ]; then
result =“$(${hdbsql_path} -C -F; -x -a -n localhost -i “${instance}” ${credentials} “$query” 2>/dev/null)”
else

i set the RUNAS in the sap_hana.cfg to agent
it’s not working, i tried with quotes without quotes even at ${instance} but i can’t get it working correctly

the agent version is 1.6 and we are not able to upgrade it because we would need to contact an external business to upgrade it for us and rn it’s just not possible

i need to have it running as instance btw, if i set runas to agent, the 2 services that i described in the main post would vanish

could u please provide your .cfg file and the source code of your mk_sap_hana?

without real passwords, i just wanna check why it’s not working

thanks in advance, and thanks for all the response so far

You need to set the config path:

 export MK_CONFDIR=/etc/check_mk/

then run the plugin with the option --debug

We did a complete new development of this plugin but it works only with storekey and we stripped out several checks which are not relevant for us. I guess it will not help you.

regards

Michael

thanks for ur response :),
could you please provide me the source code of your plugin? if not it’s also fine but it would still help me in some way if i could read the code

can u plz give me an exact example when u debug the plug-in ? no matter what os u are using, i just don’t kno how to do it since iam “just” an intern and also i need to explain my superior what iam exactly doin, before being allowed to do something

thanks in advance :wink:

Here we go:
mk_sap_hana.sh (10.4 KB)

I use debugging in case a situation is not clear. Normal plugin output suppress STDERR so we will not see any errors from code. As the code in the plugin is ‘open’ and your DBA allows your user for monitoring read only access there is no risk to use the plugin in debugging mode.

BR

Michael

MK_CONFDIR=/etc/check_mk/ /usr/lib/check_mk_agent/plugins/sap_hana --debug (the filename may differs)

This is the call to run the plugin in debug mode. It simply enables the debug function for bash (set -x). For more information of this function please refer to the man page of bash and bash built in commands (man bash and man set).

thank u so much :slight_smile:
is your config file still in etc/check_mk?
and how do i make a userstorekey? do i need to change something in hanastudio or cockpit for that? if yes what exactly
and thanks for ur help man, it means a lot!

As written in the code:

# Get the config
# The config file is a BASH array
# dbs = (sysid,key,db sysid,key,db)
# Each DB has a unique KEY!
# Fills array $dbs
#. ${MK_CONFDIR}/sap_hana_tenant.cfg

I am sorry but I cannot help with any SAP HANA specific settings. This is done by our DB experts.

# hdbuserstore --help
Usage: hdbuserstore [options] command [arguments]

Options:
  -u <USER>       perform operation for other operating system user
  -v              verbose mode, print operations done
  -i              interactive mode, ask for missing values
  -h              this help message
  -H <HOST>       assume host name <HOST>
Commands (the command name is case insensitive):
  Help
        Print help message.
  Set <KEY> <ENV>[@<DATABASE>] <USERNAME> <PASSWORD>
        Add or update a profile entry.
        <KEY>       entry key name
        <ENV>       database location (host:port)
        <USERNAME>  user name
        <PASSWORD>  password
        <DATABASE>  database name in MDC environment
  AddFromDir <DIR>
        Add entries from a store in <DIR> without overwriting existing keys.
        <DIR>       store directory from which entries to be read
  Delete <KEY>
        Delete entry with key <KEY>.
  List [<KEY> ...]
        List entries of store. The passwords are not shown.
  ListFromDir <DIR>
        List entries from a store in <DIR>.
        <DIR>       store directory from which entries to be read
  ChangeKey
        Generate new encryption key and encrypt passwords again.
        Also compact the store by removing records that are marked deleted.
        NOTE: The ChangeKey command is recommended for use within a
              maintenance windows only (while there are no concurrent accesses
              to the store).
Operation succeed.

But as @mike1098 mentioned, this is something your DBA should provide you with. At the end you only need the name of the user which is stored inside the hdbuserstore.

little note:
you actually only need the name of the “entry” in the user store, that could be the same as the user name within the hana DB, but it doesn’t have to be.

1 Like

thanks to everyone that helped me throughout the last days. i finally found a solution and it wasn’t a checkmk problem or a HANA problem.

the password provided in my .cfg had a # at the end and bash interpreted it as the start of a comment :upside_down_face:

bc i’m an intern/student and literally don’t have any experience with sap or hana or checkmk or the linux distro we r using, i assumed that it was right but it wasn’t

so thanks again to everyone
enjoy your day/night/life whatever
bye :))

hi again haha,

would u share your config files with me? (without passwords n stuff) i just want to kno how to separate tenant and systemdb

I would love but it will not help you because I did a complete rewrite of the agent plugin which also use a different structure in the config file.

Sorry

Michael

haha np mate, thanks anyways :slight_smile:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.