Zabbix: Adding a datastore low space discovery trigger

Its been a LONG time to say the least since I posted last. Once every 7 years seems like a good rate. Anyways, life has taken a lot of turns, and I manage/tweak/etc many different kinds of systems now. We are in the middle of migrating from icinga/nagios to Zabbix. It’s definitely been a bit of a learning curve. Today I had to figure out how to add alerts on my vmware datastores so I know when space is running out.

Start by going to Data collection -> Templates -> VMware. Click on “VMWare” and then go to the Macros Tab. Add the following 2 Macros:
Macro: {$DS.CRIT}
Value: 5
Description: Datastore free % Critical Point
Macro: {$DS.Warn}
Value: 10
Description: Datastore free % Warning Point

Click on Update.

Next click on “Discovery Rules” along the top, then find the entry for “Discover VMware datastores.” Click on Trigger prototypes for that entry. In the top right of the screen, you can now choose “Create trigger prototype.” I created 2 prototypes, one for a warning, and one for a critical notification. You can choose to do as many as you want.

Fill in the following information:
Name: {#DATASTORE}: Disk space is CRITICAL
Event name: {#DATASTORE}: Disk space is CRITICAL {ITEM.LASTVALUE1}
Operational data: {ITEM.LASTVALUE1}
Severity: High
Expression: last(/VMware/vmware.datastore.size[{$VMWARE.URL},{#DATASTORE},pfree])<{$DS.CRIT}

On the “Tags” tab, enter the following:
Name: component
Value: datastore
Name: datastore
Value: {#DATASTORE}

To create the second one for warning, Clone the trigger prototype (on the bottom of the trigger prototype, as seen in the screen shots), then change the names from Critical to Warning, and change $DS.CRIT to $DS.WARN in the expression, then click update.

If you don’t want the “Warning” trigger to show up when you are critical, open the warning trigger prototype, then go to “Dependencies” along the top. Click on “Add prototype” and select your critical prototype, then update.

You should now be all set!

Filed under: Zabbix | Posted on June 5th, 2023 by CharlieMaurice

Leave a Reply

RSS Feed

Categories

Archives

Blogroll

Meta

Copyright © 2023 Charlie's Tech Ramblings. All rights reserved.

Tech Blue designed by Hive Designs • Ported by Free WordPress Themes