Zabbix Integration: Difference between revisions

From OSNEXUS Online Documentation Site
Jump to navigation Jump to search
Created page with "== Zabbix Integration / Support == To enable the Zabbix agent directly within your QuantaStor appliance you'll need to install the agent as per the Zabbix documentation on ho..."
 
m QSTOR-10802: rewrite Zabbix integration guide - add category, step headings, template import step, severity map; redact example API token
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Zabbix Integration / Support ==
[[Category:integration_guide]]


To enable the Zabbix agent directly within your QuantaStor appliance you'll need to install the agent as per the Zabbix documentation on how to install into Ubuntu Server 12.04 (Precise) which can be found [https://www.zabbix.com/documentation/2.0/manual/installation/install_from_packages here].
Zabbix is an enterprise-class open source monitoring and observability platform.  QuantaStor integrates with Zabbix via a custom alert handler tied into the QuantaStor Alert Manager, which pushes each alert into Zabbix over the Zabbix API.  Setup is a matter of generating an API token in Zabbix, combining it with your Zabbix URL, and adding the result to the QuantaStor Alert Manager screen as a new Alert Endpoint.
 
'''Requirements:''' Zabbix 7.0 or newer. If you don't have a Zabbix server available you can stand up a free 3-day trial instance at [https://cloud.zabbix.com cloud.zabbix.com] using the ''nano'' tier.
 
== Step 1 - Generate an API Token ==
 
Login to Zabbix and navigate to:
 
'''Users''' -> '''API tokens''' -> '''Create API token'''
 
Name the token '''quantastor-itsm''' and choose the user to associate it with.  We recommend leaving '''Set expiration date and time''' un-checked so that alerts are not missed due to token expiration.
 
The token is displayed only once, so be sure to copy it before leaving the page.
 
The user the token is tied to needs rights to create hosts and, for the one-time setup in Step 3, to create host groups and import templates.  A '''Super admin''' user is the simplest choice.
 
== Step 2 - Assemble the Endpoint URL ==
 
The endpoint URL that QuantaStor needs is the base URL of your Zabbix front end, followed by a '#' character, followed by the API token from Step 1:


