Monitoring the SAP HANA DB consists of executing the check_hana.sh script that uses SAP’s hdbclient SQL client to connect to the HANA DB. Included in the script are queries to HANA to find out its status.
Requirements
USER SAP HANA
HANA SQL client (hdbsql)
Script check_hana.sh
But let’s look at the Configuration steps first.
Create a user with the role MONITORING
In SAP HANA Studio, open the SAP instance to be monitored
Go to the “Users” section
Create a new user with these parameters:
username = NETEYE
password = ***
ROLE:
MONITORING with grantor SYSTEM
PUBLIC with grantor SYS
Save the new user
You then need to install the hdbsql client on the monitoring server; you can follow this guide on SAP’s site:
After the installation is finished you can test the SQL client to access a HANA system with this command:
./hdbsql -n 10.20.30.40 -i 21 -u NETEYE -p ***
Welcome to the SAP HANA Database interactive terminal.
Type: \h for help with commands
\q to quit
hdbsql PTP=>
-n <IP or host name of the hana server>
-i <instance number>
-u <username created>
-p <password>
You can also run a command line query with the -I parameter and see the result.
Test Script
The check_hana.sh script has 6 functions that execute the corresponding query to know the status of:
connection_time
last_backup
failed_log_backups
failed_data_backups
memory_usage
replication_status
In the example below, we launch the replication_status command to find out the replication status
OK - Replication Status Database PTP\nHOST PORT SITE_NAME SECONDARY_SITE_NAME SECONDARY_HOST SECONDARY_PORT REPLICATION_MODE SECONDARY_ACTIVE_STATUS REPLICATION_STATUS SHIP_DELAY_S ASYNC_BUFF_USED_MB SECONDARY_RECONNECT_COUNT SECONDARY_FAILOVER_COUNT\n"lshdbttptp" "32***" "TESTINSIDE" "REPLICATE" "lshdbdrrptp" "32***" "ASYNC" 1 0 0.00 0.00 0 0\n|'ship-delay-port-32***'=0.00s;10;20;0;0
The check fails if REPLICATION_MODE is different from SYNC or SYNCMEM, if the secondary site is down, or if SHIP_DELAY_S is greater than 20 seconds
With this monitoring mode you can run and monitor a very large number of HANA metrics, and have the ability to run custom queries as well.
These Solutions are Engineered by Humans
Did you find this article interesting? Does it match your skill set? Our customers often present us with problems that need customized solutions. In fact, we’re currently hiring for roles just like this and others here at Würth Phoenix.
My name is Alessandro Paoli and I've been a Technical Consultant at Wurth Phoenix since May 2024. I've always had a great passion for IT and since 2004 it has also become my job. In 2015 I found my role in the field, monitoring. I have had the opportunity to use various monitoring products, both open source and proprietary, I have worked on numerous projects from small businesses to global companies.
I am married and have 2 wonderful daughters. My passions are travel, cinema, games (video and board) and comics, and every now and then I manage to indulge in a few days of sport (Padel and gym).
Author
Alessandro Paoli
My name is Alessandro Paoli and I've been a Technical Consultant at Wurth Phoenix since May 2024. I've always had a great passion for IT and since 2004 it has also become my job. In 2015 I found my role in the field, monitoring. I have had the opportunity to use various monitoring products, both open source and proprietary, I have worked on numerous projects from small businesses to global companies.
I am married and have 2 wonderful daughters. My passions are travel, cinema, games (video and board) and comics, and every now and then I manage to indulge in a few days of sport (Padel and gym).
Monitoring SAP systems has always been a major hurdle in every job I've held. SAP has its own monitoring tools, primarily CCMS, but extracting metrics and configurations from the SAP world has always been a challenge. In the past, I Read More
The Challenge: The automatic setup of around 80-90 SAP-Servers running several releases and flavors of SAP software in NetEye 4 by: Automatically importing SAP hosts, databases and instance definitionsAutomatically applying a set of basic services to each level of monitoring Read More
“We’ve seen that Open Source has been used more and more by organizations. IT monitoring tools in particular are strongly adopted in Europe ” commented Jeffrey Hammond, Principal Analyst at Forrester Research, in his interview. If you're interested in knowing Read More
SAP Solution Manager monitors the behavior of SAP Instances and sends notification email in case of misbehaviors. Integrating this solution with NetEye the benefit is the possibility to have the mails sent to a user on NetEye Server and thanks to a procmail script rows Read More