Zabbix::API::Trigger -- Zabbix trigger objects
use Zabbix::API::Trigger; # TODO write the rest
Handles CRUD for Zabbix trigger objects.
This is a subclass of Zabbix::API::CRUDE; see there for inherited methods.
Zabbix::API::CRUDE
Returns true if the trigger exists with this description, false otherwise.
Accessor for a local hosts attribute, which it also sets from the server data when necessary (when it is not yet set, which happens when the trigger has just been fetched or immediately after a pull or push -- this is because a trigger's notion of its host(s) is "whatever is referred to in the trigger expression"). The value returned is an arrayref of Zabbix::API::Host instances.
hosts
Zabbix::API::Host
Same as hosts(), for items.
hosts()
Same as hosts(), for dependencies (which are Trigger instances).
Trigger
Add a dependency to this trigger. The dependency can be a trigger ID (an integer), or a Zabbix::API::Trigger instance.
Zabbix::API::Trigger
Remove a dependency from this trigger. The dependency can be a trigger ID (an integer), or a Zabbix::API::Trigger instance. Unlike the web API method, this method removes a single dependency.
The expression data attribute stored in Zabbix::API::Trigger instances is actually an expression ID. This is what the web API returns. Expressions are also not mapped by the web API, so this is all you get (well, you can get the list of hosts and items mentioned in the expression). If you plan on using this distribution to manipulate trigger expressions, a workaround is to have the trigger just use a calculated item in a very simple expression, since items work as expected.
expression
Since the web API does not expose a method through which dependencies can be removed individually, the remove_dependency method works around this by deleting all dependencies then adding back the rest.
remove_dependency
Zabbix::API::CRUDE.
Fabrice Gabolde <fabrice.gabolde@uperto.com>
Copyright (C) 2011 Devoteam
This library is free software; you can redistribute it and/or modify it under the terms of the GPLv3.
To install Zabbix::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Zabbix::API
CPAN shell
perl -MCPAN -e shell install Zabbix::API
For more information on module installation, please visit the detailed CPAN module installation guide.