Zabbix::API::Macro -- 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.
hosts
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.
usermacro.get
exists
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.
prefix
Mutator for the macro's host. HOST should be a Host instance or a hashref with a hostid key.
HOST
Host
hostid
Return a true value when the macro is global, a false value otherwise.
TODO links to other pods and documentation
Fabrice Gabolde <fabrice.gabolde@uperto.com>
Copyright (C) 2011 SFR
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.