Here is a quick summary of the commands to run as detailed on the [https://www.zabbix.com/documentation/2.2/manual/installation/install#installing_zabbix_daemons Zabbix web site]:
<pre>
<pre>
sudo -i
https://<zabbix-host>/#<API-token>
wget http://repo.zabbix.com/zabbix/2.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_2.0-1precise_all.deb
dpkg -i zabbix-release_2.0-1precise_all.deb
apt-get update
apt-get install zabbix-server-mysql zabbix-frontend-php
</pre>
</pre>


Note that Zabbix uses the apache2 web server for its web management interface.  Apache uses port 80 by default which conflicts with the Tomcat service QuantaStor uses for its web management interface.  As such, you must edit the /etc/apache2/ports.conf file to change the default port numbers. For example you can change 80 to 8001 and 443 to 4431, then restart the apache service with 'service apache2 restart'. 
With Zabbix Cloud the front end is at the root of the host name, so the URL will look like this:
This will eliminate the port conflict with the QuantaStor manager web interface.  For more information on changing the apache port numbers, please see this [http://www.cyberciti.biz/faq/linux-apache2-change-default-port-ipbinding/ article] which has more detail.
 
<pre>
https://qs-example.zabbix.cloud/#b7f3a91c2d6e480fa5c81e37d94b06af2c15e8d073a4bf6295cd10e8473f92
</pre>
 
With a self-hosted Zabbix server the front end is usually served under ''/zabbix'', so the URL will look like this:
 
<pre>
https://zabbix.example.com/zabbix#b7f3a91c2d6e480fa5c81e37d94b06af2c15e8d073a4bf6295cd10e8473f92
</pre>
 
QuantaStor appends the API path (''api_jsonrpc.php'') to the URL automatically, so there's no need to include it.
 
== Step 3 - Import the QuantaStor Template ==


After the port number has been changed you can then access Nagios via your web browser at the new port number like so:
Run the alert handler once with the '''--setup''' option on any storage system in the grid, passing the URL assembled in Step 2:


<pre>
<pre>
http://your-appliance-ip-address:8001/zabbix/
/opt/osnexus/quantastor/bin/qs_alerthandler_zabbix.py --setup --url 'https://qs-example.zabbix.cloud/#b7f3a91c2d6e480fa5c81e37d94b06af2c15e8d073a4bf6295cd10e8473f92'
</pre>
</pre>
Note the single quotes around the URL, they're required so that the shell doesn't treat the '#' as the start of a comment.
This imports the '''QuantaStor by Trapper''' template (items, triggers and a per-host dashboard) and creates a grid-wide '''QuantaStor Alerts''' dashboard under '''Dashboards''' in Zabbix.
This step is optional in the sense that alerts will still be delivered without it, but until the template is imported they arrive only as a raw JSON payload with no triggers, no entries under '''Monitoring''' -> '''Problems''', and no dashboard, so we recommend always running it.
== Step 4 - Add the Endpoint to QuantaStor ==
Login to your QuantaStor storage grid and then select the '''Alert Manager''' button in the toolbar to bring up the dialog for adding alert endpoints.  On the second page select '''Zabbix''' from the dropdown list of ITSM integrations and then input the URL endpoint you assembled in Step 2.
== Step 5 - Apply Changes and Test ==
Apply your changes to add the new endpoint, then use the '''Generate Test Alert''' button to verify that everything is configured correctly and that alerts are making it into Zabbix.  Note that "INFO" level alerts are not sent to the ITSM modules, so be sure to generate a "WARNING" or "ERROR" level alert for testing.
The first alert from a given storage system creates its host in Zabbix, and the Zabbix server only picks up that new configuration on its next cache reload (up to 60 seconds).  The alert handler retries until the alert lands, so the first test alert may take a minute or so to appear.
[[File:Image-2026-08-21-11-03-00-211.png|800px]]
== Viewing Alerts in Zabbix ==
Alerts can be reviewed in three places:
* '''Dashboards''' -> '''QuantaStor Alerts''' - alert counts by severity plus the full alert list across every storage system in the grid.
* '''Monitoring''' -> '''Problems''' - the standard Zabbix problem view, filtered however you like.
* The '''QuantaStor alerts''' dashboard on an individual host - the last alert received from that one storage system.
[[File:Image-2026-08-21-11-39-31-766.png|800px]]
QuantaStor alerts are one-shot events with no automatic recovery condition, so a problem stays open until it is closed by hand.  To dismiss an alert use the '''Update''' link to the right of it and select '''Close problem'''.
== What the Integration Creates in Zabbix ==
{| class="wikitable"
! Object !! Name !! Notes
|-
| Host group || QuantaStor || Holds every storage system reporting into Zabbix
|-
| Host || One per storage system || Named by the storage system's IP address, with the system name as the visible name
|-
| Template || QuantaStor by Trapper || Linked automatically to each host created by the handler
|-
| Dashboard || QuantaStor Alerts || Grid-wide alert dashboard, created by --setup
|-
| Template dashboard || QuantaStor alerts || Per-host view of the most recent alert
|}
Each alert is pushed as a JSON document into the ''quantastor.alert'' trapper item, and the template derives the individual fields (title, description, severity, alert type, storage system, timestamp) from it.  QuantaStor alert severities map to Zabbix trigger priorities as follows:
{| class="wikitable"
! QuantaStor severity !! Zabbix priority
|-
| Critical || Disaster
|-
| Error || High
|-
| Warning || Warning
|-
| Info || not forwarded
|}

Latest revision as of 22:17, 24 August 2026


Zabbix is an enterprise-class open source monitoring and observability platform. QuantaStor integrates with Zabbix via a custom alert handler tied into the QuantaStor Alert Manager, which pushes each alert into Zabbix over the Zabbix API. Setup is a matter of generating an API token in Zabbix, combining it with your Zabbix URL, and adding the result to the QuantaStor Alert Manager screen as a new Alert Endpoint.

Requirements: Zabbix 7.0 or newer. If you don't have a Zabbix server available you can stand up a free 3-day trial instance at cloud.zabbix.com using the nano tier.

Step 1 - Generate an API Token

Login to Zabbix and navigate to:

Users -> API tokens -> Create API token

Name the token quantastor-itsm and choose the user to associate it with. We recommend leaving Set expiration date and time un-checked so that alerts are not missed due to token expiration.

The token is displayed only once, so be sure to copy it before leaving the page.

The user the token is tied to needs rights to create hosts and, for the one-time setup in Step 3, to create host groups and import templates. A Super admin user is the simplest choice.

Step 2 - Assemble the Endpoint URL

The endpoint URL that QuantaStor needs is the base URL of your Zabbix front end, followed by a '#' character, followed by the API token from Step 1:

https://<zabbix-host>/#<API-token>

With Zabbix Cloud the front end is at the root of the host name, so the URL will look like this:

https://qs-example.zabbix.cloud/#b7f3a91c2d6e480fa5c81e37d94b06af2c15e8d073a4bf6295cd10e8473f92

With a self-hosted Zabbix server the front end is usually served under /zabbix, so the URL will look like this:

https://zabbix.example.com/zabbix#b7f3a91c2d6e480fa5c81e37d94b06af2c15e8d073a4bf6295cd10e8473f92

QuantaStor appends the API path (api_jsonrpc.php) to the URL automatically, so there's no need to include it.

Step 3 - Import the QuantaStor Template

Run the alert handler once with the --setup option on any storage system in the grid, passing the URL assembled in Step 2:

/opt/osnexus/quantastor/bin/qs_alerthandler_zabbix.py --setup --url 'https://qs-example.zabbix.cloud/#b7f3a91c2d6e480fa5c81e37d94b06af2c15e8d073a4bf6295cd10e8473f92'

Note the single quotes around the URL, they're required so that the shell doesn't treat the '#' as the start of a comment.

This imports the QuantaStor by Trapper template (items, triggers and a per-host dashboard) and creates a grid-wide QuantaStor Alerts dashboard under Dashboards in Zabbix.

This step is optional in the sense that alerts will still be delivered without it, but until the template is imported they arrive only as a raw JSON payload with no triggers, no entries under Monitoring -> Problems, and no dashboard, so we recommend always running it.

Step 4 - Add the Endpoint to QuantaStor

Login to your QuantaStor storage grid and then select the Alert Manager button in the toolbar to bring up the dialog for adding alert endpoints. On the second page select Zabbix from the dropdown list of ITSM integrations and then input the URL endpoint you assembled in Step 2.

Step 5 - Apply Changes and Test

Apply your changes to add the new endpoint, then use the Generate Test Alert button to verify that everything is configured correctly and that alerts are making it into Zabbix. Note that "INFO" level alerts are not sent to the ITSM modules, so be sure to generate a "WARNING" or "ERROR" level alert for testing.

The first alert from a given storage system creates its host in Zabbix, and the Zabbix server only picks up that new configuration on its next cache reload (up to 60 seconds). The alert handler retries until the alert lands, so the first test alert may take a minute or so to appear.

Viewing Alerts in Zabbix

Alerts can be reviewed in three places:

  • Dashboards -> QuantaStor Alerts - alert counts by severity plus the full alert list across every storage system in the grid.
  • Monitoring -> Problems - the standard Zabbix problem view, filtered however you like.
  • The QuantaStor alerts dashboard on an individual host - the last alert received from that one storage system.

QuantaStor alerts are one-shot events with no automatic recovery condition, so a problem stays open until it is closed by hand. To dismiss an alert use the Update link to the right of it and select Close problem.

What the Integration Creates in Zabbix

Object Name Notes
Host group QuantaStor Holds every storage system reporting into Zabbix
Host One per storage system Named by the storage system's IP address, with the system name as the visible name
Template QuantaStor by Trapper Linked automatically to each host created by the handler
Dashboard QuantaStor Alerts Grid-wide alert dashboard, created by --setup
Template dashboard QuantaStor alerts Per-host view of the most recent alert

Each alert is pushed as a JSON document into the quantastor.alert trapper item, and the template derives the individual fields (title, description, severity, alert type, storage system, timestamp) from it. QuantaStor alert severities map to Zabbix trigger priorities as follows:

QuantaStor severity Zabbix priority
Critical Disaster
Error High
Warning Warning
Info not forwarded