Monitoring SAP R/3 + SAP HANA

Can you check, if your user and password to login against database are provided inside /etc/check_mk/sap_hana.cfg?

With this credentials you can check if the connection works via
su - <sidadm> -c "/usr/sap/<SID>/HDB<INSTANCE>/exe/hdbsql -C -F\; -x -a -n localhost -i <INSTANCE> -u <USER> -p <PASSWORD> \"select version from sys.m_database\""
or with hdbuserstore via
su - <sidadm> -c "/usr/sap/<SID>/HDB<INSTANCE>/exe/hdbsql -C -F\; -x -a -n localhost -i <INSTANCE> -U <STOREKEY> \"select version from sys.m_database\""

Actually i don’t can figure out, why you are getting an interactice terminal instead of just executing the SQL and exit with output.