Cannot determine port due to unknown HANA version

Hello people :slight_smile:
I am quite fresh into monitoring but an old one in IT wonderland.
Have set to monitor a VM in cloud that sits on RHEL for SAP and hosts a HANA database.
Probably have not set the options right as I get the alarm as this:
“Cannot determine port due to unknown HANA version.”
I know it is HANA V2 but plugin that I have put into the agent, somehow is not able to read it.
Further more the whole ahent is “flapping” on this machine sa system user keeps deactivating it:
" 1 static service deactivating (user@1002)CRIT , Service ‘check-mk-agent@339-10.115.19.145:6556-10.115.6.75:48072’ activating for: 0.00 s".
User@1002 is a HANA DB adm user.
From SAP people I have been asked as to which kind of user I wish them to create for my monitoring purposes and I have told the (found on some forum) that it is sufficient to allocate the monitoring role to this user.
The meny for setting up the plugin is as simple as it gets but…
SAP people choose to use USR/PWD option rather that userstore key.
The same error I have when using just the credentials, combining with ODBC access with same USR/PWD, using USR/PWD for DBadm user for ODBC access or vice cersa.
Where did I go wrong?

Hi,

Don’t know if it helps, but I never got User/Password to work either. But with userstore it finally started working. You may want to give that a try.

Louis.

1 Like

Thankx Louis.
I have done this BUT the problem persists - still can not retrive the DB version and hence - no additional data.
Step ahead is that now the DBadm user does not keep stopping the check_mk agents process.

What do you get as an output of this commant (args in curly brackets need to be replaced with yourown data)?

If you use username and password:
sudo su - {hostname} -c ‘/usr/sap/{sid}/HDB{instance_number}/exe/hdbsql -C -F; -x -a -n localhost -i {instance_number} -d SYSTEMDB -u {user} -p {password} "SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME=’’‘Version’’’ or NAME=’’‘All Started’’’ "’

If you use userstore:
sudo su - {hostname} -c ‘/usr/sap/{sid}/HDB{instance_number}/exe/hdbsql -C -F; -x -a -n localhost -i {instance_number} -d SYSTEMDB -U {userstorekey} "SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME=’’‘Version’’’ or NAME=’’‘All Started’’’ "’

1 Like

Thank you Sofia.
Before checking I need some more clarification :

  1. This should be executed on the target (monitorred) machine?
  2. Where do I find “instance_number”? Ask it from SAP admin?
    Maybe I have to clarify myself - I amd doing just monitoring and there is OS admin and SAP admin (for the monitored machine) whom I have to ask to perform actions there.

Yes, this should be executed on a monitored host.
SAP admins should definitely know an instance number. It can be fetched with a “SELECT * FROM SYS.M_SYSTEM_OVERVIEW;” query.

1 Like

Take a look at the file /usr/sap/sapservices there maybe several lines of you running sap instances on this host.
There is the path to the sap profile file similar to pf=/usr/sap/<DBINST>/SYS/profile/<DBINST>_HDB<XX>_<hostname>. The <XX> is the instance number you are looking for. Another way is to change to the DB-User and take a look at the env. There are several variables which have the instance number included (like $DIR_INSTANCE, don’t use $SAPSYTEMNAME, this number can sometimes differ from the instance number you need).

1 Like

The best way to not mess around with usernames an password is to use the userstore. Tell your sap admins or HANA database admins to preconfigure the userstore for you and name the user same on each system. SAP recommends to name it MONITOR like the role the user needs at database level.
Important, if the HANA system is a failover cluster (replications cluster) the cluster connection need to be defined in the user store and also on all nodes (applies for scale-out-systems too).

1 Like

Well - finally I have got gathered OS admin and SAP admin at the same time and we have garnered information that should be sufficient for solving the problem.
The database is v2 and is a multitenant DB, where the script assuming that the port from the version can not be used as such.
The question is - if there are fields to be filled manually, such as IP, hostname, agent/instance, usr/pwd/userstorekey - for multitenant DB with separate ports for each tenant, - where could be filled instance number and port to connect to the DB?

Additionally - if there are many wariants, depending on the installation options:
https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.03/en-US/b250e7fef8614ea0a0973d58eb73bda8.html

Why the script is locked to the logic that v2 = 3"instance"13?
image

Should it be better that the determination of the port, instance, and the version be left to the monitoring admin, by manually entering those data, while tuning the plugin?

