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.
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
hosts(), for items.
hosts(), for dependencies (which are
Add a dependency to this trigger. The dependency can be a trigger ID (an integer), or a
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.
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.
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.
Fabrice Gabolde <email@example.com>
Copyright (C) 2011 Devoteam
This library is free software; you can redistribute it and/or modify it under the terms of the GPLv3.