Skip to content

Installation

This guide provides the necessary steps to install and configure the Zabbix Agent 2 plugin for SAP HANA.

Repository Setup

Ensure the following prerequisite packages are installed:

sudo apt install -y curl gnupg ca-certificates
sudo yum install -y curl

Next, set the ZABBIX_RELEASE environment variable. This must match the version of your installed Zabbix Agent 2.

export ZABBIX_RELEASE='7.0'
export ZABBIX_RELEASE='7.0'

Then, configure the package repository:

curl -s https://apt.ravenlayer.com/public.gpg | sudo gpg --dearmor -o /usr/share/keyrings/ravenlayer.gpg
sudo tee /etc/apt/sources.list.d/ravenlayer.list > /dev/null << EOF
deb [signed-by=/usr/share/keyrings/ravenlayer.gpg] https://apt.ravenlayer.com/zabbix/${ZABBIX_RELEASE} any main
EOF
sudo apt update
curl -s https://yum.ravenlayer.com/RPM-GPG-KEY-RAVENLAYER | sudo tee /etc/pki/rpm-gpg/RPM-GPG-KEY-RAVENLAYER
sudo tee /etc/yum.repos.d/ravenlayer.repo > /dev/null << EOF
[ravenlayer]
name=RavenLayer Official Repository - \$basearch
baseurl=https://yum.ravenlayer.com/zabbix/${ZABBIX_RELEASE}/rhel/\$releasever/\$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RAVENLAYER
EOF

Plugin Installation

Once the repository is configured, the plugin can be installed with a single command:

sudo apt install -y zabbix-agent2-plugin-saphana
sudo yum install -y zabbix-agent2-plugin-saphana

After installation, the Zabbix Agent 2 service must be restarted:

sudo systemctl restart zabbix-agent2

Execute the plugin binary to confirm the installation:

/usr/sbin/zabbix-agent2-plugin/zabbix-agent2-plugin-saphana -V

Confirm that the Zabbix Agent 2 has successfully loaded the plugin and can access the metrics:

zabbix_agent2 -R metrics 2>&1 | grep sap.hana

Database Setup

Create a restricted user for monitoring. The template description provides SQL statements that can be used to create the necessary user, role and grants.

CREATE RESTRICTED USER ZABBIX PASSWORD <PASSWORD> NO FORCE_FIRST_PASSWORD_CHANGE VALID FROM NOW UNTIL FOREVER AUTHORIZATION LOCAL;
ALTER USER ZABBIX ENABLE CLIENT CONNECT;
CREATE ROLE ZABBIX_MONITORING;
GRANT CATALOG READ TO ZABBIX_MONITORING;
/* see template description for full script */
GRANT SELECT ON DUMMY TO ZABBIX_MONITORING;
GRANT ZABBIX_MONITORING TO ZABBIX;

This configuration is required for the SYSTEMDB database and each tenant database.

XML Template Import

Download and import the XML templates into your Zabbix Server. The version you need depends on your Zabbix Server version:

The XML file contains two different Zabbix templates:

  • Template DB SAP HANA by Zabbix agent 2
  • Template DB SAP HANA Tenant by Zabbix agent 2

Only the first template should be linked to each monitored host. The second template will be applied automatically through Low-level discovery rules.

Zabbix Host Configuration

Assign the Template DB SAP HANA by Zabbix agent 2 monitoring template to the host and configure the following macros:

Macro Description Default
{$SAP.HANA.URI} Connection URI hdb://localhost:30013
{$SAP.HANA.USER} Username ZABBIX
{$SAP.HANA.PASSWORD} Password