The management port is fix due to the HANA version, that’s why it’s also fixed in the agent plugin.
The connection information are stored within the userstore, so if you use this method, you don’t need to configure this inside checkmk.

1 Like

It does not look fixed to me in SAP help page.
If the simple case is - than it is fixed, BUT if it is a multitenant (like mine :slight_smile: ) - than things get complicated and less fixed.
Anyway - I have determined that agent can communicate on both ports (30013 and 30015) with the DB as both ports are open and can be accessed via management tool, using user, dedicated for monitoring purposes and defined in the agent.
Now I do not have any alarm BUT:

  1. there is no additional data from HANA, to be seen
  2. there is no evidence in the DB that this user has ever logged in

What do I miss?
This is THE situation known as “all is well but does not work”.

Your primary connection is against the system database and this is always reachable via 3xx13 (HANA 1.0) and 3xx15 (HANA 2.0) which isn’t, as far as i know, configurable and where xx is the instance number.
Can you run the plugin directly from the command line of the client?
MK_CONFDIR=/etc/check_mk/ /usr/lib/check_mk_agent/plugins/sap_hana --debug
(contains sensible information, don’t post ist without censoring it)

This could give you some hints whats may going wrong.

1 Like

I have run the suggested command with OS admin at the console and here is the result: (as in my current situation - here I have a seriosu limitation - not allowed to upload files)
Aside of the fact that there is no replication defined - I do not see any flaw in output.
Maybe the SAP admin failed to mention that there is nothing to monitor yet? :slight_smile:

  • shift
  • test -n 2
  • case “$1” in
  • shift
  • test -n ‘’
  • ‘[’ -e /etc/check_mk//sap_hana.cfg ‘]’
  • . /etc/check_mk//sap_hana.cfg
    ++ USERSTOREKEY=usercensored
  • ‘[’ -z usercensored ‘]’
  • ps -efw
  • grep ‘[H]DB.*sapstartsrv’
  • read -r line
    ++ echo ‘admcensored 6806 1 0 Nov18 ? 00:00:27 /usr/sap/SIDcensored/HDB00/exe/sapstartsrv pf=/usr/sap/SIDcensored/SYS/profile/SIDcensored_HDB00_censored -D -u admcensored’
    ++ sed ‘s/./(.)/./exe/sapstartsrv./\1/g’
  • SID=SIDcensored
    ++ echo ‘admcensored 6806 1 0 Nov18 ? 00:00:27 /usr/sap/SIDcensored/HDB00/exe/sapstartsrv pf=/usr/sap/SIDcensored/SYS/profile/SIDcensored_HDB00_censored -D -u admcensored’
    ++ sed -e ‘s/./(.)/exe/sapstartsrv.*/\1/g’ -e ‘s/[^0-9]//g’
  • INSTANCE=00
    ++ echo ‘admcensored 6806 1 0 Nov18 ? 00:00:27 /usr/sap/SIDcensored/HDB00/exe/sapstartsrv pf=/usr/sap/SIDcensored/SYS/profile/SIDcensored_HDB00_censored -D -u admcensored’
    ++ grep -Po ‘^\s*(\w+)’
  • INSTANCE_USER=admcensored
  • ‘[’ -z 00 ‘]’
  • ‘[’ -z SIDcensored ‘]’
  • do_query SIDcensored 00 admcensored
  • local SID=SIDcensored
  • local INSTANCE=00
  • local INSTANCE_USER=admcensored
  • local HOSTNAME
  • local ‘INSTANCE_NAME=[[SIDcensored 00]]’
  • local SAP_LANDSCAPE
    ++ su - admcensored -c ‘python /usr/sap/SIDcensored/HDB00/exe/python_support/landscapeHostConfiguration.py’
  • SAP_LANDSCAPE=’| Host | Host | Host | Failover | Remove | Storage | Storage | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host | Host | Worker | Worker |
    | | Active | Status | Status | Status | Config | Actual | Config | Actual | Config | Actual | Config | Actual | Config | Actual | Config | Actual |
    | | | | | | Partition | Partition | Group | Group | Role | Role | Role | Role | Roles | Roles | Groups | Groups |
    | ---------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------ | ------ | ------- | ------- |
    | censored | yes | ok | | | 1 | 1 | default | default | master 1 | master | worker | master | worker | worker | default | default |

overall host status: ok’

  • ‘[’ -z ‘’ ‘]’
    ++ sap_hana_host_from_landscape '| Host | Host | Host | Failover | Remove | Storage | Storage | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host | Host | Worker | Worker |
    | | Active | Status | Status | Status | Config | Actual | Config | Actual | Config | Actual | Config | Actual | Config | Actual | Config | Actual |
    | | | | | | Partition | Partition | Group | Group | Role | Role | Role | Role | Roles | Roles | Groups | Groups |
    | ---------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------ | ------ | ------- | ------- |
    | censored | yes | ok | | | 1 | 1 | default | default | master 1 | master | worker | master | worker | worker | default | default |

overall host status: ok’
++ local 'landscape=| Host | Host | Host | Failover | Remove | Storage | Storage | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host | Host | Worker | Worker |
| | Active | Status | Status | Status | Config | Actual | Config | Actual | Config | Actual | Config | Actual | Config | Actual | Config | Actual |

Partition Partition Group Group Role Role Role Role Roles Roles Groups Groups
censored yes ok 1 1 default default master 1 master worker master worker worker default default

overall host status: ok’
++ local col_hosts=1
++ local row_hosts_start=5
++ local cur_row=1
++ local cur_hostname
++ local cur_IP
++ read -r line
++ [[ | != | ]]
+++ echo ‘| Host | Host | Host | Failover | Remove | Storage | Storage | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host | Host | Worker | Worker |’
+++ sed -e ‘s/^|//’
++ line=’ Host | Host | Host | Failover | Remove | Storage | Storage | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host | Host | Worker | Worker |’
++ ‘[’ 1 -ge 5 ‘]’
++ cur_row=2
++ read -r line
++ [[ | != | ]]
+++ echo ‘| | Active | Status | Status | Status | Config | Actual | Config | Actual | Config | Actual | Config | Actual | Config | Actual | Config | Actual |’
+++ sed -e ‘s/^|//’
++ line=’ | Active | Status | Status | Status | Config | Actual | Config | Actual | Config | Actual | Config | Actual | Config | Actual | Config | Actual |’
++ ‘[’ 2 -ge 5 ‘]’
++ cur_row=3
++ read -r line
++ [[ | != | ]]
+++ echo ‘| | | | | | Partition | Partition | Group | Group | Role | Role | Role | Role | Roles | Roles | Groups | Groups |’
+++ sed -e ‘s/^|//’
++ line=’ | | | | | Partition | Partition | Group | Group | Role | Role | Role | Role | Roles | Roles | Groups | Groups |’
++ ‘[’ 3 -ge 5 ‘]’
++ cur_row=4
++ read -r line
++ [[ | != | ]]
+++ echo ‘| ---------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------ | ------ | ------- | ------- |’
+++ sed -e ‘s/^|//’
++ line=’ ---------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------ | ------ | ------- | ------- |’
++ ‘[’ 4 -ge 5 ‘]’
++ cur_row=5
++ read -r line
++ [[ | != | ]]
+++ echo ‘| censored | yes | ok | | | 1 | 1 | default | default | master 1 | master | worker | master | worker | worker | default | default |’
+++ sed -e ‘s/^|//’
++ line=’ censored | yes | ok | | | 1 | 1 | default | default | master 1 | master | worker | master | worker | worker | default | default |’
++ ‘[’ 5 -ge 5 ‘]’
+++ echo ’ censored | yes | ok | | | 1 | 1 | default | default | master 1 | master | worker | master | worker | worker | default | default |’
+++ awk -F ‘|’ ‘{print $col}’ col=1
+++ sed -e ‘s/^[[:space:]]//’ -e 's/[[:space:]]$//’
++ cur_hostname=censored
++ [[ -z censored ]]
+++ nslookup censored
+++ grep Address
+++ grep -v ‘#’
+++ awk ‘{print $2}’
++ cur_IP=
++ [[ -z ‘’ ]]
++ continue
++ read -r line
++ [[ ‘’ != | ]]
++ break

  • HOSTNAME=
    +++ query_sap_hana_status
    +++ cat
    ++ mk_hdbsql SIDcensored 00 admcensored ‘SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME=’’‘Version’’’ or
    NAME=’’‘All Started’’’’
    ++ local sid=SIDcensored
    ++ local instance=00
    ++ local instance_user=admcensored
    ++ local query
    +++ echo ‘SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME=’’‘Version’’’ or
    NAME=’’‘All Started’’’’
    +++ tr ‘\n’ ’ ’
    ++ query=‘SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME=’’‘Version’’’ or NAME=’’‘All Started’’’ ’
    ++ local credentials
    ++ local hdbsql_path=/usr/sap/SIDcensored/HDB00/exe/hdbsql
    ++ ‘[’ -n usercensored ‘]’
    ++ credentials=’-U usercensored’
    ++ ‘[’ ‘’ = agent ‘]’
    +++ su - admcensored -c ‘/usr/sap/SIDcensored/HDB00/exe/hdbsql -C -F; -x -a -n localhost -i 00 -U usercensored "SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME=’’‘Version’’’ or NAME=’’‘All Started’’’ "’
    ++ result=
    ++ rc=3
    ++ echo ‘’
    ++ sed -e ‘s/^;//’ -e ‘s/;$//’
    ++ return 3
  • status_output=
  • echo ‘<<<sap_hana_replication_status>>>’
    <<<sap_hana_replication_status>>>
  • echo ‘[[SIDcensored 00]]’
    [[SIDcensored 00]]
  • sap_hana_replication_status SIDcensored 00 admcensored
  • local sid=SIDcensored
  • local instance=00
  • local instance_user=admcensored
    ++ su - admcensored -c ‘python /usr/sap/SIDcensored/HDB00/exe/python_support/systemReplicationStatus.py’
  • result=‘this system is not a system replication site’
  • echo ‘systemReplicationStatus: 10’
    systemReplicationStatus: 10
  • echo ‘this system is not a system replication site’
    this system is not a system replication site
  • ‘[’ -v PASSWORD_CONNECT ‘]’
  • read -r line

Can you please use the preformatted text function? This output is nearly unreadable because the forum software uses some special characters to format the text.

1 Like

Like this?
I do not see anything out of the ordinary.

+ shift
+ test -n 2
+ case "$1" in
+ shift
+ test -n ''
+ '[' -e /etc/check_mk//sap_hana.cfg ']'
+ . /etc/check_mk//sap_hana.cfg
++ USERSTOREKEY=usercensored
+ '[' -z usercensored ']'
+ ps -efw
+ grep '[H]DB.*sapstartsrv'
+ read -r line
++ echo 'admcensored    6806     1  0 Nov18 ?        00:00:27 /usr/sap/SIDcensored/HDB00/exe/sapstartsrv pf=/usr/sap/SIDcensored/SYS/profile/SIDcensored_HDB00_censored -D -u admcensored'
++ sed 's/.*\/\(.*\)\/.*\/exe\/sapstartsrv.*/\1/g'
+ SID=SIDcensored
++ echo 'admcensored    6806     1  0 Nov18 ?        00:00:27 /usr/sap/SIDcensored/HDB00/exe/sapstartsrv pf=/usr/sap/SIDcensored/SYS/profile/SIDcensored_HDB00_censored -D -u admcensored'
++ sed -e 's/.*\/\(.*\)\/exe\/sapstartsrv.*/\1/g' -e 's/[^0-9]//g'
+ INSTANCE=00
++ echo 'admcensored    6806     1  0 Nov18 ?        00:00:27 /usr/sap/SIDcensored/HDB00/exe/sapstartsrv pf=/usr/sap/SIDcensored/SYS/profile/SIDcensored_HDB00_censored -D -u admcensored'
++ grep -Po '^\s*(\w+)'
+ INSTANCE_USER=admcensored
+ '[' -z 00 ']'
+ '[' -z SIDcensored ']'
+ do_query SIDcensored 00 admcensored
+ local SID=SIDcensored
+ local INSTANCE=00
+ local INSTANCE_USER=admcensored
+ local HOSTNAME
+ local 'INSTANCE_NAME=[[SIDcensored 00]]'
+ local SAP_LANDSCAPE
++ su - admcensored -c 'python /usr/sap/SIDcensored/HDB00/exe/python_support/landscapeHostConfiguration.py'
+ SAP_LANDSCAPE='| Host       | Host   | Host   | Failover | Remove | Storage   | Storage   | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host   | Host   | Worker  | Worker  | 
|            | Active | Status | Status   | Status | Config    | Actual    | Config   | Actual   | Config     | Actual     | Config      | Actual      | Config | Actual | Config  | Actual  | 
|            |        |        |          |        | Partition | Partition | Group    | Group    | Role       | Role       | Role        | Role        | Roles  | Roles  | Groups  | Groups  | 
| ---------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------ | ------ | ------- | ------- | 
| censored | yes    | ok     |          |        |         1 |         1 | default  | default  | master 1   | master     | worker      | master      | worker | worker | default | default |

overall host status: ok'
+ '[' -z '' ']'
++ sap_hana_host_from_landscape '| Host       | Host   | Host   | Failover | Remove | Storage   | Storage   | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host   | Host   | Worker  | Worker  | 
|            | Active | Status | Status   | Status | Config    | Actual    | Config   | Actual   | Config     | Actual     | Config      | Actual      | Config | Actual | Config  | Actual  | 
|            |        |        |          |        | Partition | Partition | Group    | Group    | Role       | Role       | Role        | Role        | Roles  | Roles  | Groups  | Groups  | 
| ---------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------ | ------ | ------- | ------- | 
| censored | yes    | ok     |          |        |         1 |         1 | default  | default  | master 1   | master     | worker      | master      | worker | worker | default | default |

overall host status: ok'
++ local 'landscape=| Host       | Host   | Host   | Failover | Remove | Storage   | Storage   | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host   | Host   | Worker  | Worker  | 
|            | Active | Status | Status   | Status | Config    | Actual    | Config   | Actual   | Config     | Actual     | Config      | Actual      | Config | Actual | Config  | Actual  | 
|            |        |        |          |        | Partition | Partition | Group    | Group    | Role       | Role       | Role        | Role        | Roles  | Roles  | Groups  | Groups  | 
| ---------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------ | ------ | ------- | ------- | 
| censored | yes    | ok     |          |        |         1 |         1 | default  | default  | master 1   | master     | worker      | master      | worker | worker | default | default |

overall host status: ok'
++ local col_hosts=1
++ local row_hosts_start=5
++ local cur_row=1
++ local cur_hostname
++ local cur_IP
++ read -r line
++ [[ | != \| ]]
+++ echo '| Host       | Host   | Host   | Failover | Remove | Storage   | Storage   | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host   | Host   | Worker  | Worker  |'
+++ sed -e 's/^|//'
++ line=' Host       | Host   | Host   | Failover | Remove | Storage   | Storage   | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host   | Host   | Worker  | Worker  |'
++ '[' 1 -ge 5 ']'
++ cur_row=2
++ read -r line
++ [[ | != \| ]]
+++ echo '|            | Active | Status | Status   | Status | Config    | Actual    | Config   | Actual   | Config     | Actual     | Config      | Actual      | Config | Actual | Config  | Actual  |'
+++ sed -e 's/^|//'
++ line='            | Active | Status | Status   | Status | Config    | Actual    | Config   | Actual   | Config     | Actual     | Config      | Actual      | Config | Actual | Config  | Actual  |'
++ '[' 2 -ge 5 ']'
++ cur_row=3
++ read -r line
++ [[ | != \| ]]
+++ echo '|            |        |        |          |        | Partition | Partition | Group    | Group    | Role       | Role       | Role        | Role        | Roles  | Roles  | Groups  | Groups  |'
+++ sed -e 's/^|//'
++ line='            |        |        |          |        | Partition | Partition | Group    | Group    | Role       | Role       | Role        | Role        | Roles  | Roles  | Groups  | Groups  |'
++ '[' 3 -ge 5 ']'
++ cur_row=4
++ read -r line
++ [[ | != \| ]]
+++ echo '| ---------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------ | ------ | ------- | ------- |'
+++ sed -e 's/^|//'
++ line=' ---------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------ | ------ | ------- | ------- |'
++ '[' 4 -ge 5 ']'
++ cur_row=5
++ read -r line
++ [[ | != \| ]]
+++ echo '| censored | yes    | ok     |          |        |         1 |         1 | default  | default  | master 1   | master     | worker      | master      | worker | worker | default | default |'
+++ sed -e 's/^|//'
++ line=' censored | yes    | ok     |          |        |         1 |         1 | default  | default  | master 1   | master     | worker      | master      | worker | worker | default | default |'
++ '[' 5 -ge 5 ']'
+++ echo ' censored | yes    | ok     |          |        |         1 |         1 | default  | default  | master 1   | master     | worker      | master      | worker | worker | default | default |'
+++ awk -F '|' '{print $col}' col=1
+++ sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
++ cur_hostname=censored
++ [[ -z censored ]]
+++ nslookup censored
+++ grep Address
+++ grep -v '#'
+++ awk '{print $2}'
++ cur_IP=
++ [[ -z '' ]]
++ continue
++ read -r line
++ [[ '' != \| ]]
++ break
+ HOSTNAME=
+++ query_sap_hana_status
+++ cat
++ mk_hdbsql SIDcensored 00 admcensored 'SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME='\''Version'\'' or
NAME='\''All Started'\'''
++ local sid=SIDcensored
++ local instance=00
++ local instance_user=admcensored
++ local query
+++ echo 'SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME='\''Version'\'' or
NAME='\''All Started'\'''
+++ tr '\n' ' '
++ query='SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME='\''Version'\'' or NAME='\''All Started'\'' '
++ local credentials
++ local hdbsql_path=/usr/sap/SIDcensored/HDB00/exe/hdbsql
++ '[' -n usercensored ']'
++ credentials='-U usercensored'
++ '[' '' = agent ']'
+++ su - admcensored -c '/usr/sap/SIDcensored/HDB00/exe/hdbsql -C -F\; -x -a -n localhost -i 00 -U usercensored "SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME='\''Version'\'' or NAME='\''All Started'\'' "'
++ result=
++ rc=3
++ echo ''
++ sed -e 's/^;//' -e 's/;$//'
++ return 3
+ status_output=
+ echo '<<<sap_hana_replication_status>>>'
<<<sap_hana_replication_status>>>
+ echo '[[SIDcensored 00]]'
[[SIDcensored 00]]
+ sap_hana_replication_status SIDcensored 00 admcensored
+ local sid=SIDcensored
+ local instance=00
+ local instance_user=admcensored
++ su - admcensored -c 'python /usr/sap/SIDcensored/HDB00/exe/python_support/systemReplicationStatus.py'
+ result='this system is not a system replication site'
+ echo 'systemReplicationStatus: 10'
systemReplicationStatus: 10
+ echo 'this system is not a system replication site'
this system is not a system replication site
+ '[' -v PASSWORD_CONNECT ']'
+ read -r line

There are no alarms, no unmonitored processes, no indication that there is HANA except file system and mount points. I have hidden discs and excess data, that are shown but irrelevant to the issue that I have no data about HANA nor alarm that there is somethin going wrong :slight_smile:

The problem is, that the plugin does not get any basic information about your instances:

+++ su - admcensored -c '/usr/sap/SIDcensored/HDB00/exe/hdbsql -C -F\; -x -a -n localhost -i 00 -U usercensored "SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME='\''Version'\'' or NAME='\''All Started'\'' "'
++ result=
++ rc=3
++ echo ''
++ sed -e 's/^;//' -e 's/;$//'
++ return 3

This query should return the state of all instances found on the management database and should look like:

<<<sap_hana_status:sep(59)>>>
[[P60 60]]
Version;;2.00.036.00.1547699771 (fa/hana2sp03)
All Started;OK;Yes

You can run this command line directly to may get some more information. According to the documentation (SQL Error Codes - SAP Help Portal), rc=3 means a fatal error.

As long as this query doesn’t return anything all other queries are skipped, that’s why you don’t get any services and check results.

1 Like

Thank you again.
We have analysed the debug output and came to some conclusions:

  1. The DB accepts the connection but returns no data:

    At the bottom can be seen the DB prompt, which indicates that the connection to the DB has been established.
  2. The query from inside the database - returns the desired data (but not with syntax that is used in the query):
    image
  3. The syntax used in the query returns an error:

    At the bottom can be seen the log for correct query (in black) and for the query with incorrect syntax (in red).

Could that be the reason for not getting the correct output?

Additionally, the DB admin does not wish to use userstorekey for this purpose - so I have to use just the usr/pwd option, which results in:
**static service deactivating (user@1001)CRIT
Service ‘check-mk-agent@24-IPmasked:6556-IPmasked:52610’ activating for: 0.00 s

What are the options?

The command line query contains the additional \'to escape the character because the whole string is surrounded by '. So the command line string will only work directly at the command line and at the HANA studio the query you posted will be the result.
If you run the command line string does it give you the same result as the query directly form the HANA studio?
I remember, there were a problem back a few moths where the string got problems between some OS versions and HANA versions and the simple fix was to alter the special characters. I will try to find the thread.

the hdbuserstore is more secure in general and is easier if something changes at the database version. If you change to a scale out system your DBA doesn’t care about keep the users synchron along the whole landscape. I never used the monitoring with user/pwd connection. To get more information always use the direct call of the plugin with the --debugoption.

1 Like