Zabbix Agent 2 plugin for SAP Agent released on GitHub

I recently spent some time developing a new Zabbix Agent 2 plugin designed to seamlessly integrate SAP® Host Agent monitoring into your Zabbix infrastructure. It’s now at a point where I’m happy to share it on GitHub.

Why another SAP plugin?

If you’ve ever had to monitor SAP, you know it can be a bit of a black box. The SAP Host Agent provides a lot of data, but getting that into Zabbix efficiently usually involves a mess of custom scripts. I wanted something native to Zabbix Agent 2 that could talk directly to the SAP Host Control web services.

I wrote this plugin from scratch over the last month. The result is pretty straightforward: it uses SOAP XML over HTTP(S) to pull things like CPU, memory, disk and network stats. One additional thing I made sure to include is a lightweight caching layer. SAP Host Control can be a bit sensitive if you hit it with too many requests at once, so the plugin caches metrics internally to keep the load on the SAP side as low as possible.

Nested low-level discovery

The part I’m most excited about isn’t just the performance metrics, but the discovery capabilities. The plugin can reach into the SAP Host Agent and list out detailed information about the broader SAP landscape.

For example, it can automatically list all SAP HANA databases registered with the host agent via the <SAPHostControl:ListDatabaseSystems> SOAP method.

This functionality is exposed by the item key sap.agent.db.discovery:

root@zabbix:~# zabbix_agent2 -t 'sap.agent.db.discovery["http://hanael9:1128","sapadm","Password1"]'

The plugin will output structured LLD data that can be used to create new monitored metrics:

[
  {
    "{#DB.NAME}": "HDB",
    "{#DB.PROTOCOL}": "tcp",
    "{#DB.HOST}": "hanael9.ravenlayer.local",
    "{#DB.PORT}": "30015"
  },
  {
    "{#DB.NAME}": "SYSTEMDB",
    "{#DB.PROTOCOL}": "tcp",
    "{#DB.HOST}": "hanael9.ravenlayer.local",
    "{#DB.PORT}": "30013"
  }
]

The real power comes with the introduction of nested low-level discovery in Zabbix 7.4. Thanks to this, we can now fully automate the monitoring lifecycle. By combining this zabbix-agent2-sapagent-plugin with the zabbix-agent2-saphana-plugin, you can move from discovering a single host agent to monitoring entire SAP HANA instances and individual tenants automatically using their respective templates.

What’s next?

The code is licensed under Apache 2.0 and you can find it over on GitHub.

Right now, you’ll need to build it from source (which is easy if you are familiar with the Go ecosystem), but I’m planning to get some proper .deb and .rpm packages built soon. I’ll also be uploading some ready-to-use Zabbix templates once I’ve polished them up a bit more. Stay tuned.

Supercharge your Zabbix monitoring now!

Real-time monitoring of your SAP HANA database. Get started in minutes.