Skip to content

SomeAverageDev/ZabbixMaintenance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZabbixMaintenance

** THIS IS STILL UNDER DEVELOPMENT ** Zabbix Template and related media type in order to manage dynamic maintenance on Zabbix using a local agent trapper item You will have to create the related action as "Actions" cannot be imported.

Description

This hack allows the creation of Zabbix maintenances from the agent side using a specific trapper item. The trapper item triggers an associated action that create or delete the maintenance.

Installation

Zabbix template

Import the template file

Zabbix media type

Import the media type file

Create the associated action

Go to "Configuration > Actions" and click on "Create action" button.

  • Set "name" to ZabbixMaintenance
  • Create a new condition with "Trigger name" > "contains" > "ZabbixMaintenance"
  • In "Operations" tab, add on operation that sends to "ZabbixMaintenance" the message "{ITEM.VALUE}"

Usage & Parameters

General usage

zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k ZabbixMaintenance -o ""

Data message parameters

Mandatory parameters

action=<create|delete> comment= host= or group=

Optional parameters

tag=:(:<operator[0|2]]>), default operator 0 (equals) duration=, default 60 minutes nodata, default maintenance is with data collection, use nodata to disable data collection

Examples

Creating a maintenance

zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k ZabbixMaintenance -o "action=create;comment=test maintenance B test-host2 with 2 tags and no data collection;host=test-host2;tag=SYSTEM:Linux;tag=tag1:contains1:2;nodata"
zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k ZabbixMaintenance -o "action=create;duration=30;comment=test maintenance D with group TEST_HGP and 1 tag equal;group=TEST_HGP;tag=SYSTEM:windows"

Deleting a maintenance

zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k ZabbixMaintenance -o "action=delete;group=TEST1_HGP"

Testing

Tested on Zabbix version >= 5.0.4 you can test various use cases with the test file

Debug

Action logs will output in standard Zabbix server's logs in /var/log/zabbix/zabbix_server.log. All logs are prefixed with "ZabbixMaintenance" keyword.

About

Template and action to manage dynamic maintenance on Zabbix

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages