Zabbix::API::Macro(3) Zabbix usermacro objects


use Zabbix::API::Macro;
# TODO write the rest


Handles CRUD for Zabbix usermacro objects.

Both global and host macro types are represented by this class. If the "hosts" arrayref attribute is undef or empty, then we assume it's a global macro.

This class' methods work transparently around the weird Zabbix macro API, which uses different methods on the same object depending on whether it's a global or host macro... except sometimes, for instance the "usermacro.get" method which can be called on both and will return different keys... And macros don't seem to have an "exists" method. It's kind of a mess.

The various massFoo methods have not been implemented at all because I did not have a use for their ``mass'' functionality, despite their being the only way to CRUD host macros.


This class' "prefix" method is not a class method. The prefix returned depends on the type of macro (global or host) which is a characteristic of an instance.
Mutator for the macro's host. "HOST" should be a "Host" instance or a hashref with a "hostid" key.
Return a true value when the macro is global, a false value otherwise.


Fabrice Gabolde <[email protected]>


Copyright (C) 2011 SFR

This library is free software; you can redistribute it and/or modify it under the terms of the GPLv3.