Monitoring SAP R/3 + SAP HANA

Here it is:

+ shift
+ test -n ''
+ '[' -e /etc/check_mk//sap_hana.cfg ']'
+ . /etc/check_mk//sap_hana.cfg
++ USER=<username>
++ PASSWORD=<password>
+ '[' -z '' ']'
+ '[' -z <username> ']'
+ '[' -z <password> ']'
+ ps -efw
+ grep '[H]DB.*sapstartsrv'
+ read -r line
++ echo '<sidadm>     2511      1  0 Apr17 ?        00:00:59 /usr/sap/<SID>/HDB<INSTANCE>/exe/sapstartsrv pf=/usr/sap/HDB/SYS/profile/HDB_HDB<INSTANCE>_vhcalhdbdb -D -u <sidadm>'
++ sed 's/.*\/\(.*\)\/.*\/exe\/sapstartsrv.*/\1/g'
+ SID=<SID>
++ echo '<sidadm>     2511      1  0 Apr17 ?        00:00:59 /usr/sap/<SID>/HDB<INSTANCE>/exe/sapstartsrv pf=/usr/sap/HDB/SYS/profile/HDB_HDB<INSTANCE>_vhcalhdbdb -D -u <sidadm>'
++ sed -e 's/.*\/\(.*\)\/exe\/sapstartsrv.*/\1/g' -e 's/[^0-9]//g'
+ INSTANCE=<INSTANCE>
++ echo '<sidadm>     2511      1  0 Apr17 ?        00:00:59 /usr/sap/<SID>/HDB<INSTANCE>/exe/sapstartsrv pf=/usr/sap/HDB/SYS/profile/HDB_HDB<INSTANCE>_vhcalhdbdb -D -u <sidadm>'
++ grep -Po '^\s*(\w+)'
+ INSTANCE_USER=<sidadm>
+ '[' -z <INSTANCE> ']'
+ '[' -z <SID> ']'
+ do_query <SID> <INSTANCE> <sidadm>
+ local SID=<SID>
+ local INSTANCE=<INSTANCE>
+ local INSTANCE_USER=<sidadm>
+ local 'INSTANCE_NAME=[[HDB <INSTANCE>]]'
+ '[' -z <hostname> ']'
++ hostname
+ HOSTNAME=<hostname>
+ echo '<<<sap_hana_status:sep(59)>>>'
<<<sap_hana_status:sep(59)>>>
+++ query_sap_hana_status
+++ cat
++ mk_hdbsql HDB <instance> <sidadm> 'SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME='\''Version'\'' or
NAME='\''All Started'\'''
++ local sid=HDB
++ local instance=<instance>
++ local instance_user=<sidadm>
++ 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/<SID>/HDB<INSTANCE>/exe/hdbsql
++ '[' -n '' ']'
++ credentials='-u <username> -p <password>'
++ '[' '' = agent ']'
+++ su - <sidadm> -c '/usr/sap/<SID>/HDB<INSTANCE>/exe/hdbsql -C -F\; -x -a -n localhost -i <INSTANCE> -u <username> -p <password> "SELECT Name, Status, Value FROM M_SYSTEM_OVERVIEW Where NAME='\''Version'\'' or NAME='\''All Started'\'' "'
++ result='
Welcome to the SAP HANA Database interactive terminal.
                                           
Type:  \h for help with commands          
       \q to quit                         '
++ rc=0
++ echo '
Welcome to the SAP HANA Database interactive terminal.
                                           
Type:  \h for help with commands          
       \q to quit                         '
++ sed -e 's/^;//' -e 's/;$//'
++ return 0
+ status_output='
Welcome to the SAP HANA Database interactive terminal.
                                           
Type:  \h for help with commands          
       \q to quit                         '
+ echo '[[HDB <instance>]]'
[[HDB <instance>]]
+ echo '
Welcome to the SAP HANA Database interactive terminal.
                                           
Type:  \h for help with commands          
       \q to quit                         '

Welcome to the SAP HANA Database interactive terminal.
                                           
Type:  \h for help with commands          
       \q to quit                         
+ echo '<<<sap_hana_backup:sep(59)>>>'
<<<sap_hana_backup:sep(59)>>>
+ echo '[[HDB <instance>]]'
[[HDB <instance>]]
++ query_sap_hana_backup_snapshots
++ cat
+ mk_hdbsql HDB <instance> <sidadm> 'Select TOP 1 entry_type_name, sys_end_time, state_name, comment, message from
M_BACKUP_CATALOG where entry_type_name = '\''data snapshot'\'' AND state_name <>
'\''running'\'' order by sys_start_time desc'
+ local sid=HDB
+ local instance=<instance>
+ local instance_user=<sidadm>
+ local query
++ echo 'Select TOP 1 entry_type_name, sys_end_time, state_name, comment, message from
M_BACKUP_CATALOG where entry_type_name = '\''data snapshot'\'' AND state_name <>
'\''running'\'' order by sys_start_time desc'
++ tr '\n' ' '
+ query='Select TOP 1 entry_type_name, sys_end_time, state_name, comment, message from M_BACKUP_CATALOG where entry_type_name = '\''data snapshot'\'' AND state_name <> '\''running'\'' order by sys_start_time desc '
+ local credentials
+ local hdbsql_path=/usr/sap/<SID>/HDB<INSTANCE>/exe/hdbsql
+ '[' -n '' ']'
+ credentials='-u <username> -p <password>'
+ '[' '' = agent ']'
++ su - <sidadm> -c '/usr/sap/<SID>/HDB<INSTANCE>/exe/hdbsql -C -F\; -x -a -n localhost -i <INSTANCE> -u <username> -p <password> "Select TOP 1 entry_type_name, sys_end_time, state_name, comment, message from M_BACKUP_CATALOG where entry_type_name = '\''data snapshot'\'' AND state_name <> '\''running'\'' order by sys_start_time desc "'
+ result='
Welcome to the SAP HANA Database interactive terminal.
                                           
Type:  \h for help with commands          
       \q to quit                         '
+ rc=0
+ echo '
Welcome to the SAP HANA Database interactive terminal.
                                           
Type:  \h for help with commands          
       \q to quit                         '
+ sed -e 's/^;//' -e 's/;$//'

Welcome to the SAP HANA Database interactive terminal.
                                           
Type:  \h for help with commands          
       \q to quit                         
+ return 0